Skip to main content

CID (Content IDentifier)

https://img.shields.io/pypi/v/py-cid.svg https://img.shields.io/travis/ipld/py-cid.svg?branch=master https://codecov.io/gh/ipld/py-cid/branch/master/graph/badge.svg Documentation Status

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 for data content types, and multibase to encode the CID itself into strings.

Sample Usage

>>> 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:

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

From sources

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

You can either clone the public repository:

$ git clone git://github.com/ipld/py-cid

Or download the tarball:

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

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

$ python setup.py install

Other info

History

0.4.1 (2022-09-08, forked master)

  • made the package deployable increased version number and blackified the files

0.4.0 (forked master)

  • remove crazy version range limits for dependencies which cause major headaches for downstream projects with multiple confluent indirect dependencies on this library

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.

Metadata

Release files for planetmint-py-cid 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for planetmint-py-cid 0.4.2
File Size Uploaded Provenance
planetmint-py-cid-0.4.2.tar.gz 19.6 kB Without provenance Details

Release files / planetmint-py-cid-0.4.2.tar.gz

Download URL planetmint-py-cid-0.4.2.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
336f5eb738a9f4830147a0ca4f24692f245c639118d534ccb8dd71855c434a0b
BLAKE2b-256 checksum
How to use checksums
4b3ee59244c4642dcde68be887da8e47b10a6bc22b6f6d9a95435a4e2552b4d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for planetmint-py-cid 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page