New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

polywrap-plugin

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polywrap-plugin

Polywrap Plugin package

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
2

Polywrap Plugin

This package contains the runtime for the Polywrap plugin system.

Quickstart

Imports


>>> from typing import Any, Dict, List, Union, Optional, cast
>>> from polywrap_manifest import AnyWrapManifest
>>> from polywrap_plugin import PluginModule
>>> from polywrap_core import InvokerClient, Uri

Define a plugin module

class GreetingModule(PluginModule[None]): ... def init(self, config: None): ... super().init(config) ... ... def greeting(self, args: Dict[str, Any], client: InvokerClient, env: Optional[Any] = None): ... return f"Greetings from: {args['name']}"

Create a plugin wrapper


>>> greeting_module = GreetingModule(None)
>>> manifest = cast(AnyWrapManifest, NotImplemented)
>>> wrapper = PluginWrapper(greeting_module, manifest)

Invocation
~~~~~~~~~~

>>> args = {
...     "name": "Joe"
... }
>>> result = wrapper.invoke(
...     uri=Uri.from_str("ens/greeting.eth"),
...     method="greeting",
...     args=args,
...     client=cast(InvokerClient, NotImplemented),
... )
>>> assert result.result == "Greetings from: Joe"

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc