Skip to main content

Self-describing content-addressed identifiers for distributed systems

Project description

CID (Content IDentifier)

.. image::

.. image::

.. image::

.. image::
:alt: Documentation Status

.. image::
:alt: Updates

What is CID ?

`CID <>`_ is a format for referencing content in distributed information systems,
like `IPFS <>`_.
It leverages `content addressing <>`_,
`cryptographic hashing <>`_, and
`self-describing formats <>`_.

It is the core identifier used by `IPFS <>`_ and `IPLD <>`_.

CID is a self-describing content-addressed identifier.

It uses cryptographic hashes to achieve content addressing.

It uses several `multiformats <>`_ to achieve flexible self-description,
namely `multihash <>`_ for hashes,
`multicodec-packed <>`_ for data content
types, and `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())

>>> str(cid)


Stable release

To install CID, run this command in your terminal:

.. code-block:: console

$ pip install py-cid

This is the preferred method to install CID, as it will always install the most recent stable release.

If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.

.. _pip:
.. _Python installation guide:

From sources

The sources for CID can be downloaded from the `Github repo`_.

You can either clone the public repository:

.. code-block:: console

$ git clone git://

Or download the `tarball`_:

.. code-block:: console

$ curl -OL

Once you have a copy of the source, you can install it with:

.. code-block:: console

$ python install

.. _Github repo:
.. _tarball:

Supported Python versions

**Python 3.4, 3.5, 3.6**

Other info

* Free software: MIT license
* Documentation:




0.1.0 (2017-09-05)

* First release on PyPI.

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

py-cid-0.1.1.tar.gz (21.8 kB view hashes)

Uploaded Source

Built Distribution

py_cid-0.1.1-py2.py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page