Metadata-Version: 2.1
Name: polywrap-fs-plugin
Version: 0.1.0a2
Summary: 
Author: Niraj
Author-email: niraj@polywrap.io
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: httpx (>=0.23.3,<0.24.0)
Requires-Dist: polywrap-core (>=0.1.0a33,<0.2.0)
Requires-Dist: polywrap-manifest (>=0.1.0a33,<0.2.0)
Requires-Dist: polywrap-msgpack (>=0.1.0a33,<0.2.0)
Requires-Dist: polywrap-plugin (==0.1.0a33)
Description-Content-Type: text/markdown

# polywrap-fs-plugin

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 `wrap://ens/wraps.eth:file-system@1.0.0`.

## Usage

``` python
from polywrap_client import PolywrapClient
from polywrap_client_config_builder import PolywrapClientConfigBuilder
from polywrap_fs_plugin import file_system_plugin

fs_interface_uri = Uri.from_str("wrap://ens/wraps.eth:file-system@1.0.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.invoke(
    uri=Uri.from_str("wrap://ens/wraps.eth:file-system@1.0.0"),
    method="readFile",
    args={
        "path": "./file.txt"
    }
);
```

For more usage examples see `src/__tests__`.

