Python package to hash dictionaries using default hash, md5, sha256 and more. Supports nested structures, pandas, numpy, polars, datetime, and custom hash functions. Active development with recent additions including approximate hashing and support for timedelta. Current version: 1.3.7.
pip install dict-hashVerified import paths — ran on the pinned version, not inferred.
Compute a SHA256 hash of a dictionary.
Use 'sha256' or 'md5' instead of 'dict_hash' for a stable hash.
Ensure pandas is installed if you hash dictionaries containing pandas objects, or update code to handle NumPy-only dicts separately.
Replace 'dict_hash(my_dict, hash_func='sha256')' with 'from dict_hash import sha256; sha256(my_dict)'.
Install with 'pip install dict-hash' and import using 'from dict_hash import ...'.
Update to latest version and use 'from dict_hash import md5' then call 'md5(my_dict)'.
Install pandas: 'pip install pandas'. Then use 'from dict_hash import sha256; sha256(my_dict)'.