--- id: dict-hash version: "1.3.7" license: MIT license_treatment: permissive maintenance: aging --- # dict-hash — Python package to hash dictionaries using default hash, md5, sha256 and more. License: permissive · Maintenance: aging · Downloads: 86.9K/mo ## What it is and what it does dict_hash solves the problem that Python dictionaries cannot be hashed natively because they are mutable. This library provides two main functions: dict_hash for session-based hashing using Python's native hash function, and sha256 (plus other cryptographic algorithms) for consistent, reproducible hashes. It extends this capability to complex data structures—Pandas and Polars DataFrames and Series, NumPy arrays, and Numba objects—making it useful for caching, deduplication, and data versioning workflows. The package handles edge cases like recursive objects (dictionaries containing themselves) and unhashable nested objects through configurable error handling modes (raise, warn, or ignore). It also offers an approximation mode that subsamples large objects for faster, lightweight hashing. Custom objects can implement the Hashable interface to define their own hashing behavior. Use it for: - Create cache keys from function arguments containing dictionaries or DataFrames to enable memoization. - Generate consistent checksums for Pandas or Polars datasets to detect changes or duplicates. - Hash NumPy arrays as part of experiment tracking or model versioning pipelines. - Implement deduplication logic for complex nested data structures in ETL workflows. - Build content-addressed storage systems where data is identified by its hash digest. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates consistent hashes for Python dictionaries and supports hashing Pandas, Polars, Numba, and NumPy objects using default hash or cryptographic algorithms like SHA256. Yes, with conditions. The package is stable and permissively licensed, but the high install friction from its compiled dependency (deflate_dict) and aging maintenance status (277 days since last release) mean you should verify wheel availability for your platform before adopting it. If you need to hash dictionaries or data science objects and can tolerate the dependency, it is a solid choice; otherwise, consider whether a simpler pure-Python alternative suits your use case. ## Install pip install dict-hash uv add dict-hash poetry add dict-hash ## Installing dict-hash Before you install: High install friction due to a compiled dependency (deflate_dict). Package is in aging maintenance status with 277 days since last release, though the repository remains active and has been maintained since 2019. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects. Quickstart: pip install dict-hash from dict_hash import sha256 my_dict = {"key": "value"} my_hash = sha256(my_dict) Requires deflate_dict as a compiled runtime dependency, which may require a C compiler or pre-built wheels for your platform. Verify before relying: - Whether deflate_dict wheels are available for all major platforms or if compilation is required during install. - Performance characteristics when hashing very large DataFrames or arrays with approximation mode enabled. - Compatibility guarantees with Pandas 2.x and NumPy 2.x beyond the stated support claim. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: aging - Downloads: 86.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags hash dictionaries python, dict hashing library, pandas dataframe hashing, consistent hash function, sha256 dictionary, numpy array hashing, polars dataframe hash, hashing, caching, data-structures [View on SkillFed](https://skillfed.io/packages/dict-hash) · [View on PyPI](https://pypi.org/project/dict-hash/)