Python 3 async client for interacting with the IPFS HTTP API
Project description
# Async IPFS API Client
[![Build Status](https://secure.travis-ci.org/bmuller/aioipfs-api.png?branch=master)](https://travis-ci.org/bmuller/aioipfs-api)
[![Docs Status](https://readthedocs.org/projects/kademlia/badge/?version=latest)](https://aioipfs-api.readthedocs.io)
[![Codecov Status](https://codecov.io/gh/bmuller/aioipfs-api/branch/master/graph/badge.svg)](https://codecov.io/gh/bmuller/aioipfs-api/)
**Documentation can be found at [aioipfs-api.readthedocs.org](https://aioipfs-api.readthedocs.io).**
## Installation
```
pip install aioipfs-api
```
## Usage
*This assumes you have a working familiarity with [asyncio](https://docs.python.org/3/library/asyncio.html).*
```python
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](https://docs.python.org/3/library/logging.html). To see debut output printed to STDOUT, for instance, use:
```python
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
```
[![Build Status](https://secure.travis-ci.org/bmuller/aioipfs-api.png?branch=master)](https://travis-ci.org/bmuller/aioipfs-api)
[![Docs Status](https://readthedocs.org/projects/kademlia/badge/?version=latest)](https://aioipfs-api.readthedocs.io)
[![Codecov Status](https://codecov.io/gh/bmuller/aioipfs-api/branch/master/graph/badge.svg)](https://codecov.io/gh/bmuller/aioipfs-api/)
**Documentation can be found at [aioipfs-api.readthedocs.org](https://aioipfs-api.readthedocs.io).**
## Installation
```
pip install aioipfs-api
```
## Usage
*This assumes you have a working familiarity with [asyncio](https://docs.python.org/3/library/asyncio.html).*
```python
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](https://docs.python.org/3/library/logging.html). To see debut output printed to STDOUT, for instance, use:
```python
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.2.tar.gz
(13.6 kB
view hashes)
Built Distribution
Close
Hashes for aioipfs_api-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75b8e0b8dd1844f66c666581de1a4a4e50d98d460c82a3cc877151635592919d |
|
MD5 | 08308c47888ede26da2cdb1d48e445d2 |
|
BLAKE2b-256 | d6de7820718e381e160e3584469404f189a3e7e6876dc0f944f154aac0f588a5 |