hdf5-xxh
Compute a xxHash of the Datasets in an HDF5® file.
Motivation
For regression testing, it is sometimes useful to check for the strict equality of numerical data stored in an HDF5 file. A reference copy of the HDF5 file could be saved, but this is not always desirable, especially if the file is very large. Computing a hash digest of the HDF5 file itself is not possible because, for various reasons, HDF5 files are not byte-for-byte identical, even if the stored data is the same. This small utility computes a hash digest of the datasets stored in the HDF5 files, thereby enabling an easy check for strict equality without the need to store a complete copy of the data itself.
Installation
The package is available on pypi:
pip install h5xxhsum
Usage
$ h5xxhsum foo.h5
e92417e2e9a3425cffbe35fddc5f21a3 foo.h5
Chunked storage
HDF5 supports chunked storage. This utility implements a flag for controlling how the hash digest is computed:
--no-chunked: the whole dataset is loaded in memory and hashed--chunked: the hash is computed incrementally, loading a chunk at a time, with theiter_chunks()method.
--chunked is faster, but the hash digest depends not only on the data itself but also on the chunk size/layout.
On the contrary --no-chunked is slower but idependent on the storage layout.
Caveat emptor
I wrote this small utility for personal use, so there is no guarantee that the API will remain stable. However, I believe it fills a small but useful niche. Please feel free to open an issue if you think it can be improved.
Release files for h5xxhsum 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| h5xxhsum-0.1.0.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| h5xxhsum-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / h5xxhsum-0.1.0.tar.gz
| Download URL | h5xxhsum-0.1.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d92b5969fe9d5cebb9a4b84e5ecba1a089186a4035b6b6d48aa0f56d96568cc1
|
|
BLAKE2b-256 checksum How to use checksums |
cf0a23efed7d111d7e06b0f6e8a5f3016d03cceb02a4ca5058f5187acace95fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Mar 22, 2025.
Transparency logRelease files / h5xxhsum-0.1.0-py3-none-any.whl
| Download URL | h5xxhsum-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee1a10297a4fa356dbabf402b994c3b0060a85ca3c09eb7a5550254b64193c60
|
|
BLAKE2b-256 checksum How to use checksums |
cfd314448b36c7865f253bd045f4b0fee2083ef104cc533e047907bdeabe4384
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Mar 22, 2025.
Transparency log