Skip to main content

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


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

Uploaded Source

Built Distribution

polywrap_plugin-0.1.0a23-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polywrap_plugin-0.1.0a23.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1035-azure

File hashes

Hashes for polywrap_plugin-0.1.0a23.tar.gz
Algorithm Hash digest
SHA256 654cab9130b4bb8ee58def886219f9cc05729a7a1fd4507b8dadee595c6f3cf8
MD5 a871ed0c584f675ccb3afb4341048382
BLAKE2b-256 e23a64e9b1da90274e0c5fb6cad978ec5fa8de83c953c37ea1bfb6715cee68aa

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: polywrap_plugin-0.1.0a23-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1035-azure

File hashes

Hashes for polywrap_plugin-0.1.0a23-py3-none-any.whl
Algorithm Hash digest
SHA256 c63d9839523ee2bfb3390e7812c9740ade99b87a766ae026454c7f7078e33afa
MD5 12f427d773b15f3dfdd7977eabb90a99
BLAKE2b-256 4b7c5042604a998e5813a2b455e4a093082ddc033ece98ceec73f7b32d91514a

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