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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file polywrap_fs_plugin-0.1.2.tar.gz
.
File metadata
- Download URL: polywrap_fs_plugin-0.1.2.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1daeaf2bfff2df70d4dd79d6188677f404c4285a63d9f4049c82f211e0ef2929 |
|
MD5 | 4bea440fa08360b3487056cc91089234 |
|
BLAKE2b-256 | 19a6c375718cf0830dd008cab7c326b2fa9a36396f631b91df1f9dcd33b41483 |
File details
Details for the file polywrap_fs_plugin-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: polywrap_fs_plugin-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.13 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b706c0ba4c5d3acdaf687cccdb2b8927912a1f57dbac3fc6b5694566bc9a5cba |
|
MD5 | 322cc5ea6ff4a7190d6a6d1f1fcee08f |
|
BLAKE2b-256 | 72e686dbec017a555926935cb98faed8422b6345bfe1576e03fa077764cc6933 |