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.0b3.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for polywrap_plugin-0.1.0b3.tar.gz
Algorithm Hash digest
SHA256 30ed66c8d595773e597d30cded786b91f14633ba5fdf27578974b7ba9bc6a9ec
MD5 2e502a191e2e72c056471e5b26d73f46
BLAKE2b-256 5a0a91505bcd78559112f0c5315fecc9c1ba33f7fdd352ca4cd4ea9fef6ccd44

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: polywrap_plugin-0.1.0b3-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-1041-azure

File hashes

Hashes for polywrap_plugin-0.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 392c1439490bc733c0133cc5597e2b5f4cba0f70c7d5ff6fe809a774643b3f6d
MD5 22750a36037397a0d85606cb7065f96e
BLAKE2b-256 6d87a0f0941ef4f7f810ec6738a03f5eb7aa317735164f467df906ce18326544

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