Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polywrap_plugin-0.1.0a35.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

polywrap_plugin-0.1.0a35-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file polywrap_plugin-0.1.0a35.tar.gz.

File metadata

  • Download URL: polywrap_plugin-0.1.0a35.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-1040-azure

File hashes

Hashes for polywrap_plugin-0.1.0a35.tar.gz
Algorithm Hash digest
SHA256 1678de8f51f7c616d2aeac879ed1604c44cc2ed5dc9af9623e2e9b0c4e123f6a
MD5 ce81aa54ba153a2fd700a7fe584de9ff
BLAKE2b-256 b6e85d912006e146fa2f55ccbc515e4cc72fe150f9e1726faed8b777bfef96b5

See more details on using hashes here.

Provenance

File details

Details for the file polywrap_plugin-0.1.0a35-py3-none-any.whl.

File metadata

  • Download URL: polywrap_plugin-0.1.0a35-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-1040-azure

File hashes

Hashes for polywrap_plugin-0.1.0a35-py3-none-any.whl
Algorithm Hash digest
SHA256 589ab9aa1e6ec318654e084b66397b979b8c51a470be717c685067cef0d607d0
MD5 3294e0e52d65faf5ecf10eec39bcfc9b
BLAKE2b-256 57f4efc5b804dadcdd1ebddc91ed2cef5f26f9b83ace4da66060c5a3367b757b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page