Metadata-Version: 2.1
Name: polywrap-sys-config-bundle
Version: 0.1.2
Summary: Polywrap System Client Config Bundle
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: polywrap-client-config-builder (==0.1.2)
Requires-Dist: polywrap-core (==0.1.2)
Requires-Dist: polywrap-fs-plugin (==0.1.2)
Requires-Dist: polywrap-http-plugin (==0.1.2)
Requires-Dist: polywrap-manifest (==0.1.2)
Requires-Dist: polywrap-uri-resolvers (==0.1.2)
Requires-Dist: polywrap-wasm (==0.1.2)
Description-Content-Type: text/x-rst

Polywrap Sys Config Bundle
==========================
This package contains the system configuration bundle for Polywrap Client.

Bundled Wraps
-------------

.. csv-table::
    :header: "wrap", "description"

    "http", "To make HTTP requests"
    "http_resolver", "To resolve URIs from HTTP server"
    "wrapscan_resolver", "To resolve URIs from wrapscan.io"
    "ipfs_http_client", "To add or retrieve items from IPFS"
    "ipfs_resolver", "To fetch wraps from IPFS"
    "github_resolver", "To fetch wraps from github repo"
    "file_system", "To perform file system operations"
    "file_system_resolver", "To fetch wraps from File System"

Quickstart
----------

Imports
~~~~~~~

>>> from polywrap_client_config_builder import PolywrapClientConfigBuilder
>>> from polywrap_sys_config_bundle import sys_bundle
>>> from polywrap_client import PolywrapClient
>>> from polywrap_core import Uri, UriPackage

Configure
~~~~~~~~~

>>> config = PolywrapClientConfigBuilder().add_bundle(sys_bundle).build()
>>> client = PolywrapClient(config)

Invoke bundled http plugin
~~~~~~~~~~~~~~~~~~~~~~~~~~

>>> response = client.invoke(
...     uri=Uri.from_str("wrapscan.io/polywrap/http@1.0"),
...     method="get",
...     args={"url": "https://www.google.com"},
... )
>>> response.get("status")
200

Resolve URI with bundled wrapscan resolver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>>> response = client.try_resolve_uri(
...     Uri("wrapscan.io", "polywrap/uri-resolver@1.0"),
... )
>>> assert isinstance(response, UriPackage)

