Plugin package
Project description
polywrap-wasm
Python implementation of the plugin wrapper runtime.
Usage
Invoke Plugin Wrapper
from typing import Any, Dict, List, Union, Optional
from polywrap_manifest import AnyWrapManifest
from polywrap_plugin import PluginModule
from polywrap_core import Invoker, Uri, InvokerOptions, UriPackageOrWrapper, Env
class GreetingModule(PluginModule[None]):
def __init__(self, config: None):
super().__init__(config)
def greeting(self, args: Dict[str, Any], client: Invoker[UriPackageOrWrapper], env: Optional[Env] = None):
return f"Greetings from: {args['name']}"
manifest = cast(AnyWrapManifest, {})
wrapper = PluginWrapper(greeting_module, manifest)
args = {
"name": "Joe"
}
options: InvokeOptions[UriPackageOrWrapper] = InvokeOptions(
uri=Uri.from_str("ens/greeting.eth"),
method="greeting",
args=args
)
invoker: Invoker = ...
result = await wrapper.invoke(options, invoker)
assert result, "Greetings from: Joe"
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
Close
Hashes for polywrap_plugin-0.1.0a25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac1ae8e1c1f5a4ebd22b786746bc2761ae2a66fb8138a3706d362f10677889a |
|
MD5 | 6939763925ec5529470d22fa80277447 |
|
BLAKE2b-256 | 931a16fd9b7934cc55047d5fa2939c5963916cf990a379a8ae7825759a8b1efa |