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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: polywrap_plugin-0.1.0a24.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.0a24.tar.gz
Algorithm Hash digest
SHA256 ac94692380b315cd841b56b04a78d832b9d201bdc11c108cdd99e3dfccdf8b5b
MD5 691d7e5f8b48ea3daea161df1703a965
BLAKE2b-256 2c994d7158fc601add547269eecec58d3f28d0d937da20832855fbeeaa79667c

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: polywrap_plugin-0.1.0a24-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.0a24-py3-none-any.whl
Algorithm Hash digest
SHA256 d0b6e18b042fc4c49886c7ce886bcead3014edd41c8e986f85db1c14bf9a6541
MD5 cb70a4c747798408936891b65f800943
BLAKE2b-256 30493bbc73c17e6c25a11cd2ce77858bbd74962f39d05f13a2d02883aab33351

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