skillfed

py-cid

Self-describing content-addressed identifiers for distributed systems

py-cid v0.5.0 164.5K downloads/30d#10,548 on PyPI42
Permissive license MIT Active released

What it is and what it does

py-cid is a Python implementation of the CID specification, a format for self-describing, content-addressed identifiers used in distributed systems like IPFS and IPLD. It wraps cryptographic hashing (via multihash), codec selection (via multicodec), and string encoding (via multibase) into a single identifier that can be created from a hash string, inspected for its version, codec, and multihash components, and re-encoded back to string form.

The package is primarily useful for applications that interact with IPFS or IPLD networks, or that need to work with content-addressed storage systems. It handles both CIDv0 (legacy) and newer CID formats, and provides a straightforward API to parse existing CIDs and generate new ones from hash data.

Use it for:

  • Parse and validate IPFS content hashes (CIDv0 strings) in Python applications.
  • Generate CIDs from raw multihash data for storing or referencing content in IPFS.
  • Inspect CID metadata (version, codec, hash algorithm) for routing or validation logic.
  • Convert between CID string representations and their structured components.
  • Build IPLD-compatible applications that need to work with content-addressed identifiers.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

py-cid encodes and decodes CIDs (Content IDentifiers), the self-describing content-addressed identifiers used by IPFS and IPLD to reference distributed content via cryptographic hashing.

Yes, if you are building on IPFS or IPLD. The package is actively maintained, has low install friction, carries a permissive MIT license, and has no known vulnerabilities. The Pre-Alpha classifier is a minor signal to check the project's stability guarantees, but the active maintenance and long release history since first release in 2017 suggest it is production-ready for its intended use. Install it if you need to work with CIDs; skip it if you have no IPFS/IPLD integration.

Install

py-cid on PyPI

pip

pip install py-cid

uv

uv add py-cid

poetry

poetry add py-cid

Installing py-cid

Before you install

Low install friction: pure Python wheel with four runtime dependencies (py-multibase, py-multicodec, morphys, py-multihash). Actively maintained with a recent commit on 2026-07-13 and regular release cadence since first release in 2017.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

from cid import make_cid

cid = make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')
print(cid.version, cid.codec, cid.multihash)
print(cid.encode())

Requires Python 3.10 or later (supports 3.10–3.14).

Verify before relying

  • Whether py-multihash, py-multicodec, py-multibase, and morphys are actively maintained and have no known vulnerabilities.
  • Performance characteristics when encoding/decoding large batches of CIDs.
  • Whether the Pre-Alpha status (Development Status :: 2) indicates API stability concerns or ongoing breaking changes.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — py-multibase, py-multicodec, morphys, py-multihash
Maintenance actively maintained — 182 days since the last release
Last repo commit
First released
Downloads 164,458/month — #10,548 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_cid-0.5.0-py3-none-any.whl

Keywords: cid, ipfs, ipld, content-addressed, multihash, multibase, multicodec

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

IPFS content identifierCID encoding decodingcontent addressingdistributed system identifiersmultihash multicodec multibaseIPLD content referencecryptographic content hash
ipfscontent-addressingdistributed-systems

More Internet packages