{"id":22882842,"url":"https://github.com/olivi-r/wasmpy","last_synced_at":"2025-06-14T14:03:36.207Z","repository":{"id":62588236,"uuid":"307518336","full_name":"olivi-r/wasmpy","owner":"olivi-r","description":"WebAssembly in Python.","archived":false,"fork":false,"pushed_at":"2025-04-16T19:22:33.000Z","size":805,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T14:02:50.955Z","etag":null,"topics":["amd64","assembly","cpython","i386","i686","ia32","python","python3","wasm","wast","wat","webassembly","webassembly-python","webassembly-runtime","x86","x86-64"],"latest_commit_sha":null,"homepage":"http://olivia.is-a.dev/wasmpy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olivi-r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-26T22:17:17.000Z","updated_at":"2024-06-07T11:14:56.000Z","dependencies_parsed_at":"2023-12-26T01:28:10.097Z","dependency_job_id":"811c972d-18a1-478c-b150-cbc146586692","html_url":"https://github.com/olivi-r/wasmpy","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/olivi-r/wasmpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivi-r%2Fwasmpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivi-r%2Fwasmpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivi-r%2Fwasmpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivi-r%2Fwasmpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olivi-r","download_url":"https://codeload.github.com/olivi-r/wasmpy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivi-r%2Fwasmpy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259827501,"owners_count":22917707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd64","assembly","cpython","i386","i686","ia32","python","python3","wasm","wast","wat","webassembly","webassembly-python","webassembly-runtime","x86","x86-64"],"created_at":"2024-12-13T18:29:23.968Z","updated_at":"2025-06-14T14:03:36.144Z","avatar_url":"https://github.com/olivi-r.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/6jo7yag38m5ilv6h?svg=true)](https://ci.appveyor.com/project/olivi-r/wasmpy)\n\n# wasmpy\n\nWebAssembly in Python.\n\nWasmpy is a lightweight layer that sits between Python and WebAssembly. When attempting to import a WebAssembly file, the file is converted into machine code for native speeds.\n\n# Installing\n\n```sh\npython3 -m pip install wasmpy\n```\n\n# Usage\n\nTo get started, first import the `wasmpy` module to register the WebAssembly import hooks.\n\nThen you can just `import wasm_or_wat_file` to load a WebAssembly module.\n\n## Usage with Python modules\n\n```\n|-  my_module\n    |-  __init__.py\n    |-  wasm_math.wat\n```\n\n```python\n# __init__.py\n\nimport wasmpy\nfrom .wasm_math import add\n```\n\n```webassembly\n;; wasm_math.wat\n\n(module\n    (func (export \"add\") (param i32 i32) (result i32)\n        (i32.add (local.get 0) (local.get 1))\n    )\n)\n```\n\n```python\n\u003e\u003e\u003e import my_module\n\u003e\u003e\u003e my_module.add(45, 960)\n1005\n\u003e\u003e\u003e\n```\n\n## Invalid function names\n\nFunctions exported from WebAssembly can also be accessed from the module by using their name as a key.\n\nFor exported names that aren't valid Python identifiers or which start with a `_`, this is the only valid way of accessing these functions.\n\n```webassembly\n;; wasm_math.wat\n\n(module\n    (func (export \"add one\") (param i32) (result i32)\n        (i32.add (local.get 0) (i32.const 1))\n    )\n)\n```\n\n```python\n\u003e\u003e\u003e import wasmpy\n\u003e\u003e\u003e import wasm_math\n\u003e\u003e\u003e wasm_math[\"add one\"](11)\n12\n\u003e\u003e\u003e\n```\n\n# Building From Source\n\nOn Windows this requires [mingw-w64](https://www.mingw-w64.org/downloads/)\n\n```sh\ngit clone https://github.com/olivi-r/wasmpy.git\ncd wasmpy\nmake -f \u003clinux/windows\u003e.mk\npython3 -m pip install .\n```\n\n# Limitations\n\nWasmpy is still in active development, and only supports x86/x86-64 Windows and Linux machines and lacks some key features:\n\n- most memory instructions\n- most control instructions\n- imports\n- tables\n\n# Goals\n\n- Current target:\n\n  - Reach compatability with the [MVP](https://www.w3.org/TR/wasm-core-1)\n\n- Future Goals\n  - Native support for more architectures, particularly those supported by [manylinux](https://github.com/pypa/manylinux)\n  - Interfacing with the [Python C API](https://docs.python.org/3/c-api) from WebAssembly (in conjunction with the Wasmpy sister project [wasmpy-build](https://github.com/olivi-r/wasmpy-build)) to allow compiled extension modules that are platform independent\n  - Compatibility with [Pyodide](https://github.com/pyodide/pyodide)\n  - Python implementation support for Jython, PyPy etc.\n  - Support for [WebAssembly proposals](https://github.com/WebAssembly/proposals)\n  - Support for [WASI](https://wasi.dev) snapshots, as well as support for supersets such as [WASIX](https://wasix.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivi-r%2Fwasmpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folivi-r%2Fwasmpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivi-r%2Fwasmpy/lists"}