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
File details
Details for the file polywrap_plugin-0.1.0a33.tar.gz
.
File metadata
- Download URL: polywrap_plugin-0.1.0a33.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1039-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 902daa63fa6f1fe6d6f404f74b07c260b10b6f9ccd26e9703abf4aa5e6777623 |
|
MD5 | 01e62d9e6a821b0cf82b40895b80a5d5 |
|
BLAKE2b-256 | 5f402888ec1fa8d94f4a174c02b1f00c06e1073f90eb2c93e31aaa093f5a4d53 |
Provenance
File details
Details for the file polywrap_plugin-0.1.0a33-py3-none-any.whl
.
File metadata
- Download URL: polywrap_plugin-0.1.0a33-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1039-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e729bc975ef00ab27d3bd29720cf03d1d74a02079c8536437c6dd8515b4f44a |
|
MD5 | 891cec57548a5ccdfc3710dc879bbe0d |
|
BLAKE2b-256 | 4b56a46da292a36a314fffb4436ac6228ee50b7ebed3c933219b51ee135c963e |