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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: polywrap_plugin-0.1.0a29.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.0a29.tar.gz
Algorithm Hash digest
SHA256 7797ff07c08eff395d17db22d7bcbe1431b0b32bcf6a4c3ab09521ac7dcf4f0a
MD5 a283e948c1422769976cca13dd37ccf1
BLAKE2b-256 beb195e268789c7ce115cf7a249fbc1a2273f5947209e07cd9038b181fbb4bee

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: polywrap_plugin-0.1.0a29-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.0a29-py3-none-any.whl
Algorithm Hash digest
SHA256 85896cd27cd89ba1c52447afd6084130af0a74d9c69dc59180608d40b725c841
MD5 7a24ca59c027a71d1f40e98ce51929a5
BLAKE2b-256 02d810056dbdc09f97032025823a781718f24506951ba96f1f425fe236bd6b11

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