Skip to content

dylan-sutton-chavez/edge-python-capabilities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edge Python Capabilities

Official JS modules for Edge Python that expose host APIs (DOM, …) to Python scripts. Each capability is a plain ESM that registers with createWorker via mainThreadModules — no .wasm, no Rust, no custom embedder.

Layout

edge-python-capabilities/
├── dom/
│   ├── src/
│   ├── web/
│   ├── tests/
│   └── README.md
├── network/
│   ├── src/
│   ├── web/
│   ├── tests/
│   └── README.md
├── storage/
│   ├── src/
│   ├── web/
│   ├── tests/
│   └── README.md
└── static/

Each top-level folder is one capability.

Usage

<script type="module">
    import { createWorker } from "https://runtime.edgepython.com/js/src/index.js";
    import { dom } from "./dom/src/index.js";

    const worker = await createWorker({
        wasmUrl: "https://runtime.edgepython.com/js/compiler_lib.wasm",
        mainThreadModules: { dom },
    });
    await worker.run(await (await fetch("./script.py")).text());
</script>

Capabilities

Folder Description
dom Browser DOM access — see dom/README.md
network HTTP fetch, WebSocket, SSE — see network/README.md
storage localStorage, sessionStorage, IndexedDB — see storage/README.md

License

MIT OR Apache-2.0

About

Official .wasm packages that embed host-side bridge code (e.g., JS) and expose it to Python through the capability protocol. Includes modules like requests for networking and DOM bindings for browser interaction.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors