Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/polywrap/python-client

Python polywrap client
https://github.com/polywrap/python-client

Last synced: about 2 months ago
JSON representation

Python polywrap client

Awesome Lists containing this project

README

        

![Public Release Announcement](https://user-images.githubusercontent.com/5522128/177473887-2689cf25-7937-4620-8ca5-17620729a65d.png)

# Polywrap Python Client

[Polywrap](https://polywrap.io) is a protocol for building and executing composable wrappers for any web3 protocol. Polywrap Python Client is a Python library that allows you to easily execute Polywrap Wrappers.

## Quickstart

### Install the package

```bash
pip install polywrap
```

### Import necessary packages

```python
from polywrap import (
Uri,
ClientConfig,
PolywrapClient,
PolywrapClientConfigBuilder,
sys_bundle,
web3_bundle
)
```

### Configure and Instantiate the client
```python
builder = (
PolywrapClientConfigBuilder()
.add_bundle(sys_bundle)
.add_bundle(web3_bundle)
)
config = builder.build()
client = PolywrapClient(config)
```

### Invoke a wrapper

```python
uri = Uri.from_str(
'wrapscan.io/polywrap/ipfs-http-client'
)
args = {
"cid": "QmZ4d7KWCtH3xfWFwcdRXEkjZJdYNwonrCwUckGF1gRAH9",
"ipfsProvider": "https://ipfs.io",
}
result = client.invoke(uri=uri, method="cat", args=args, encode_result=False)
assert result.startswith(b"