CID (Content IDentifier)
------------------------
.. image:: https://img.shields.io/pypi/v/py-cid.svg
:target: https://pypi.python.org/pypi/py-cid
.. image:: https://codecov.io/gh/ipld/py-cid/branch/master/graph/badge.svg
:target: https://codecov.io/gh/ipld/py-cid
.. image:: https://readthedocs.org/projects/py-cid/badge/?version=stable
:target: https://py-cid.readthedocs.io/en/stable/?badge=stable
:alt: Documentation Status
What is CID ?
=============
`CID <https://github.com/ipld/cid>`_ is a format for referencing content in distributed information systems,
like `IPFS <https://ipfs.io>`_.
It leverages `content addressing <https://en.wikipedia.org/wiki/Content-addressable_storage>`_,
`cryptographic hashing <https://simple.wikipedia.org/wiki/Cryptographic_hash_function>`_, and
`self-describing formats <https://github.com/multiformats/multiformats>`_.
It is the core identifier used by `IPFS <https://ipfs.io>`_ and `IPLD <https://ipld.io>`_.
CID is a self-describing content-addressed identifier.
It uses cryptographic hashes to achieve content addressing.
It uses several `multiformats <https://github.com/multiformats/multiformats>`_ to achieve flexible self-description,
namely `multihash <https://github.com/multiformats/multihash>`_ for hashes,
`multicodec <https://github.com/multiformats/multicodec>`_ for data content
types, and `multibase <https://github.com/multiformats/multibase>`_ to encode the CID itself into strings.
Sample Usage
============
.. code-block:: python
>>> from cid import make_cid
>>> make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')
CIDv0(version=0, codec=dag-pb, multihash=b"\x12 \xb9M'\xb9\x93M>\x08\xa5.R\xd7\xda}\xab\xfa\xc4\x84..")
>>> cid = make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')
>>> print(cid.version, cid.codec, cid.multihash)
>>> print(cid.encode())
QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4
>>> str(cid)
'QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4'
Other info
==========
* Free software: MIT license
* Documentation: https://py-cid.readthedocs.io.
* Python versions: 3.10+
Raw data
{
"_id": null,
"home_page": null,
"name": "py-cid",
"maintainer": "acul71",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Dhruv Baldawa <dhruv@dhruvb.com>, pacrob <pacrob-py-libp2p@protonmail.com>",
"keywords": "cid, ipfs, ipld, content-addressed, multihash, multibase, multicodec",
"author": null,
"author_email": "Dhruv Baldawa <dhruv@dhruvb.com>",
"download_url": "https://files.pythonhosted.org/packages/6a/e6/4bbed71bde67a3570be9f57a07ae7dd96cd90dbc6fa345c326867ade7231/py_cid-0.3.1.tar.gz",
"platform": null,
"description": "CID (Content IDentifier)\n------------------------\n\n\n.. image:: https://img.shields.io/pypi/v/py-cid.svg\n :target: https://pypi.python.org/pypi/py-cid\n\n.. image:: https://codecov.io/gh/ipld/py-cid/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/ipld/py-cid\n\n.. image:: https://readthedocs.org/projects/py-cid/badge/?version=stable\n :target: https://py-cid.readthedocs.io/en/stable/?badge=stable\n :alt: Documentation Status\n\n\nWhat is CID ?\n=============\n\n`CID <https://github.com/ipld/cid>`_ is a format for referencing content in distributed information systems,\nlike `IPFS <https://ipfs.io>`_.\nIt leverages `content addressing <https://en.wikipedia.org/wiki/Content-addressable_storage>`_,\n`cryptographic hashing <https://simple.wikipedia.org/wiki/Cryptographic_hash_function>`_, and\n`self-describing formats <https://github.com/multiformats/multiformats>`_.\n\nIt is the core identifier used by `IPFS <https://ipfs.io>`_ and `IPLD <https://ipld.io>`_.\n\nCID is a self-describing content-addressed identifier.\n\nIt uses cryptographic hashes to achieve content addressing.\n\nIt uses several `multiformats <https://github.com/multiformats/multiformats>`_ to achieve flexible self-description,\nnamely `multihash <https://github.com/multiformats/multihash>`_ for hashes,\n`multicodec <https://github.com/multiformats/multicodec>`_ for data content\ntypes, and `multibase <https://github.com/multiformats/multibase>`_ to encode the CID itself into strings.\n\nSample Usage\n============\n\n.. code-block:: python\n\n >>> from cid import make_cid\n >>> make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')\n CIDv0(version=0, codec=dag-pb, multihash=b\"\\x12 \\xb9M'\\xb9\\x93M>\\x08\\xa5.R\\xd7\\xda}\\xab\\xfa\\xc4\\x84..\")\n\n >>> cid = make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')\n >>> print(cid.version, cid.codec, cid.multihash)\n\n >>> print(cid.encode())\n QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4\n\n >>> str(cid)\n 'QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4'\n\n\n\n\nOther info\n==========\n\n* Free software: MIT license\n* Documentation: https://py-cid.readthedocs.io.\n* Python versions: 3.10+\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Self-describing content-addressed identifiers for distributed systems",
"version": "0.3.1",
"project_urls": {
"Bug Tracker": "https://github.com/ipld/py-cid/issues",
"Documentation": "https://py-cid.readthedocs.io",
"Homepage": "https://github.com/ipld/py-cid",
"Repository": "https://github.com/ipld/py-cid"
},
"split_keywords": [
"cid",
" ipfs",
" ipld",
" content-addressed",
" multihash",
" multibase",
" multicodec"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "78e0f6604972c39e3554cba0ad72c48cf5aab70663bba792383f3547bb0af4f1",
"md5": "0bd1ff5b688182291284df8a91f6d8c3",
"sha256": "bd60f54372704b7f2c0565432bf052e9ba7d42f260d39e9f7dc9566802a445a6"
},
"downloads": -1,
"filename": "py_cid-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0bd1ff5b688182291284df8a91f6d8c3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 6538,
"upload_time": "2025-09-12T21:13:02",
"upload_time_iso_8601": "2025-09-12T21:13:02.311145Z",
"url": "https://files.pythonhosted.org/packages/78/e0/f6604972c39e3554cba0ad72c48cf5aab70663bba792383f3547bb0af4f1/py_cid-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6ae64bbed71bde67a3570be9f57a07ae7dd96cd90dbc6fa345c326867ade7231",
"md5": "f45d14bf407fba682d3df15a5069a5a4",
"sha256": "eb0d14f35430787b978ffb66067d70ffaa9d85ecf62c950e792293193e705a75"
},
"downloads": -1,
"filename": "py_cid-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "f45d14bf407fba682d3df15a5069a5a4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 24009,
"upload_time": "2025-09-12T21:13:04",
"upload_time_iso_8601": "2025-09-12T21:13:04.389818Z",
"url": "https://files.pythonhosted.org/packages/6a/e6/4bbed71bde67a3570be9f57a07ae7dd96cd90dbc6fa345c326867ade7231/py_cid-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-12 21:13:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ipld",
"github_project": "py-cid",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "py-cid"
}