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

Uploaded Source

Built Distributions

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

wasmtime-45.0.0-py3-none-win_arm64.whl (6.8 MB view details)

Uploaded Python 3Windows ARM64

wasmtime-45.0.0-py3-none-win_amd64.whl (8.0 MB view details)

Uploaded Python 3Windows x86-64

wasmtime-45.0.0-py3-none-musllinux_1_2_x86_64.whl (9.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

wasmtime-45.0.0-py3-none-musllinux_1_2_aarch64.whl (8.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

wasmtime-45.0.0-py3-none-manylinux2014_aarch64.whl (8.6 MB view details)

Uploaded Python 3

wasmtime-45.0.0-py3-none-manylinux1_x86_64.whl (9.7 MB view details)

Uploaded Python 3

wasmtime-45.0.0-py3-none-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

wasmtime-45.0.0-py3-none-macosx_10_13_x86_64.whl (9.4 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

wasmtime-45.0.0-py3-none-any.whl (8.0 MB view details)

Uploaded Python 3

wasmtime-45.0.0-py3-none-android_26_x86_64.whl (9.6 MB view details)

Uploaded Android API level 26+ x86-64Python 3

wasmtime-45.0.0-py3-none-android_26_arm64_v8a.whl (8.7 MB view details)

Uploaded Android API level 26+ ARM64 v8aPython 3

File details

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

File metadata

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

File hashes

Hashes for wasmtime-45.0.0.tar.gz
Algorithm Hash digest
SHA256 2ad4bf7ca286ceea35c1e420d10b368d7f83faf9a5ffde87b4ee334a9b7f55f3
MD5 4233cf808026d36ff2a18b4d13abb0d5
BLAKE2b-256 b1ffdb9cfc61d988bc15303134bb174176a29839976876dfd18c3a12548ad291

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmtime-45.0.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 6.8 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-45.0.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 ae9726590e6d90c6305b8b507c93468b145204d4390aa9a2e29e26babcae110e
MD5 a6634e242a29f390863f9426e09f6678
BLAKE2b-256 9cd1ac536e92ac95a02e137be5b6829f15b87d5eef93ace32e5ee8035155b839

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmtime-45.0.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 8.0 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-45.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1736a70a48f713aaf1a878514d29cc6f554213b5431e04447813a3b9b4320381
MD5 b8d9b3558532c6ca22760e539c9c3f76
BLAKE2b-256 20718e31ea472ceb934e7261ac59a786e82cd82b4d4dcb7c870d498aa9c3c21e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a0b6ca14b4628a5d1ffa91ccf2c0f2c58fa171f126ec085d564b09d5795395dd
MD5 a68a42eebca6ccc079bffca15ad62375
BLAKE2b-256 ea6349d8317706a108d9ed1d4166d0fc710796da1b20e591a98a96575dec367a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 bef65282b7de744106a91da43e4d06ba19d2d587bc54abb83b3e757f0c4fc030
MD5 5cd266058b3aa02f336822d20b756996
BLAKE2b-256 62129b41740da83f51014b88181c9086de0ed75d736a5329baff7323c4fb6eff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a499f6ab0eebb70dca83d6a4904b743cd122f322af3abe86af08ad753533d946
MD5 50a2c4c95595a153d170ea7bf37e3d08
BLAKE2b-256 4256ed5f492bd553a31c8e28d621f8256f2c7b1a133b28f73525d96ca355891a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5d1416ec6da8cd87c29e2e9eb074358c91839c2fff971fe428c8921eaae68e73
MD5 6777a9159aa810c730cdd15018423c8d
BLAKE2b-256 d78ce9019a28e908214031310aefd78e4755221d02303190b54b2c85cb69573e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31d10f25c330cebcfb364e9a357123deeec96c41725ff2bba91b705587f38a93
MD5 9bb5bae157ccb5aa29e4815b3f70d59e
BLAKE2b-256 5b0ba81b5daf5adea482ecb68d9615f6a348486ab4d8e980a915d4420e57ee4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3579b0ec6d001750d66ec7089aaeee2c048f88328c82743e15f099af01b0cf84
MD5 d037c6d3790a6581e594cced25bdb328
BLAKE2b-256 75767d0e440ca03a717a97889dbb7b68f952c20ed4ffd3f59addf9553579e1d5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wasmtime-45.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6251ee5074a8b8bfaa98e6e99cb5d49d6d0f2320b3265d5aa6c2ee5df5fb4519
MD5 0b6e0fe446dd1e8b15cd6a6c8fdc859b
BLAKE2b-256 e1c77594da7fa8a3bc5e765733ad57aac9b7b27262c4afa47521bd500e4a4574

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-android_26_x86_64.whl
Algorithm Hash digest
SHA256 35e713f907264e470f3bc9b592b81b8ed0f8f5651725d9f07a5d52beb0642e38
MD5 384ca3fcdf4b4d99c71abbf06c48a376
BLAKE2b-256 3f81c4d81ebf3db8aa28f789a9569640f30790d5234c509a0234cd502aa2638b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-45.0.0-py3-none-android_26_arm64_v8a.whl
Algorithm Hash digest
SHA256 4e843795b53e66c71313f2254731467372e5e1549227cf14accb9e2d57701c10
MD5 621ceb44c94dbf605656762316f73638
BLAKE2b-256 75567d941adba273210dcf4198266a47f472a5eeca20172005b443af71a9a3e7

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