Skip to main content

WebAssembly build tool for CPython C extensions

Project description

wasmpy-build

This tool can compile CPython C extension files, such as the ones created by Cython, to WebAssembly so that the extensions are platform independent.

This project contains modified CPython header files as well as a build script to ease the creation of .wasm extension files.

Currently this project only supports CPython 3.8, 3.9, 3.10 and 3.11 but I'm hoping to add support for older and future versions.

The project will automatically download wasi-sdk on first use.

Installation

Install from pip

pip install wasmpy-build

or build from source

git clone --recurse-submodules https://github.com/olivi-r/wasmpy-build
cd wasmpy-build
pip install patch
python patch_headers.py
python -m pip install .

Usage

Pass the file with any extra arguments to the console scripts:

C

wasmpy-build my_file.c -o my_file.wasm

C++

wasmpy-build++ my_file.cpp -o my_file.wasm

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

wasmpy-build-0.4.1.tar.gz (801.7 kB view details)

Uploaded Source

Built Distribution

wasmpy_build-0.4.1-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file wasmpy-build-0.4.1.tar.gz.

File metadata

  • Download URL: wasmpy-build-0.4.1.tar.gz
  • Upload date:
  • Size: 801.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for wasmpy-build-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d0dc50a408816b258ac937ff3505a6ef12eb5622d2aeaa91978e812877622a20
MD5 6f0751c41ca8836f0af9b72619333839
BLAKE2b-256 e9f6fde0b97afa1e5f41c8145e6c21b22304c24ef9ef7c75de5e4cad3e1d0b35

See more details on using hashes here.

File details

Details for the file wasmpy_build-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: wasmpy_build-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for wasmpy_build-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72582ecd85a4a8f744c04e417f58b9a267cc127d1ad7e06566268303669d2bd9
MD5 bbf090dbf3e0483621db3102b5434433
BLAKE2b-256 2edb16947f6110f20f3882ff264170f6b8507e43c426a71692f58ec4e9fc3c6d

See more details on using hashes here.

Supported by

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