{"id":14956265,"url":"https://github.com/PancakesArchitect/aioipfs","last_synced_at":"2025-08-23T22:31:30.538Z","repository":{"id":58724620,"uuid":"221285673","full_name":"pinnaculum/aioipfs","owner":"pinnaculum","description":"Asynchronous IPFS client library (python3) Mirror of: https://gitlab.com/cipres/aioipfs","archived":false,"fork":false,"pushed_at":"2024-04-19T08:54:23.000Z","size":177,"stargazers_count":13,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-17T11:43:33.993Z","etag":null,"topics":["aio-lib","aio-library","aiohttp-client","asyncio","go-ipfs","ipfs","ipfs-api","kubo","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pinnaculum.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"cipres","liberapay":"galacteek"}},"created_at":"2019-11-12T18:33:05.000Z","updated_at":"2024-05-30T11:27:07.000Z","dependencies_parsed_at":"2023-11-18T05:28:44.108Z","dependency_job_id":"dea12324-efa8-487d-9cdf-d11e16157a12","html_url":"https://github.com/pinnaculum/aioipfs","commit_stats":{"total_commits":90,"total_committers":6,"mean_commits":15.0,"dds":0.5666666666666667,"last_synced_commit":"374cea48a4e1602100dce8a3ed3b2c04dc82c9af"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinnaculum%2Faioipfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinnaculum%2Faioipfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinnaculum%2Faioipfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinnaculum%2Faioipfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinnaculum","download_url":"https://codeload.github.com/pinnaculum/aioipfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230744746,"owners_count":18273999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aio-lib","aio-library","aiohttp-client","asyncio","go-ipfs","ipfs","ipfs-api","kubo","python3"],"created_at":"2024-09-24T13:12:37.223Z","updated_at":"2025-08-23T22:31:25.257Z","avatar_url":"https://github.com/pinnaculum.png","language":"Python","funding_links":["https://ko-fi.com/cipres","https://liberapay.com/galacteek"],"categories":[],"sub_categories":[],"readme":"=======\naioipfs\n=======\n\n:info: Asynchronous IPFS_ client library\n\n**aioipfs** is a python3 library providing an asynchronous API for IPFS_.\nSupported python versions: *3.6*, *3.7*, *3.8*, *3.9*, *3.10*, *3.11*, *3.12*.\n\nThis library supports the\n`RPC API specifications \u003chttps://docs.ipfs.tech/reference/kubo/rpc\u003e`_\nfor kubo_ version *0.28.0*. Unit tests are run against\nmost major go-ipfs releases and all kubo_\nreleases, see the *CI* section below.\n\nSee the documentation `here \u003chttps://aioipfs.readthedocs.io/en/latest\u003e`_.\n\n.. image:: https://gitlab.com/cipres/aioipfs/badges/master/coverage.svg\n\nInstallation\n============\n\n.. code-block:: shell\n\n    pip install aioipfs\n\nTo install the requirements for `bohort \u003chttps://aioipfs.readthedocs.io/en/latest/bohort.html\u003e`_, a REPL tool for making RPC calls on kubo nodes:\n\n.. code-block:: shell\n\n    pip install 'aioipfs[bohort]'\n\nSupport for CAR (Content-Addressable Archives) decoding (with the\n`ipfs-car-decoder package \u003chttps://github.com/kralverde/py-ipfs-car-decoder/\u003e`_)\ncan be enabled with the *car* extra:\n\n.. code-block:: shell\n\n    pip install 'aioipfs[car]'\n\nBy default the *json* module from the standard Python library is used\nto decode JSON messages, but orjson_ will be used if it is installed:\n\n.. code-block:: shell\n\n    pip install 'aioipfs[orjson]'\n\nUsage\n=====\n\nClient instantiation\n--------------------\n\nThe recommended way to specify the kubo node's RPC API address is\nto pass a multiaddr_.\n\n.. code-block:: python\n\n    client = aioipfs.AsyncIPFS(maddr='/ip4/127.0.0.1/tcp/5001')\n\n    client = aioipfs.AsyncIPFS(maddr='/dns4/localhost/tcp/5001')\n\nYou can also pass a *multiaddr.Multiaddr* instance.\n\n.. code-block:: python\n\n    from multiaddr import Multiaddr\n\n    client = aioipfs.AsyncIPFS(maddr=Multiaddr('/ip4/127.0.0.1/tcp/5001'))\n\nOtherwise just pass *host* and *port* separately:\n\n.. code-block:: python\n\n    client = aioipfs.AsyncIPFS(host='localhost', port=5001)\n\n    client = aioipfs.AsyncIPFS(host='::1', port=5201)\n\nIf the kubo server requires authentication, you can pass the RPC authentication\ncredentials via the constructor's *auth* keyword argument:\n\n.. code-block:: python\n\n    client = aioipfs.AsyncIPFS(auth=aioipfs.BasicAuth('john', 'password123'))\n\n    client = aioipfs.AsyncIPFS(auth=aioipfs.BearerAuth('my-secret-token'))\n\nGet an IPFS resource\n--------------------\n\n.. code-block:: python\n\n    import sys\n    import asyncio\n\n    import aioipfs\n\n    async def get(cid: str):\n        client = aioipfs.AsyncIPFS()\n\n        await client.get(cid, dstdir='.')\n        await client.close()\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(get(sys.argv[1]))\n\nAdd some files\n--------------\n\nThis example will import all files and directories specified on the command\nline. Note that the **add** API function is an asynchronous generator and\ntherefore should be used with the *async for* syntax.\n\n.. code-block:: python\n\n    import sys\n    import asyncio\n\n    import aioipfs\n\n    async def add_files(files: list):\n        client = aioipfs.AsyncIPFS()\n\n        async for added_file in client.add(*files, recursive=True):\n            print('Imported file {0}, CID: {1}'.format(\n                added_file['Name'], added_file['Hash']))\n\n        await client.close()\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(add_files(sys.argv[1:]))\n\nYou can also use the async list generator syntax:\n\n.. code-block:: python\n\n    cids = [entry['Hash'] async for entry in client.add(dir_path)]\n\nPubsub service\n--------------\n\n.. code-block:: python\n\n    async def pubsub_serve(topic: str):\n        async with aioipfs.AsyncIPFS() as cli:\n            async for message in cli.pubsub.sub(topic):\n                print('Received message from', message['from'])\n\n                await cli.pubsub.pub(topic, message['data'])\n\n\nDialing a P2P service\n---------------------\n\n.. code-block:: python\n\n    async with aioipfs.AsyncIPFS() as client:\n        async with client.p2p.dial_service(peer_id, '/x/echo') as dial:\n            print(f'Dial host: {dial.maddr_host}, port: {dial.maddr_port}')\n\n            # Connect to the service now\n            ....\n\nCI\n==\n\nThe Gitlab CI workflow runs unit tests against the following\ngo-ipfs/kubo releases (`go here \u003chttps://gitlab.com/cipres/aioipfs/-/jobs\u003e`_\nfor the CI jobs overview).\n\n- go-ipfs \u003e=0.11.0,\u003c=0.13.0\n- kubo \u003e=0.14.0,\u003c=0.28.0\n\n.. image:: https://github.com/pinnaculum/aioipfs/workflows/aioipfs-build/badge.svg\n    :target: https://github.com/pinnaculum/aioipfs/actions\n\n.. image:: https://gitlab.com/cipres/aioipfs/badges/master/pipeline.svg\n    :target: https://gitlab.com/cipres/aioipfs/-/jobs\n\nFeatures\n========\n\nAsync file writing on get operations\n------------------------------------\n\nThe **aiofiles** library is used to asynchronously write data retrieved from\nthe IPFS daemon when using the */api/v0/get* API call, to avoid blocking the\nevent loop. TAR extraction is done in asyncio's threadpool.\n\nRequirements\n============\n\n- Python \u003e= 3.6, \u003c= 3.12\n- aiohttp_\n- aiofiles_\n- py-multibase_\n- yarl_\n\n.. _aiohttp: https://pypi.python.org/pypi/aiohttp\n.. _aiofiles: https://pypi.python.org/pypi/aiofiles\n.. _multiaddr: https://multiformats.io/multiaddr/\n.. _py-multibase: https://pypi.python.org/pypi/py-multibase\n.. _yarl: https://pypi.python.org/pypi/yarl\n.. _IPFS: https://ipfs.io\n.. _kubo: https://github.com/ipfs/kubo\n.. _orjson: https://github.com/ijl/orjson\n\nLicense\n=======\n\n**aioipfs** is offered under the GNU Lesser GPL3 (LGPL3) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPancakesArchitect%2Faioipfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPancakesArchitect%2Faioipfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPancakesArchitect%2Faioipfs/lists"}