--- id: py-multicodec version: "1.0.0" license: MIT license_treatment: permissive maintenance: aging --- # py-multicodec — Multicodec implementation in Python License: permissive · Maintenance: aging · Downloads: 174.6K/mo ## What it is and what it does py-multicodec is a Python implementation of the Multicodec specification, a self-describing multiformat standard that wraps data with a tiny varint-encoded header identifying the codec used. The library lets you add codec prefixes to binary data, extract those prefixes, and look up which codec was used—all grounded in a table of supported codecs maintained from the upstream multiformats specification. The package provides both simple prefix operations (add_prefix, remove_prefix, get_codec) and type-safe codec management through named Code constants and a known_codes registry. It supports modern Python versions (3.10 through 3.14) and depends only on varint for encoding/decoding the multicodec identifiers. The library is commonly used in IPFS and IPLD ecosystems where content addressing and format identification are critical. Use it for: - Tag binary data with codec identifiers in IPFS/IPLD applications to enable format-agnostic content addressing. - Decode multicodec-prefixed data to identify the underlying format before processing. - Build type-safe codec handling in systems that work with multiple serialization formats (CBOR, JSON, Protocol Buffers). - Maintain a canonical reference of supported multicodec codes in a Python application. - Wrap custom or domain-specific data formats with standard multicodec headers for interoperability. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Wraps data with self-describing multicodec prefixes, enabling format identification and codec lookup from varint-encoded headers. Yes, if you work with IPFS, IPLD, or other multiformats ecosystems. The package is stable (Production/Stable classifier), has no known vulnerabilities, and installs with minimal friction. Maintenance is aging (239 days since last release), but the repository is active and the API is mature. Install it for multicodec prefix operations; avoid it if you have no need for format-agnostic codec tagging. ## Install pip install py-multicodec uv add py-multicodec poetry add py-multicodec ## Installing py-multicodec Before you install: Low friction install with a single runtime dependency (varint). Last release was recent; repository is active and not archived, though maintenance status is aging with 239 days since last release. License in practice: MIT license permits commercial and private use with minimal restrictions—suitable for most projects. Quickstart: pip install py-multicodec from multicodec import add_prefix, remove_prefix, get_codec # Add codec prefix to data prefixed = add_prefix('sha2-256', b'EiC5TSe5k00') # Retrieve codec name from prefixed data codec_name = get_codec(prefixed) Requires Python 3.10 or later. Verify before relying: - Whether the 460 known codecs listed in the description are current as of the latest release. - Performance characteristics when handling large batches of codec operations. - Stability guarantees for the multicodec table updates and backward compatibility across versions. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 174.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags multicodec prefix encoding, self-describing data format, multiformat codec wrapper, varint codec identification, IPFS multicodec implementation, data format tagging, codec lookup by prefix, ipfs-ipld, codec-tagging, multiformats [View on SkillFed](https://skillfed.io/packages/py-multicodec) · [View on PyPI](https://pypi.org/project/py-multicodec/)