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-47.0.1.tar.gz (129.0 kB view details)

Uploaded Source

Built Distributions

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

wasmtime-47.0.1-py3-none-win_arm64.whl (7.0 MB view details)

Uploaded Python 3Windows ARM64

wasmtime-47.0.1-py3-none-win_amd64.whl (8.1 MB view details)

Uploaded Python 3Windows x86-64

wasmtime-47.0.1-py3-none-musllinux_1_2_x86_64.whl (10.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

wasmtime-47.0.1-py3-none-musllinux_1_2_aarch64.whl (8.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

wasmtime-47.0.1-py3-none-manylinux2014_aarch64.whl (8.8 MB view details)

Uploaded Python 3

wasmtime-47.0.1-py3-none-manylinux1_x86_64.whl (10.0 MB view details)

Uploaded Python 3

wasmtime-47.0.1-py3-none-macosx_11_0_arm64.whl (8.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

wasmtime-47.0.1-py3-none-macosx_10_13_x86_64.whl (9.6 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

wasmtime-47.0.1-py3-none-any.whl (8.1 MB view details)

Uploaded Python 3

wasmtime-47.0.1-py3-none-android_26_x86_64.whl (9.9 MB view details)

Uploaded Android API level 26+ x86-64Python 3

wasmtime-47.0.1-py3-none-android_26_arm64_v8a.whl (8.9 MB view details)

Uploaded Android API level 26+ ARM64 v8aPython 3

File details

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

File metadata

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

File hashes

Hashes for wasmtime-47.0.1.tar.gz
Algorithm Hash digest
SHA256 fab6ee0e87354f14ef228fa71b40841dd3c2c713f6efce636af234b4e3e6edcc
MD5 240c388422425bfd1caf98312b0f9253
BLAKE2b-256 2c9495cab3216e1015379b4d3ad7c43ead61c3d7fbde7c5051aa46676e74a288

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wasmtime-47.0.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 812058e7b40b73defa1d5118c25faa674920b7833c0a22cf79f0ff4eadee0c32
MD5 115788e2d276336a20fcb1b1a257b592
BLAKE2b-256 e3c6183b9cff18b77d7f87ade1ae48ae971b25de3b367bf3c8e65ab253751444

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wasmtime-47.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4e46a4a29092a2ac1001159d5673e2a23996f4474261c791401867b1630429f4
MD5 be930762d8357fac64e715ef4143cf76
BLAKE2b-256 90e48603bd4a360edbe5178efe4e7b48f1677749a96a3caa3fc68ab23b0de62c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f900fa571a9a5668b6210de9ecca1c5b66db14d85b7c36514c3d307d4f4cdc90
MD5 65479e903d06204caeaf0dd30aefb3f6
BLAKE2b-256 aba11640bf06ee0515a3eac1a84ae1805cab5407af6226ad52a9e6034d43974f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0aeb53d4c8e682cccebbaac48882939b34e71a1243b622129de3e6834728044d
MD5 73769bafc3a2e404999ebf12a10783a1
BLAKE2b-256 ab24545c7a118750f997986127e826ae900070c515081b48dba8c7ac175a7956

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4f72162ceed1d50de8226fac6b12e1ecce54883a0c3f7355bb141eae40df488a
MD5 6bf2cc85b69982d9306c1d72f26cd66c
BLAKE2b-256 d793f12469c859fed8332961c4efa68c1f1981542b9ce95248b617255938a55d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9724600b036c6e95c4fe952e29fad83b4f02bdc11d23f25c4ee3ffff2c1d7257
MD5 fe352ce7db107bb746838b69bd3ad05a
BLAKE2b-256 5ebaf321faaad1d616b94fe70a62ebb7e4054cfe41a6a46aa796ad2bb07fa08c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58da69f71750e844e32614c1805246ffca4c8b032d46a8145faa26c228c6c5ac
MD5 d676c01cfa3af7455be90c27ace02ccb
BLAKE2b-256 dcb2fc660c451b7969a9eef8d35f505837ffc8e8a21064f18255a8f0347c1318

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8b4ec103273ec3dce86efe6793d41f83df713983d9cbc5c9662adbb56cf00ffe
MD5 97f9299b7a0f35106ca09ae99de62159
BLAKE2b-256 4a073df9b8dba5d0abf7ea3df5d12048cb2fe4d026f3df14ad9693f81ae71654

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wasmtime-47.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5146a700c93909e797e0f6c05707c992fc75f4f5f5c5ecf826a9aff689ec6af1
MD5 caf9395e0331a5a82b899ab7c0926bfb
BLAKE2b-256 b5c2470db1a8a4fd3080ec91700613526ec5c8f3699bf07cf1aa7c09812063c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-android_26_x86_64.whl
Algorithm Hash digest
SHA256 749c5c1271ca208f1026001ddc65984fa98113e583521d47ae7e11bc96bf337d
MD5 cd698726abf196ff0da523024476e1e6
BLAKE2b-256 cfd49bd5b086f260c6868fe63947d944eed310f8b508768e932d3f1b120bf773

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-47.0.1-py3-none-android_26_arm64_v8a.whl
Algorithm Hash digest
SHA256 844d85628e50929143f03af9a34b3cf5c9148747debced80c14776d27e18173c
MD5 88e88a04693c3cde4c35d122efb77013
BLAKE2b-256 9b97127fac4881fe00c63b76dfdceb6f1478e94be83cbba443340f3c94463e37

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