This is a tool to convert a Python application to a WebAssembly component. It takes the following as input:
- a WIT file or directory
- the name of a WIT world defined in the above file or directory
- the name of a Python module which targets said world
- a list of directories in which to find the Python module and its dependencies
The output is a component which may be run using
e.g. wasmtime
. See the
tests for examples.
For an example of running a sandboxed Python guest within a Python host, see component-sandbox-demo.
pip install componentize-py
- WASI SDK v16 (later versions may work, but have not yet been tested)
- Install this to
/opt/wasi-sdk
, or else specify an alternative location via theWASI_SDK_PATH
environment variable
- Install this to
- Tools needed to build CPython (e.g. Make, Clang, etc.)
- Rust v1.68 or later, including the
wasm32-wasi
andwasm32-unknown-unkown
targets
cargo run --release -- --help