Change CIDv1.encode() default encoding from base58btc to base32 to conform with the CID specification.
This also changes
str(cid)for CIDv1 objects (which usesencode()), and therefore IPLD JSON serialization viato_json_dict()/CIDJSONEncoder, which emit the string form. Callers that require base58btc must passencode("base58btc")explicitly. (#66)
- Validate multihash correctness in CIDv0 constructor. (#63)
- Support all standard hash types from multihash library in Prefix.sum(). (#64)
- Delegate multihash type mappings in Prefix to the multihash library. (#65)
- Fix from_reader() to properly parse multi-byte varints for codec and multihash length. (#67)
- Update CIDSet.for_each() to stop iteration and return the error if the callback function raises an exception or returns an exception. (#69)
- Document
Undefin the API reference and type stubs. (#68)
- Add
Undefsentinel for representing undefined/nil CIDs, matching go-cidUndef. (#68) - Add pytest-benchmark based performance benchmarking tests to evaluate Cid.prefix, Cid.encode, and Prefix.sum execution speeds. (#71)
- Add property-based fuzz testing using hypothesis to ensure CID parsing and encoding are robust against arbitrary input and do not crash. (#72)
- Add
version.jsonfor consistency with go-cid and the multiformats ecosystem; bump-my-version keeps it in sync on release. (#73)
- Raise lower bounds to
py-multihash>=4.0.0,py-multibase>=2.1.0, andpy-multicodec>=1.1.0. (#89)
- Cache
CIDv1.bufferafter the first access so repeated serialization does not recompute the byte representation. (#70)
Add comprehensive feature parity with go-cid implementation.
This includes 13 major features organized by priority:
Critical Features (P0): - JSON Marshaling (IPLD Format):
BaseCID.to_json_dict(),BaseCID.from_json_dict(), andCIDJSONEncoderfor full JSON integration - Prefix Operations:Prefixclass for CID metadata management,Prefix.sum()for creating CIDs from data, andBaseCID.prefix()for extracting prefixHigh Priority Features (P1): - /ipfs/ Path Parsing:
parse_ipfs_path()and automatic extraction infrom_string()- Extract Encoding:extract_encoding()to get multibase encoding without full parsing - Trailing Bytes Validation:from_bytes_strict()for strict CID parsingMedium Priority Features (P2): - Builder Pattern:
V0BuilderandV1Builderfor fluent CID construction - Set Operations:CIDSetclass for managing collections of unique CIDs with full Python set interface - Defined Check:BaseCID.defined()to check if CID is valid - Stream Parsing:from_reader()for parsing CIDs from streamsLow Priority Features (P3): - MustParse:
must_parse()convenience function for strict parsing - Binary/Text Marshaling:BaseCID.to_bytes(),BaseCID.to_text(), andBaseCID.from_text()- KeyString:BaseCID.key_string()for binary representation as string - Loggable:BaseCID.loggable()for logging purposesAll features include comprehensive tests (168 total, 81% coverage) and complete documentation with working code examples. (#60)
- Add Python 3.14 to the supported and tested interpreter list across tox and CI. (#45)
- Migrate from pymultihash to py-multihash >= 2.0.0 for better maintenance and modern API support. (#47)
- Update license format in pyproject.toml from deprecated TOML table to SPDX string format to comply with setuptools>=77.0.0 requirements. (#46)
- Copied
base58code directly intopy-cidto avoid future dependency issues. (#52)
- Complete build system modernization with pyproject.toml Added comprehensive development tooling (ruff, mypy, pre-commit, tox) Updated dependencies to use pymultihash instead of py-multihash Added GitHub Actions CI/CD pipeline Added type stubs for mypy support Updated Python version support to 3.10+ Enhanced testing with pytest, hypothesis, and coverage Added towncrier for changelog management Improved documentation and contributing guidelines (#40)
- Fix edge cases with multibase and multihash decoding
- Added hypothesis tests while verifying CIDs
- Handle the case where an incorrect base58 encoded value is provided to make_cid
- First release on PyPI.