Official standard-library packages for Edge Python. Most are a Rust crate compiled to wasm32-unknown-unknown against the wasm-pdk ABI; hosts load the resulting .wasm over the standard plugin contract, no custom embedder, no Rust on the consumer side. A package can also ship as pure Edge Python source (src/entry.py), imported as a code module with no cargo build (e.g. test).
The folder name IS the package name. A native package builds to <name>/target/wasm32-unknown-unknown/release/<name>.wasm; a pure-Python package has src/entry.py and no build artifact. Each package's <name>.json corpus sits in its folder; cases in it are automatically prefixed with from <name> import *\n before dispatch, so the corpus only contains the code being tested.
| Folder | Description |
|---|---|
json |
JSON serialization/deserialization, see json/README.md |
re |
Regular expressions, a subset with capture, backreferences, lookaround, and a ReDoS step budget, see re/README.md |
math |
CPython-style math over libm, integer ops, and a packed-f64 batch fast path, see math/README.md |
test |
Tiny unit-test harness in pure Edge Python (fixtures, raises, runner with exit code), see test/README.md |
Native packages build independently; the agnostic runner asserts against the produced .wasm, or against src/entry.py for a pure-Python package. From the repo root:
# Build a native package's .wasm artifact (skip for pure-Python packages like test).
( cd json && cargo build --release --target wasm32-unknown-unknown )
# One command, drives all corpora through the shared runner.
deno test --allow-all tests/The runner discovers packages by walking the repo root for <name>/<name>.json corpora. CI runs this matrix via .github/workflows/.
For a native (wasm) package:
- Create
<name>/at the repo root withCargo.toml(name = "<name>",crate-type = ["cdylib"],wasm-pdkdep) and asrc/lib.rsexporting via#[plugin_fn]. - Drop
<name>/<name>.jsonwith the corpus (Edge Python source + expectedoutput/errorper case). - Run
cargo build --release --target wasm32-unknown-unknowninside the package folder. - Run
deno test --allow-all tests/from the repo root.
For a pure-Python package, skip the crate: add <name>/src/entry.py plus <name>/<name>.json, then run deno test --allow-all tests/. The runner routes .py packages to their source and skips the wasm build.
No edits to tests/.
MIT OR Apache-2.0