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.
Note: :warning: This repo is 1.0 alpha version of the Python SDK and is a work in progress. :warning:
We'd love any feedback you have on it, but consider using the supported python SDK in extism/extism until we hit 1.0.
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.0rc0 --pre
# using poetry
$ poetry add extism=^1.0.0rc0 --allow-prereleases
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
- Create a semver-formatted git tag (
git tag v1.0.0
). - Push that tag to the repository (
git push origin v1.0.0
.) - Wait for the Build workflow to run.
- Once the build workflow finishes, go to the releases page. You should see a draft release.
- Edit the draft release. Publish the release.
- Wait for the Release workflow to run.
- Once the release workflow completes, you should be able to
pip install extism==${YOUR_TAG}
from PyPI.
LICENSE
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
Built Distribution
Hashes for extism-1.0.0rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7066f94d1c897fa45f3a5cd9d88ac309656ad4fe21bb195be30d2f88494e4db |
|
MD5 | 7172a8a111221630a9f0727223d3af7b |
|
BLAKE2b-256 | d6dd1f8c9983d96ddaa9db50baace7d355f614d6ce9a472b5604f8fcd2db0e15 |