Skip to main content

Tool to package Python applications as WebAssembly components

Project description

componentize-py

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.

Installing from PyPI

pip install componentize-py

Building from source

Prerequisites

  • 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 the WASI_SDK_PATH environment variable
  • Tools needed to build CPython (e.g. Make, Clang, etc.)
  • Rust v1.68 or later, including the wasm32-wasi and wasm32-unknown-unkown targets

Building and Running

cargo run --release -- --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

componentize_py-0.2.2.tar.gz (67.5 kB view hashes)

Uploaded Source

Built Distributions

componentize_py-0.2.2-cp37-abi3-win_amd64.whl (13.1 MB view hashes)

Uploaded CPython 3.7+ Windows x86-64

componentize_py-0.2.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

componentize_py-0.2.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (15.6 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

componentize_py-0.2.2-cp37-abi3-macosx_11_0_arm64.whl (13.8 MB view hashes)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

componentize_py-0.2.2-cp37-abi3-macosx_10_7_x86_64.whl (14.4 MB view hashes)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page