Skip to main content

File-system plugin for Polywrap Python Client

Project description

The Filesystem plugin enables wraps running within the Polywrap client to interact with the local filesystem.

Interface

The FileSystem plugin implements an existing wrap interface at wrapscan.io/polywrap/file-system@1.0.

Quickstart

Imports

>>> import os
>>> from polywrap_core import Uri
>>> from polywrap_client import PolywrapClient
>>> from polywrap_client_config_builder import PolywrapClientConfigBuilder
>>> from polywrap_fs_plugin import file_system_plugin

Create a Polywrap client

>>> fs_interface_uri = Uri.from_str("wrapscan.io/polywrap/file-system@1.0")
>>> fs_plugin_uri = Uri.from_str("plugin/file-system")
>>> config = (
...     PolywrapClientConfigBuilder()
...     .set_package(fs_plugin_uri, file_system_plugin())
...     .add_interface_implementations(fs_interface_uri, [fs_plugin_uri])
...     .set_redirect(fs_interface_uri, fs_plugin_uri)
...     .build()
... )
>>> client = PolywrapClient(config)

Invoke the plugin

>>> path = os.path.join(os.path.dirname(__file__), "..", "pyproject.toml")
>>> result = client.invoke(
...     uri=Uri.from_str("wrapscan.io/polywrap/file-system@1.0"),
...     method="readFile",
...     args={
...         "path": path,
...     }
... )
>>> assert result.startswith(b"[build-system]")

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_fs_plugin-0.1.0b8.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

polywrap_fs_plugin-0.1.0b8-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file polywrap_fs_plugin-0.1.0b8.tar.gz.

File metadata

  • Download URL: polywrap_fs_plugin-0.1.0b8.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-1041-azure

File hashes

Hashes for polywrap_fs_plugin-0.1.0b8.tar.gz
Algorithm Hash digest
SHA256 d952fe8a506f653545d41cd4ab7b4cc7ea332c426f9c64c154dfaf0db0b4d947
MD5 0a72bf8fbfae6e6f24e8199b310e2976
BLAKE2b-256 cb1af405a83e93c5a6bf3f5c205e70d0384318454bd2b5dadd2f6a299a0e8995

See more details on using hashes here.

Provenance

File details

Details for the file polywrap_fs_plugin-0.1.0b8-py3-none-any.whl.

File metadata

File hashes

Hashes for polywrap_fs_plugin-0.1.0b8-py3-none-any.whl
Algorithm Hash digest
SHA256 e11ff887bdf51ec523ac79d9475b1f4674db5acb6a925ded2ad216f6faca17cd
MD5 7740a2487dd9e64dc5937a1182bcb1d5
BLAKE2b-256 55c8b5084f2ecaf0b33c8a45dd2b8293b5f0cb1788fa0b69981b470dba257ca6

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