Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/polywrap/python-client
- Owner: polywrap
- Created: 2022-10-15T09:34:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T04:16:40.000Z (10 months ago)
- Last Synced: 2024-08-02T15:04:04.739Z (5 months ago)
- Language: Python
- Homepage: https://polywrap-client.rtfd.io
- Size: 3.2 MB
- Stars: 4
- Watchers: 3
- Forks: 6
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.rst
Awesome Lists containing this project
- awesome-polywrap - Python
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"