Python 3 async client for interacting with the IPFS HTTP API
Project description
Async IPFS API Client
Documentation can be found at aioipfs-api.readthedocs.org.
Installation
pip install aioipfs-api
Usage
This assumes you have a working familiarity with asyncio.
import asyncio
from aioipfs_api.client import Client
async def main():
async with Client() as client:
# print the readme
async with client.cat("QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme") as f:
print(await f.text())
# add a directory
print(await client.add('/some/dir/path'))
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Logging
This library uses the standard Python logging library. To see debut output printed to STDOUT, for instance, use:
import logging
log = logging.getLogger('aioipfs_api')
log.setLevel(logging.DEBUG)
log.addHandler(logging.StreamHandler())
Running Tests
To run tests:
pip install -r dev-requirements.txt
python -m unittest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioipfs-api-0.1.3.tar.gz
(13.7 kB
view hashes)
Built Distribution
Close
Hashes for aioipfs_api-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0750e2e2d039519438108683c4ed41e188b8a3d3a3bcb435d1458a0bcf548ffa |
|
MD5 | 7c9bb4561b498f317d1308e61ee34a7c |
|
BLAKE2b-256 | d0f741dcb7860a97310efa091cdce4886fb1d0b29e907865bc357d6c816bba32 |