Registry / storage / h5io
library0.2.5pypypi✓ verified 84d ago

A Python library for saving and loading Python objects to/from HDF5 files. Provides simple functions to read/write dictionaries, lists, NumPy arrays, and other basic Python types into HDF5 datasets. Current version 0.2.5 (released <2024); release cadence is low (no new releases since 2020).

pip install h5io
INSTALL
IMPORT
SIG · H5IO
H
h5io
storagepythonv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

read_hdf5
from h5io import read_hdf5
import h5io; h5io.read_hdf5()
Works, but direct import is preferred
write_hdf5
from h5io import write_hdf5

Write and read a dictionary containing a list and a NumPy array.

import numpy as np from h5io import write_hdf5, read_hdf5 data = {'a': 1, 'b': [1, 2, 3], 'c': np.array([1.0, 2.0])} write_hdf5('test.h5', data, title='example') loaded = read_hdf5('test.h5', title='example') print(loaded)
Debug
Known issues
gotchaOnly 'title' parameter is required; data is saved as a group with that name. Multiple titles in one file allowed.
fix
Always provide a unique title per dataset object.
affects: all
gotchaThe 'compression' parameter in write_hdf5 can be 'gzip', 'lzf', or None. Not available in read_hdf5.
fix
Set compression only on write; reading decompresses automatically.
affects: all
gotchaObjects with custom classes (not built-in) will be serialized as their __dict__ but the class info may be lost unless saved as a 'dict' or handled manually.
fix
Convert custom objects to dicts before saving.
affects: all
deprecatedPython 3.8 is the minimum; Python 3.12+ might have compatibility issues with old h5py versions.
fix
Upgrade h5py to >=3.0 to avoid deprecation warnings.
affects: 0.2.0 - 0.2.5
Errors
Common errors & fixes
AttributeError: module 'h5io' has no attribute 'read_hdf5'
Incorrect import: using import h5io then h5io.read_hdf5() but older version or namespace issue.
fix
Use: from h5io import read_hdf5
IOError: Unable to open file (File signature not found)
Specifying a non-HDF5 file or corrupt file.
fix
Check file extension and use HDF5 files.
ValueError: Title cannot be None or empty
Omitting the title parameter in write_hdf5.
fix
Provide a non-empty string for the title argument.
Upgrade
Version history
0.2.5latest on PyPI · released Apr 14, 2025
Audit
Dependencies
h5pyrequiredHDF5 backend required at runtime
numpyoptionalFor array support
Agent activity
27 hits · last 30 days
node
26
Resources
h5io — pip install h5io · libregistry