Canonical Hash
Deterministic hashing for arbitrary Python objects.
Provides utilities for creating stable, deterministic hashes of Python objects, essential for cache key computation, data versioning, and reproducibility.
Usage
from scicanonicalhash import canonical_hash, generate_record_id
# Hash any supported Python object
h = canonical_hash(42)
h = canonical_hash([1, 2, 3])
h = canonical_hash({"key": "value"})
# Generates a 16-character hex string (first 64 bits of SHA-256)
assert len(h) == 16
assert canonical_hash(42) == canonical_hash(42) # Deterministic
Supported Types
- JSON-serializable primitives (None, bool, int, float, str)
- numpy ndarrays (via shape + dtype + raw bytes)
- pandas DataFrames (via columns + index + array serialization)
- pandas Series (via name + array serialization)
- Dicts (sorted keys, recursive serialization)
- Lists/tuples (order-preserving, recursive serialization)
generate_record_id
Generate a unique record ID from type, schema version, content hash, and metadata:
rid = generate_record_id("MyData", 1, "abc123", {"subject": 1})
Metadata
Release files for scicanonicalhash 0.1.39
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| scicanonicalhash-0.1.39.tar.gz | 7.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scicanonicalhash-0.1.39-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / scicanonicalhash-0.1.39.tar.gz
| Download URL | scicanonicalhash-0.1.39.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e00426714c467bc426d7e7c093d73718e0244c19777a4c6c982f55849012a9bd
|
|
BLAKE2b-256 checksum How to use checksums |
7fd1d4ad8b96fd088d8d041110b1eea65b2262b04e05ae9641e7d0ebc583049c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / scicanonicalhash-0.1.39-py3-none-any.whl
| Download URL | scicanonicalhash-0.1.39-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e5095a70667a94b7a252d336712e234ea4e8a2b5d898f8633b984d06e39c80c
|
|
BLAKE2b-256 checksum How to use checksums |
4cbf55eb1b7e4d31b83da3bc84b7295da821aeee5e17605effca1da7ba2ffb00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logSecurity for scicanonicalhash 0.1.39
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for scicanonicalhash-0.1.39.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.