Plugin package
Project description
polywrap-plugin
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 InvokerClient, 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"
}
client: InvokerClient = ...
result = await wrapper.invoke(
uri=Uri.from_str("ens/greeting.eth"),
method="greeting",
args=args,
client=client
)
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.0a32-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f3b82fe3d93267d5a0ed9b95db5b8bee61e22d95f48489c3062a74d5c29a6af |
|
MD5 | 782e1d0fbfd74d08d47c7ed81f268383 |
|
BLAKE2b-256 | edd6039c9daa45d08dd5dd58bec546cf20967adf0f4c3d9490bf59c4e243ef49 |