{ "info": { "author": "py-ipfs-http-client team", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Scientific/Engineering", "Topic :: System :: Filesystems", "Topic :: System :: Networking" ], "description": "# py-ipfs-http-client\n\n[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.io/)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n[![](https://img.shields.io/pypi/v/ipfshttpclient.svg?style=flat-square)](https://pypi.python.org/pypi/ipfshttpclient)\n[![Build Status](https://travis-ci.org/ipfs/py-ipfs-http-client.svg?branch=master)](https://travis-ci.org/ipfs/py-ipfs-http-client)\n\n![Python IPFS HTTP Client Library](https://ipfs.io/ipfs/QmQJ68PFMDdAsgCZvA1UVzzn18asVcf7HVvCDgpjiSCAse)\n\nCheck out [the HTTP Client reference](https://ipfs.io/ipns/12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF/docs/) for the full command reference.\n\n**Important:** The `ipfsapi` PIP package and Python module have both been renamed to `ipfshttpclient`!\nSee the [relevant section of the README](#important-changes-from-ipfsapi-04x) for details.\n\n**Note:** This library constantly has to change to stay compatible with the IPFS HTTP API.\nCurrently, this library is tested against [go-ipfs v0.4.19](https://github.com/ipfs/go-ipfs/releases/tag/v0.4.19).\nYou may experience compatibility issues when attempting to use it with other versions of go-ipfs.\n\nThe following versions have been expliciently backlisted for know compatiblity problems:\n\n * 0.4.20\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Documentation](#documentation)\n - [Important changes from ipfsapi 0.4.x](#important-changes-from-ipfsapi-04x)\n- [Featured Projects](#featured-projects)\n- [Contribute](#contribute)\n - [IRC](#irc)\n - [Bug reports](#bug-reports)\n - [Pull requests](#pull-requests)\n- [License](#license)\n\n## Install\n\nInstall with pip:\n\n```sh\npip install ipfshttpclient\n```\n\n## Usage\n\nBasic use-case (requires a running instance of IPFS daemon):\n\n```py\n>>> import ipfshttpclient\n>>> client = ipfshttpclient.connect('127.0.0.1', 5001)\n>>> res = client.add('test.txt')\n>>> res\n{'Hash': 'QmWxS5aNTFEc9XbMX1ASvLET1zrqEaTssqt33rVZQCQb22', 'Name': 'test.txt'}\n>>> client.cat(res['Hash'])\n'fdsafkljdskafjaksdjf\\n'\n```\n\nFor real-world scripts you can reuse TCP connections using a context manager or manually closing the session after use:\n\n```py\nimport ipfshttpclient\n\n# Share TCP connections using a context manager\nwith ipfshttpclient.connect() as client:\n\thash = client.add('test.txt')['Hash']\n\tprint(client.stat(hash))\n\n# Share TCP connections until the client session is closed\nclass SomeObject:\n\tdef __init__(self):\n\t\tself._client = ipfshttpclient.connect(session=True)\n\n\tdef do_something(self):\n\t\thash = self._client.add('test.txt')['Hash']\n\t\tprint(self._client.stat(hash))\n\n\tdef close(self): # Call this when your done\n\t\tself._client.close()\n```\n\nAdministrative functions:\n\n```py\n>>> client.id()\n{'Addresses': ['/ip4/127.0.0.1/tcp/4001/ipfs/QmS2C4MjZsv2iP1UDMMLCYqJ4WeJw8n3vXx1VKxW1UbqHS',\n '/ip6/::1/tcp/4001/ipfs/QmS2C4MjZsv2iP1UDMMLCYqJ4WeJw8n3vXx1VKxW1UbqHS'],\n 'AgentVersion': 'go-ipfs/0.4.10',\n 'ID': 'QmS2C4MjZsv2iP1UDMMLCYqJ4WeJw8n3vXx1VKxW1UbqHS',\n 'ProtocolVersion': 'ipfs/0.1.0',\n 'PublicKey': 'CAASpgIwgg ... 3FcjAgMBAAE='}\n```\n\nPass in API options:\n\n```py\n>>> client.pin_ls(type='all')\n{'Keys': {'QmNMELyizsfFdNZW3yKTi1SE2pErifwDTXx6vvQBfwcJbU': {'Count': 1,\n 'Type': 'indirect'},\n 'QmNQ1h6o1xJARvYzwmySPsuv9L5XfzS4WTvJSTAWwYRSd8': {'Count': 1,\n 'Type': 'indirect'},\n \u2026\n```\n\nAdd a directory and match against a filename pattern:\n\n```py\n>>> client.add('photos', pattern='*.jpg')\n[{'Hash': 'QmcqBstfu5AWpXUqbucwimmWdJbu89qqYmE3WXVktvaXhX',\n 'Name': 'photos/photo1.jpg'},\n {'Hash': 'QmSbmgg7kYwkSNzGLvWELnw1KthvTAMszN5TNg3XQ799Fu',\n 'Name': 'photos/photo2.jpg'},\n {'Hash': 'Qma6K85PJ8dN3qWjxgsDNaMjWjTNy8ygUWXH2kfoq9bVxH',\n 'Name': 'photos/photo3.jpg'}]\n```\n\nOr add a directory recursively:\n\n```py\n>>> client.add('fake_dir', recursive=True)\n[{'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX',\n 'Name': 'fake_dir/fsdfgh'},\n {'Hash': 'QmNuvmuFeeWWpxjCQwLkHshr8iqhGLWXFzSGzafBeawTTZ',\n 'Name': 'fake_dir/test2/llllg'},\n {'Hash': 'QmX1dd5DtkgoiYRKaPQPTCtXArUu4jEZ62rJBUcd5WhxAZ',\n 'Name': 'fake_dir/test2'},\n {'Hash': 'Qmenzb5J4fR9c69BbpbBhPTSp2Snjthu2hKPWGPPJUHb9M',\n 'Name': 'fake_dir'}]\n```\n\nThis module also contains some helper functions for adding strings and JSON to IPFS:\n\n```py\n>>> lst = [1, 77, 'lol']\n>>> client.add_json(lst)\n'QmQ4R5cCUYBWiJpNL7mFe4LDrwD6qBr5Re17BoRAY9VNpd'\n>>> client.get_json(_)\n[1, 77, 'lol']\n```\n\n## Documentation\n\nDocumentation (currently mostly API documentation unfortunately) is available on IPFS:\n\nhttps://ipfs.io/ipns/12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF/docs/\n\nThe `ipfs` [command-line Client documentation](https://ipfs.io/docs/commands/) may also be useful in some cases.\n\n### Important changes from `ipfsapi 0.4.x`\n\n * Tons of methods has been renamed, ensure that you code runs without warnings with the last version of `ipfsapi` before attempting to upgrade!\n * The Python package has been renamed from `ipfsapi` to `ipfshttpclient`\n * The PIP module has been renamed from `ipfsapi` to `ipfshttpclient` (please update your requirement files)\n * The `client.*_pyobj` family of functions has been dropped due to security concerns\n * The `client.bitswap.unwant` method has been dropped \u2013 it's endpoint has been removed by *go-ipfs*\n * The `client.files.file_ls` method has been dropped \u2013 deprecated for a long time, use `client.ls` instead\n * Passing a list of parameters to `client.add` will now fail, just pass several individual parameters instead\n * Some functions that may also return multiple items, will now also return a list when returning only a single item (don't worry about it unless it actually breaks for you)\n * The API deamon location is now described using MultiAddr, hence rather then doing `ipfshttpclient.connect(host, port)` to pass the network address parameters, use:\n * `ipfshttpclient.connect(\"/dns//tcp//http\")` (for hostnames such as `localhost`)\n * `ipfshttpclient.connect(\"/ip4//tcp//http\")` (for IPv4 addresses)\n * `ipfshttpclient.connect(\"/ip6//tcp//http\")` (for IPv6 addresses)\n * Use `\u2026/https` rather then `\u2026/http` to connect to the API deamon using HTTPS\n * The client now supports [keeping session contexts around between API calls](#usage), you probably should make use of this facility in your code\n\nThank you @AlibabasMerchant, @lordcirth and @radfish (in order of subjective contributions) for helping making this happen!\n\n## Featured Projects\n\nProjects that currently use py-ipfs-http-client. If your project isn't here, feel free to submit a PR to add it!\n\n- [git-remote-ipfs](https://github.com/larsks/git-remote-ipfs) allows users to push and pull git repositories from the IPFS network.\n- [InterPlanetary Wayback](https://github.com/oduwsdl/ipwb) interfaces web archive ([WARC](https://www.iso.org/standard/44717.html)) files for distributed indexing and replay using IPFS.\n\n## Contribute\n\n### IRC\n\nJoin us on IRC at `#ipfs` on [chat.freenode.net](https://webchat.freenode.net) if you have any suggestions or questions,\nor if you just want to discuss IPFS and python.\n\n### Bug reports\n\nYou can submit bug reports using the [GitHub issue tracker](https://github.com/ipfs/py-ipfs-http-client/issues).\n\n### Pull requests\n\nPull requests are welcome. Before submitting a new pull request, please\nmake sure that your code passes both the [code formatting](https://www.python.org/dev/peps/pep-0008/) check:\n\n $ tox -e codestyle\n\nAnd the unit tests:\n\n $ tox\n\nYou can arrange to run the code style tests automatically before each commit by\ninstalling a `pre-commit` hook:\n\n $ ./tools/pre-commit --install\n\nPlease make sure to include new unit tests for new features or changes in\nbehavior. We aim to bring coverage to 100% at some point.\n\n## License\n\nThis code is distributed under the terms of the [MIT license](https://opensource.org/licenses/MIT). Details can be found in the file\n[LICENSE](LICENSE) in this repository.\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://ipfs.io/ipns/12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF/", "keywords": "ipfs storage distribution development", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "ipfshttpclient", "package_url": "https://pypi.org/project/ipfshttpclient/", "platform": "", "project_url": "https://pypi.org/project/ipfshttpclient/", "project_urls": { "Documentation": "https://ipfs.io/ipns/12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF/docs/", "Homepage": "https://ipfs.io/ipns/12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF/" }, "release_url": "https://pypi.org/project/ipfshttpclient/0.4.12/", "requires_dist": [ "multiaddr (>=0.0.7)", "requests (>=2.11)", "six" ], "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "summary": "Python IPFS HTTP CLIENT library", "version": "0.4.12" }, "last_serial": 5298163, "releases": { "0.4.10": [ { "comment_text": "", "digests": { "md5": "fecf3eb4624ae4b7c9486a5702d677db", "sha256": "db728ed0902319e4dab089d3d289287b2dc0c986d422e68793c4a06f2224754b" }, "downloads": -1, "filename": "ipfshttpclient-0.4.10-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fecf3eb4624ae4b7c9486a5702d677db", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 153721, "upload_time": "2019-05-12T22:02:17", "url": "https://files.pythonhosted.org/packages/dc/b0/bdb55b829d763d5f2347a7add850042001692aaf1445634ec8c993219a72/ipfshttpclient-0.4.10-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "92d9619ade9b1f722646d94f4048d620", "sha256": "db5f7a1e8fb9800de85d197305461f6082cfb9d941d6c7ecb96071b2c6cba570" }, "downloads": -1, "filename": "ipfshttpclient-0.4.10.tar.gz", "has_sig": false, "md5_digest": "92d9619ade9b1f722646d94f4048d620", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 78728, "upload_time": "2019-05-12T22:02:20", "url": "https://files.pythonhosted.org/packages/2b/67/25a7b3d96a03272850ed449c414138a79c3002cb49b2dc2a2afa684a20ef/ipfshttpclient-0.4.10.tar.gz" } ], "0.4.11": [ { "comment_text": "", "digests": { "md5": "c9698cc22a92c31818d6f74578a486a3", "sha256": "ec400ce5fceebbfb429167180433d570e2c41aa8c9f4bb1b079402257b9fb6a7" }, "downloads": -1, "filename": "ipfshttpclient-0.4.11-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c9698cc22a92c31818d6f74578a486a3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 157505, "upload_time": "2019-05-13T13:47:39", "url": "https://files.pythonhosted.org/packages/5d/dd/81559f04074a0cde310610472621129cedfc1f960f21360c5421a3bac4b6/ipfshttpclient-0.4.11-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32e2ef210ad502915a31307c77a756a6", "sha256": "55189b8785c0c090bb5c579080b1e63c5ffd622a1c93a573d04aa8c066ebb561" }, "downloads": -1, "filename": "ipfshttpclient-0.4.11.tar.gz", "has_sig": false, "md5_digest": "32e2ef210ad502915a31307c77a756a6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 80891, "upload_time": "2019-05-13T13:47:48", "url": "https://files.pythonhosted.org/packages/e3/9f/671265138d984265ae68ac14b3b8091a55a8c6dc150900efc0a86f077b95/ipfshttpclient-0.4.11.tar.gz" } ], "0.4.12": [ { "comment_text": "", "digests": { "md5": "c1d3e99cd64eb2c9e412db32c9d2cc24", "sha256": "bee95c500edf669bb8a984d5588fc133fda9ec67845c5688bcbbea030a03f10f" }, "downloads": -1, "filename": "ipfshttpclient-0.4.12-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c1d3e99cd64eb2c9e412db32c9d2cc24", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 157892, "upload_time": "2019-05-21T14:31:20", "url": "https://files.pythonhosted.org/packages/17/30/0c54ed165f880a7f99eb75d63588ebd09f3da21faa6effd9e42dca987cd8/ipfshttpclient-0.4.12-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c2624546b7f88a1fdcbfdbc6b0d8e47", "sha256": "0a199a1005fe44bff9da28b5af4785b0b09ca700baac9d1e26718fe23fe89bb7" }, "downloads": -1, "filename": "ipfshttpclient-0.4.12.tar.gz", "has_sig": false, "md5_digest": "4c2624546b7f88a1fdcbfdbc6b0d8e47", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 80946, "upload_time": "2019-05-21T14:31:22", "url": "https://files.pythonhosted.org/packages/bd/76/ec048dfcdf182d04cb1e7a1a1d23018fccc4c8eb6cca5a43c4edbc39262d/ipfshttpclient-0.4.12.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c1d3e99cd64eb2c9e412db32c9d2cc24", "sha256": "bee95c500edf669bb8a984d5588fc133fda9ec67845c5688bcbbea030a03f10f" }, "downloads": -1, "filename": "ipfshttpclient-0.4.12-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c1d3e99cd64eb2c9e412db32c9d2cc24", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 157892, "upload_time": "2019-05-21T14:31:20", "url": "https://files.pythonhosted.org/packages/17/30/0c54ed165f880a7f99eb75d63588ebd09f3da21faa6effd9e42dca987cd8/ipfshttpclient-0.4.12-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c2624546b7f88a1fdcbfdbc6b0d8e47", "sha256": "0a199a1005fe44bff9da28b5af4785b0b09ca700baac9d1e26718fe23fe89bb7" }, "downloads": -1, "filename": "ipfshttpclient-0.4.12.tar.gz", "has_sig": false, "md5_digest": "4c2624546b7f88a1fdcbfdbc6b0d8e47", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 80946, "upload_time": "2019-05-21T14:31:22", "url": "https://files.pythonhosted.org/packages/bd/76/ec048dfcdf182d04cb1e7a1a1d23018fccc4c8eb6cca5a43c4edbc39262d/ipfshttpclient-0.4.12.tar.gz" } ] }