py-cid
Self-describing content-addressed identifiers for distributed systems
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-ciduv
uv add py-cidpoetry
poetry add py-cidInstalling 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
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
ipfshttpclientA Python HTTP client library for interacting…
permissive · top 15,000 on PyPI
libipldlibipld provides fast Python bindings to a Rust…
permissive · top 15,000 on PyPI
py-multicodecWraps data with self-describing multicodec…
permissive · top 15,000 on PyPI
py-multibaseEncodes and decodes data using the Multibase…
permissive · top 15,000 on PyPI
py-multihashEncodes and decodes multihash digests,…
permissive · top 15,000 on PyPI
ulid-pyGenerates and parses ULIDs (Universally Unique…
permissive · top 5,000 on PyPI
rlpEncodes and decodes data using Recursive Length…
permissive · top 5,000 on PyPI
multiaddrParses, constructs, and manipulates…
permissive · top 15,000 on PyPI
bech32mEncodes and decodes Bech32 and Bech32m strings,…
permissive · top 15,000 on PyPI
hashidsGenerates short, unique, non-sequential hashes…
permissive · top 5,000 on PyPI