py-cid


Namepy-cid JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/ipld/py-cid
SummarySelf-describing content-addressed identifiers for distributed systems
upload_time2019-08-04 15:44:08
maintainer
docs_urlNone
authorDhruv Baldawa
requires_python
licenseMIT license
keywords cid
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            CID (Content IDentifier)
------------------------


.. image:: https://img.shields.io/pypi/v/py-cid.svg
        :target: https://pypi.python.org/pypi/py-cid

.. image:: https://img.shields.io/travis/ipld/py-cid.svg?branch=master
        :target: https://travis-ci.org/ipld/py-cid?branch=master

.. 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'


Installation
============

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: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/

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://github.com/ipld/py-cid

Or download the `tarball`_:

.. code-block:: console

    $ curl  -OL https://github.com/ipld/py-cid/tarball/master

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

.. code-block:: console

    $ python setup.py install


.. _Github repo: https://github.com/ipld/py-cid
.. _tarball: https://github.com/ipld/py-cid/tarball/master

Other info
==========

* Free software: MIT license
* Documentation: https://py-cid.readthedocs.io.
* Python versions: 3.5, 3.6


History
-------

0.2.1 (2018-10-20)
==================

* Fix edge cases with multibase and multihash decoding
* Added hypothesis tests while verifying CIDs

0.1.5 (2018-10-12)
==================

* Handle the case where an incorrect base58 encoded value is provided to `make_cid`


0.1.0 (2017-09-05)
==================

* First release on PyPI.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ipld/py-cid",
    "name": "py-cid",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "cid",
    "author": "Dhruv Baldawa",
    "author_email": "dhruv@dhruvb.com",
    "download_url": "https://files.pythonhosted.org/packages/b7/65/1d57b5519b4201f39bf4a9cc3e2d554f25446c56df88c0e9abbffe28cdbe/py-cid-0.3.0.tar.gz",
    "platform": "",
    "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://img.shields.io/travis/ipld/py-cid.svg?branch=master\n        :target: https://travis-ci.org/ipld/py-cid?branch=master\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\nInstallation\n============\n\nStable release\n~~~~~~~~~~~~~~\n\nTo install CID, run this command in your terminal:\n\n.. code-block:: console\n\n    $ pip install py-cid\n\nThis is the preferred method to install CID, as it will always install the most recent stable release.\n\nIf you don't have `pip`_ installed, this `Python installation guide`_ can guide\nyou through the process.\n\n.. _pip: https://pip.pypa.io\n.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/\n\nFrom sources\n~~~~~~~~~~~~\n\nThe sources for CID can be downloaded from the `Github repo`_.\n\nYou can either clone the public repository:\n\n.. code-block:: console\n\n    $ git clone git://github.com/ipld/py-cid\n\nOr download the `tarball`_:\n\n.. code-block:: console\n\n    $ curl  -OL https://github.com/ipld/py-cid/tarball/master\n\nOnce you have a copy of the source, you can install it with:\n\n.. code-block:: console\n\n    $ python setup.py install\n\n\n.. _Github repo: https://github.com/ipld/py-cid\n.. _tarball: https://github.com/ipld/py-cid/tarball/master\n\nOther info\n==========\n\n* Free software: MIT license\n* Documentation: https://py-cid.readthedocs.io.\n* Python versions: 3.5, 3.6\n\n\nHistory\n-------\n\n0.2.1 (2018-10-20)\n==================\n\n* Fix edge cases with multibase and multihash decoding\n* Added hypothesis tests while verifying CIDs\n\n0.1.5 (2018-10-12)\n==================\n\n* Handle the case where an incorrect base58 encoded value is provided to `make_cid`\n\n\n0.1.0 (2017-09-05)\n==================\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Self-describing content-addressed identifiers for distributed systems",
    "version": "0.3.0",
    "split_keywords": [
        "cid"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "e50e179cd749fdaf1bb678b7ce6744a0",
                "sha256": "7c48a6ee0bc50fd114d4b24849cd689a31d3ad5bdf8fa073bf68f846fd58c5da"
            },
            "downloads": -1,
            "filename": "py_cid-0.3.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e50e179cd749fdaf1bb678b7ce6744a0",
            "packagetype": "bdist_wheel",
            "python_version": "3.5",
            "requires_python": null,
            "size": 7893,
            "upload_time": "2019-08-04T15:44:19",
            "upload_time_iso_8601": "2019-08-04T15:44:19.286713Z",
            "url": "https://files.pythonhosted.org/packages/11/72/8fd8ac6e79b00d171499a1808d5af99c109d9780ca4982ff69f1baf784e0/py_cid-0.3.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "665c23e5787d6de21cc0427ffe891af4",
                "sha256": "22f432cc6fb68d12a9c35dbdc92c95484fc49e31dfcb9e0efb0082233c5394e3"
            },
            "downloads": -1,
            "filename": "py-cid-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "665c23e5787d6de21cc0427ffe891af4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24147,
            "upload_time": "2019-08-04T15:44:08",
            "upload_time_iso_8601": "2019-08-04T15:44:08.950785Z",
            "url": "https://files.pythonhosted.org/packages/b7/65/1d57b5519b4201f39bf4a9cc3e2d554f25446c56df88c0e9abbffe28cdbe/py-cid-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-08-04 15:44:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ipld",
    "github_project": "py-cid",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "py-cid"
}
        
Elapsed time: 0.01734s