- info:
Asynchronous IPFS client library
aioipfs is a python3 library providing an asynchronous API for IPFS. Supported python versions: 3.6, 3.7, 3.8, 3.9
NOTE: This is a separate fork of the Original created by @pinnaculum (formerly cipres). This fork is maintained by Privex Inc. (primarily by @someguy123) - a Belizean server hosting + technology company.
Installation
pip3 install privex-aioipfs
# Or if you use pipenv
pipenv install privex-aioipfs
Usage examples
Get an IPFS resource
import sys
import asyncio
import aioipfs
async def get(ipfshash):
client = aioipfs.AsyncIPFS()
await client.get(ipfshash, dstdir='.')
await client.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(get(sys.argv[1]))
loop.close()
Add some files
This example will import all files and directories specified on the command line. Note that the add API function is an asynchronous generator and therefore needs to be used with the async for syntax.
import sys
import asyncio
import aioipfs
async def add_files(files):
client = aioipfs.AsyncIPFS()
async for added_file in client.add(*files, recursive=True):
print('Imported file {0}, CID: {1}'.format(
added_file['Name'], added_file['Hash']))
await client.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(add_files(sys.argv[1:]))
loop.close()
Pubsub service
async def pubsub_serve(topic):
async with aioipfs.AsyncIPFS() as cli:
async for message in cli.pubsub.sub(topic):
print('Received message from', message['from'])
await cli.pubsub.pub(topic, message['data'])
Features
Async file writing on get operations
The aiofiles library is used to asynchronously write data retrieved from the IPFS daemon when using the /api/v0/get API call, to avoid blocking the event loop. TAR extraction is done in asyncio’s threadpool.
Requirements
License
aioipfs is offered under the GNU Lesser GPL3 (LGPL3) license.
Metadata
Release files for privex-aioipfs 0.5.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| privex_aioipfs-0.5.8.tar.gz | 26.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| privex_aioipfs-0.5.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.1 kB
Release files / privex_aioipfs-0.5.8.tar.gz
| Download URL | privex_aioipfs-0.5.8.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e04d4710bb8bb8043935f4d8bcf0394ec5a93ca069586334bc2fe820f852225
|
|
BLAKE2b-256 checksum How to use checksums |
cb1367061f549146800bdd9c5d2d7554edb63bfb146113c6dac02dc72fcccd88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.3
|
Release files / privex_aioipfs-0.5.8-py3-none-any.whl
| Download URL | privex_aioipfs-0.5.8-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bdf443b69238a2cca1d11a23b65e6b91c34b395480791382ac421d7f1a707d16
|
|
BLAKE2b-256 checksum How to use checksums |
8697288d2519d73193699cd3c6e871853d280d1708515c27daf4d580c22bce95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.3
|
Security for privex-aioipfs 0.5.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.