Documentation can be found at aioipfs-api.readthedocs.org.
pip install aioipfs-api
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())
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())
To run tests:
pip install -r dev-requirements.txt
python -m unittest