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

Uploaded Source

Built Distributions

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

wasmtime-43.0.0-py3-none-win_arm64.whl (5.5 MB view details)

Uploaded Python 3Windows ARM64

wasmtime-43.0.0-py3-none-win_amd64.whl (6.5 MB view details)

Uploaded Python 3Windows x86-64

wasmtime-43.0.0-py3-none-musllinux_1_2_x86_64.whl (7.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

wasmtime-43.0.0-py3-none-musllinux_1_2_aarch64.whl (6.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

wasmtime-43.0.0-py3-none-manylinux2014_aarch64.whl (6.9 MB view details)

Uploaded Python 3

wasmtime-43.0.0-py3-none-manylinux1_x86_64.whl (7.8 MB view details)

Uploaded Python 3

wasmtime-43.0.0-py3-none-macosx_11_0_arm64.whl (6.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

wasmtime-43.0.0-py3-none-macosx_10_13_x86_64.whl (7.6 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

wasmtime-43.0.0-py3-none-any.whl (6.5 MB view details)

Uploaded Python 3

wasmtime-43.0.0-py3-none-android_26_x86_64.whl (7.8 MB view details)

Uploaded Android API level 26+ x86-64Python 3

wasmtime-43.0.0-py3-none-android_26_arm64_v8a.whl (6.9 MB view details)

Uploaded Android API level 26+ ARM64 v8aPython 3

File details

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

File metadata

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

File hashes

Hashes for wasmtime-43.0.0.tar.gz
Algorithm Hash digest
SHA256 eb98b8e2bc35d03dd69c9dd095a388044323622526fc94a9406b8efc48ddc259
MD5 7f09938a1fada305843fc75ab41e149a
BLAKE2b-256 c30e967542865d59d9529bab604b9b88f09a92636e69cc4b1d30c5013e854493

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wasmtime-43.0.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 5ddb2ba4b354fc4f055c8ce9285e7bc4cb259c339e5834bb4d0739d644042b8e
MD5 508ebfb6b1639094c3091ce9eacbcf64
BLAKE2b-256 ec278ecf7dbbb16dc3ab32fcb205f4d798e77cab264118bc1ac52145a76e38fb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wasmtime-43.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7e6b0d0641d78012bdf7d3622ca4bc969462dcf1d0a6c147dc5d7aae2f5093a9
MD5 6e0e2b2bb0957a3b549604987df137ea
BLAKE2b-256 696757c7e361049554cdedd9253e732a6eace5c643488a0e3886ac3f471a4be7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c7025d477d807df30dad07c9318ea747c6cfc99764c7cb2a8e44e75b8c43e3be
MD5 e8553964f89e4c222aef20bafadc2c8b
BLAKE2b-256 0ffac37e77c907567a8802696f9ab839b719ea811cf3d59ffc815cc95d894339

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 34ff18384ad62625cb1438fd0266f6c74b4a72ddcb8ba30c60a66be3632db44b
MD5 b19a2929695e30d0b7997119342d480d
BLAKE2b-256 ce1981c748c089a693b102f9a6239f2558a0ffd55fc721fcdd139361aaede1a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 30b042fd4a05d0f8a320baed53fcb971aff8a3789ed6967f4521f87931ace717
MD5 446a17cd9c31cb8116bfc0f00de9b244
BLAKE2b-256 d89a4d8760f827931b5b265b83e52316d40b8e0eb999bb8e2d457c2ae172d5cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 341542e87caf1f2ef7ff648a78827fcef5751e3e9be2ee07a1fcf3a04413c213
MD5 2918ea767872a090987d885a1745c21d
BLAKE2b-256 48a925b27545ad916a169583dbea41a6a03c58fe04c1d05fa39797dc43bd50b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a03c7aa03519df58fed5115ad8093d6deac46386115add715e725448e89ab25
MD5 1cc4059c8f475ce585395d7f26be2267
BLAKE2b-256 0842d9588fa6dad9a609e5acaa72d1d5b346b2913f87c2e95d0c7ddadf5e919b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0ff3815f63122d2f59e58c626aad3c4592f1cabc0b6bd7dcc1edc3890eb46783
MD5 5076477144b78d9031b79375c278e665
BLAKE2b-256 bf87b9727ac8ecf02d2bd9af838fe6004c028034ce3f38215a22f8e94705b83d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wasmtime-43.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9441349d9346230420ed24d357d6f8330fe7251ac5938bb892147728bbe731d7
MD5 a753ecee67df226c41f386cbd9347a73
BLAKE2b-256 2aca67db17c3f098894be798457ce261816fb67c0c1b80c1a53ed1dfa8ed4ff1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-android_26_x86_64.whl
Algorithm Hash digest
SHA256 f65b287290f06751b2c87da3cdb2381b045ac93bc3ee0e3b805c2a6dc5327bc6
MD5 37ecfa8e0c7d14cb150838b82297c1a2
BLAKE2b-256 3baace764724dcede88f9010963ca7d70d0a79655174599ea85074cb2c656d59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmtime-43.0.0-py3-none-android_26_arm64_v8a.whl
Algorithm Hash digest
SHA256 c52d7bd47481958494b6ef9f0ed56d01ba6d7088cc9adbc1414be899b75bc04d
MD5 8241a55eb480597a8262d097122a0690
BLAKE2b-256 10a95e598c9ae8791375fa47b0dad377e0030dcd6da1be527a639670c5a3f9d6

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