Skip to main content

Extism Host SDK for python

Project description

Extism Python Host SDK

This repo contains the Python package for integrating with the Extism Webassembly framework. Install this library into your Python application host to run Extism WebAssembly guest plug-ins.

import extism
import json

manifest = {"wasm": [{"url": "https://github.com/extism/plugins/releases/latest/download/count_vowels.wasm"}]}
with extism.Plugin(manifest, wasi=True) as plugin:
    wasm_vowel_count = plugin.call(
        "count_vowels",
        "hello world",
        parse = lambda output: json.loads(bytes(output).decode('utf-8'))
    )
print(wasm_vowel_count) # {'count': 3, 'total': 3, 'vowels': 'aeiouAEIOU'}

Installation

Install this package from PyPI:

# using pip
$ pip install extism==1.0.0

# using poetry
$ poetry add extism=^1.0.0

The extism package should install an appropriate extism_sys dependency containing a prebuilt shared object for your system. We support the following targets:

  • MacOS 11.0+, arm64
  • MacOS 10.7+, x86_64
  • Manylinux 2.17+, aarch64
  • Manylinux 2.17+, x86_64
  • MUSL Linux 1.2+, aarch64
  • Windows (MSVC), x86_64

If you need support for a different platform or architecture, please let us know!

Documentation

Check out the docs:

Development

Local dev

Install just. Running just test should install all other prerequisites.

Release workflow

  1. Create a semver-formatted git tag (git tag v1.0.0).
  2. Push that tag to the repository (git push origin v1.0.0.)
  3. Wait for the Build workflow to run.
  4. Once the build workflow finishes, go to the releases page. You should see a draft release.
  5. Edit the draft release. Publish the release.
  6. Wait for the Release workflow to run.
  7. Once the release workflow completes, you should be able to pip install extism==${YOUR_TAG} from PyPI.

LICENSE

BSD-3-Clause

Project details


Download files

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

Source Distribution

extism-1.0.3.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

extism-1.0.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file extism-1.0.3.tar.gz.

File metadata

  • Download URL: extism-1.0.3.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for extism-1.0.3.tar.gz
Algorithm Hash digest
SHA256 7c1cf6e88996f2823fcf49d08e8dff942e5212d81344b96364a8fa17db3ab97f
MD5 90d93b9b5cdc5cbe10e5ce61313f3201
BLAKE2b-256 7094fdd0d2c0a48930ea2a19044ee0e5f321fd4b750adcdb262ed9768538f821

See more details on using hashes here.

File details

Details for the file extism-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: extism-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for extism-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5d8163804e98ae067e73759742f551fc0a799ea730de3a78fb6ece61eb0a1aae
MD5 f12f20075e222fc69a7281454ef4ea2e
BLAKE2b-256 c2173319158e65d8da1883ab3f29911cc912f25618aaf0db6197bf7014cf2b5e

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