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

Uploaded Source

Built Distributions

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

wasmtime-46.0.1-py3-none-win_arm64.whl (6.9 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

wasmtime-46.0.1-py3-none-musllinux_1_2_x86_64.whl (9.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

wasmtime-46.0.1-py3-none-musllinux_1_2_aarch64.whl (8.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

wasmtime-46.0.1-py3-none-manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded Python 3

wasmtime-46.0.1-py3-none-manylinux1_x86_64.whl (9.8 MB view details)

Uploaded Python 3

wasmtime-46.0.1-py3-none-macosx_11_0_arm64.whl (8.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

wasmtime-46.0.1-py3-none-macosx_10_13_x86_64.whl (9.5 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

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

Uploaded Python 3

wasmtime-46.0.1-py3-none-android_26_x86_64.whl (9.8 MB view details)

Uploaded Android API level 26+ x86-64Python 3

wasmtime-46.0.1-py3-none-android_26_arm64_v8a.whl (8.8 MB view details)

Uploaded Android API level 26+ ARM64 v8aPython 3

File details

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

File metadata

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

File hashes

Hashes for wasmtime-46.0.1.tar.gz
Algorithm Hash digest
SHA256 0da0388c21bc0f0e633c7a30f2b7939a657f5019258c9a3a63fd37298a0dbb8b
MD5 090c31fb51f5f16e40b220484f882297
BLAKE2b-256 4708cc1b66560214169ceaa8a241d9fa72c03e7a37e36db278bb956437164d12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmtime-46.0.1-py3-none-win_arm64.whl
  • Upload date:
  • Size: 6.9 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-46.0.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 967625406fde8fc3c9d795ffbb7bdde77d0a38de776e8eb7a0416ca6d811a27a
MD5 e606db69c24a19061dcafca85e2399ae
BLAKE2b-256 888e820c09304a119b6b0871e8bdb5d9365cc43689057227bdc8960909cb712f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmtime-46.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.12

File hashes

Hashes for wasmtime-46.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 559b0753e3ea311fd16000fe51c08592a625e61ebb8640601ae7173fc516e430
MD5 e668260717822a85bc64ac32e5315896
BLAKE2b-256 d3928fafb879019178c2ecfdd5e62fa4e31cd6809444e646dd7d79c107ab3638

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 05fc65164b4825bf1c3c8f007df070b25accc974cb81d0bfc1c5d76fdf6f70e0
MD5 7a589e9b1ff69eaf335ce06b5b91ec37
BLAKE2b-256 9b7960738724291a6453503597993ac4289c24b3080b30fed90c44f332f0f381

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f295d10012b6ca6ecffa7757eed70b84ebaa2e33dc39275e7b6bed5eed5130b9
MD5 34d182dec377cec28ff41699088741c1
BLAKE2b-256 9a4a83a75f75f67a0bb4a3a37a9273619ccdefa68ed9f2882ae684dd1e8df059

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 841b53fc17eedabaa6deb1e062a04a0a8953908d540fadb4149bc55c3f6d3e50
MD5 55a8e2a10a09d162e1defa32bb58c3c9
BLAKE2b-256 4413e2ec64f8d40380379567eda2f5976c1587d7a4e03f22e79ebc9a3b271d54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e53c65abe31aeeb19a3f794b6e53140d401c4c79ad91c89caefdc502ee2b10c1
MD5 69e8e1777b0252b3a8045056efd7aeed
BLAKE2b-256 666e04593825386a9135e6cdd89b9910adddf2cbbb82eb4105cedb3c73824fe7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de1a69573a173b5171f9413bcf0b88f4fed2721ed02c842fc25de5358730ccdf
MD5 a93313b235badfa2303f9538148b2bf4
BLAKE2b-256 805b54c773acaf90d8f82ec8476d96001fce84f9378dfd35ff3f062eb3d48a7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 9b46c546bf73ece2600403db7dc604c3ef12046ccf2fabe07d7bfaa00453ce8b
MD5 719a8424774bf1e2d35594a6bc9bc524
BLAKE2b-256 c2348e3aedf1b3feb329d92f477d0c9e93b36f4551315fd1394023841dd2f4ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmtime-46.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.12

File hashes

Hashes for wasmtime-46.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85a092a63c20ccecb965b9aa12a19368d2e06203436d19701068efc390efa678
MD5 bdd6854b6450c32a6de6469e3ee3344b
BLAKE2b-256 0e9c27a92babe08e48127ee0bbed37cc404ac07b433cb419d2bd617a4f9b164b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-android_26_x86_64.whl
Algorithm Hash digest
SHA256 f8e4b0ec402b84b856d3c6c2f96c6e6889c56e685b5cfed0a4040775c751ca38
MD5 14795d0bbc3ff083c935b3af72c2e62f
BLAKE2b-256 a79e06f7b67811fda30321b389639c41c77b50e3664012848fa7495221dcf910

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-46.0.1-py3-none-android_26_arm64_v8a.whl
Algorithm Hash digest
SHA256 cc8d52f9ad3bedc1e4de5002f7b22d7cac400be046711d177f6ce20a11eacb31
MD5 f82d78690bf22df85ba12ea129b5b5d9
BLAKE2b-256 12af88abdc5c5ad7bfaa23b599300f4ef598bd999522c5711adedf3679935b4f

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