Skip to main content

A WebAssembly runtime powered by Wasmtime

Project description

wasmtime-py

Python embedding of Wasmtime

A Bytecode Alliance project

CI status Latest Version Latest Version Documentation Code Coverage

Installation

To install wasmtime-py, run this command in your terminal:

$ pip install wasmtime

The package currently supports 64-bit builds of Python 3.9+ on Windows, macOS, and Linux, for x86_64 and arm64 architectures.

Versioning

wasmtime-py follows the Wasmtime versioning scheme, with a new major version being released every month. As with Wasmtime itself, new major versions of wasmtime-py can contain changes that break code written against the previous major version.

Since every installed Python package needs to agree on a single version of wasmtime-py, to use the upper bound on the major version in the dependency requirement should be bumped reguarly, ideally as soon as a new wasmtime-py version is released. To automate this process it is possible to use the whitequark/track-pypi-dependency-version script. YoWASP/runtime is an example of a project that automatically publishes releases on PyPI once a new version of wasmtime-py is released if it passes the testsuite.

Usage

In this example, we compile and instantiate a WebAssembly module and use it from Python:

from wasmtime import Store, Module, Instance, Func, FuncType

store = Store()
module = Module(store.engine, """
  (module
    (func $hello (import "" "hello"))
    (func (export "run") (call $hello))
  )
""")

def say_hello():
    print("Hello from Python!")
hello = Func(store, FuncType([], []), say_hello)

instance = Instance(store, module, [hello])
run = instance.exports(store)["run"]
run(store)

Be sure to check out the examples directory, which has other usage patterns as well as the full API documentation of the wasmtime-py package.

Components

Components are also supported in wasmtime-py. For more information see the documentation of wasmtime.component. Using a component is similar to using core wasm modules, and for examples see the tests/component/ directory.

Contributing

See CONTRIBUTING.md.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

