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'}
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:
arm64
x86_64
aarch64
x86_64
aarch64
x86_64
If you need support for a different platform or architecture, please let us know!
Check out the docs:
Install just. Running just test
should install all
other prerequisites.
git tag v1.0.0
).git push origin v1.0.0
.)pip install extism==${YOUR_TAG}
from PyPI.