waspy 0.9.0

A Python interpreter written in Rust, designed for WebAssembly.
Documentation
pub mod collections;
pub mod datetime;
pub mod functools;
pub mod itertools;
pub mod json;
pub mod logging;
pub mod math;
pub mod os;
pub mod random;
pub mod re;
pub mod sys;

pub fn is_stdlib_module(name: &str) -> bool {
    matches!(
        name,
        "sys"
            | "os"
            | "math"
            | "random"
            | "json"
            | "re"
            | "datetime"
            | "collections"
            | "itertools"
            | "functools"
            | "logging"
    )
}

pub fn get_stdlib_attributes(module: &str, attr: &str) -> Option<StdlibValue> {
    match module {
        "sys" => sys::get_attribute(attr),
        "os" => os::get_attribute(attr),
        "math" => math::get_attribute(attr),
        "random" => random::get_attribute(attr),
        "json" => json::get_attribute(attr),
        "re" => re::get_attribute(attr),
        "datetime" => datetime::get_attribute(attr),
        "collections" => collections::get_attribute(attr),
        "itertools" => itertools::get_attribute(attr),
        "functools" => functools::get_attribute(attr),
        "logging" => logging::get_attribute(attr),
        _ => None,
    }
}

pub fn is_stdlib_submodule(module: &str, submodule: &str) -> bool {
    matches!((module, submodule), ("os", "path"))
}

#[derive(Debug, Clone)]
pub enum StdlibValue {
    Int(i32),
    String(String),
    List(Vec<String>),
    Dict(Vec<(String, String)>),
    Float(f64),
    None,
    Module(String), // Represents a sub-module like os.path
}