wasmtime-44.0.0.tar.gz (120.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

wasmtime-44.0.0-py3-none-win_arm64.whl (6.3 MB view details)

Uploaded Python 3Windows ARM64

wasmtime-44.0.0-py3-none-win_amd64.whl (7.4 MB view details)

Uploaded Python 3Windows x86-64

wasmtime-44.0.0-py3-none-musllinux_1_2_x86_64.whl (9.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

wasmtime-44.0.0-py3-none-musllinux_1_2_aarch64.whl (8.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

wasmtime-44.0.0-py3-none-manylinux2014_aarch64.whl (7.9 MB view details)

Uploaded Python 3

wasmtime-44.0.0-py3-none-manylinux1_x86_64.whl (9.0 MB view details)

Uploaded Python 3

wasmtime-44.0.0-py3-none-macosx_11_0_arm64.whl (7.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

wasmtime-44.0.0-py3-none-macosx_10_13_x86_64.whl (8.7 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

wasmtime-44.0.0-py3-none-any.whl (7.4 MB view details)

Uploaded Python 3

wasmtime-44.0.0-py3-none-android_26_x86_64.whl (8.9 MB view details)

Uploaded Android API level 26+ x86-64Python 3

wasmtime-44.0.0-py3-none-android_26_arm64_v8a.whl (8.0 MB view details)

Uploaded Android API level 26+ ARM64 v8aPython 3

File details

Details for the file wasmtime-44.0.0.tar.gz.

File metadata

  • Download URL: wasmtime-44.0.0.tar.gz
  • Upload date:
  • Size: 120.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wasmtime-44.0.0.tar.gz
Algorithm Hash digest
SHA256 1e5e7a7046136054e12f82101a9b5ce30b02d4f92946e6fbe3e2fced61a6b1a5
MD5 fc999128bbf4b2a0189d92b786d9ede2
BLAKE2b-256 cd9fb9e08200c362af1f08ca3f50b54a05573b9cca840cb981e70bdfe1658b24

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: wasmtime-44.0.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 6.3 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wasmtime-44.0.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 931cd4d886ae6a2a06f5cfe47bf6f7a3b2635fa512a81cd1c55975505ace8cc1
MD5 4d0ee562ce2e6b6f28c69593c409960a
BLAKE2b-256 7866acf3821098944ca1f0118052912ee3bf1d941ff979d4adf3ad3684672fe8

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: wasmtime-44.0.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 7.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wasmtime-44.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4b5c52475148f827abd9feff4460689f6979c0333b612c6c3d9211c4b7c7258d
MD5 2ee29d1d3534715a157ca73f8fa1bc37
BLAKE2b-256 b43fa32a7cc777f1ee3d314cbe99280b4b5e322423ef9ff84dbac7a1897d4230

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a7840d7d81e59ff666067031b3bde727ff28f923c5040b1a3cae4d8d37340f18
MD5 5b0dbc588e04117c5daf3eaaa04305e2
BLAKE2b-256 78e65ebd6db7014a64e715febd3346cf0f48b3f8d216720ddfbd798a07a16e31

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7326e8cc02b583a7817cf50029d8e9b06c13d2f3573b3e677dbe51a8c52245d7
MD5 44f23fb2ee817642c7f351f382371dfe
BLAKE2b-256 daf0dc7bec6880abbdf3944e728df03e4479b9f25c860e57f499d48140f740d3

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e686644bcddfec89095c9fd982b0848ab5e494ece865517214a63430b2ed08f8
MD5 16ccb0661379c2f6f6b9324d37c753dc
BLAKE2b-256 bf27bca7dcadebfbe6a304e84f85f8921a7c0dde6711b42bec14f2f4d23b1023

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f8d5bbd234bb99f9e94e284fba67b5e899ddebe2d4be7384f78396bdd4ce27a6
MD5 a9f289f9328d1c5c3e06804480351cf3
BLAKE2b-256 c5c19c64ed6c2d152b56482bb66297bfc03442d25449bfa91da7bf2e58a80f01

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07e96eb5bbf40473ea51f2cb3b3f5358537e41644662e02115edf5bd7883c9ca
MD5 ff857f301032af92be032611855ec7db
BLAKE2b-256 483f53f3989a32d0cd0b8345e93e4d7e162e7b392ad8dac4fd59ec284b4c7172

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 019923321cf9244ed48d8f3858e50a93500a523c44b31d7b93c8c30195c4b9aa
MD5 93e82c03a422c89e22842ec972537185
BLAKE2b-256 3304672333a17f941605daab1a2b0a1f67c079526c564b7d70d5a233ce6ccfc1

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-any.whl.

File metadata

  • Download URL: wasmtime-44.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wasmtime-44.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28903f584fd9707438551ed3878bad61d841be78c715db4e20bf30e43b185825
MD5 f07611fb720bd73c6e2a5f6a32909e87
BLAKE2b-256 2aaa19e06d2a24cffe8c6af2de28862bfc02f3cef745e24d4886787db6c3d64d

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-android_26_x86_64.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-android_26_x86_64.whl
Algorithm Hash digest
SHA256 2e7db391e7cd274c3608bf22a2b2706bfbcc44a233c9a62277f0f03f9e0f48ad
MD5 569dc11c63e6cb1f312c296a6956ef15
BLAKE2b-256 6ea65dac42dfa129042cac70d3d07bb8568d7b6319222333733de7a392cf109f

See more details on using hashes here.

File details

Details for the file wasmtime-44.0.0-py3-none-android_26_arm64_v8a.whl.

File metadata

File hashes

Hashes for wasmtime-44.0.0-py3-none-android_26_arm64_v8a.whl
Algorithm Hash digest
SHA256 5bc01e2f1dae1e85b19343a718bf2b1dc9f0fa6b9f8c5f2922b9fb4b29fb56bd
MD5 3de09764262acad359b2822504323276
BLAKE2b-256 27e6756c5b1bbccb394cc86a29f47ddb9b764e05a429742bec4fdfd499b61481

See more details on using hashes here.

Supported by

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