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.0a20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce310687dbeb609d281b62d9a1da11fcecf4c35ac44f2efc13b970eecb2ce8af |
|
MD5 | 37333249b02b61d2a6e2b27c47e959a7 |
|
BLAKE2b-256 | 3b9bff331bdba439eb859a75dfff8689440d64cf9754c49014afe8045db95ae4 |