Registry / data / hdf5storage

hdf5storage

JSON →
library0.2.2pypypi✓ verified 85d ago

Utilities to read/write Python types to/from HDF5 files, including MATLAB v7.3 MAT files. Current version: 0.2.2. Release cadence: irregular.

pip install hdf5storage
INSTALL
IMPORT
SIG · HDF5STORAGE
H
hdf5storage
datapythonv0.2.2
Install
4.0s avg
Import
472ms
Disk
105MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 4s
py 3.11
✓ —
✓ 3.9s
py 3.12
✓ —
✓ 3.6s
py 3.13
✓ —
✓ 3.8s
py 3.9
✕ build_error
✓ 4.5s
105MB installed
● package 105MB
Code
Verified usage

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

loadmat
from hdf5storage import loadmat
from scipy.io import loadmat
scipy.io.loadmat does not support v7.3 files.
savemat
from hdf5storage import savemat
from scipy.io import savemat
scipy.io.savemat cannot write v7.3 files.
hdf5storage
import hdf5storage
import hdf5storage as h5s
Alias not required but works; correct import is fine.

Write and read a simple dictionary with an array and a string to a MATLAB v7.3 file.

import hdf5storage import numpy as np data = {'array': np.array([1,2,3]), 'string': 'hello'} # Write to v7.3 MAT file hdf5storage.savemat('example.mat', data, format='7.3') # Read back loaded = hdf5storage.loadmat('example.mat') print(loaded['array'])
Debug
Known issues
deprecatedThe 'hdf5storage' library is in maintenance mode; consider using 'h5py' or 'mat73' for v7.3 files.
fix
Migrate to h5py (direct HDF5) or mat73 (MATLAB v7.3 specific).
affects: >=0.2.0
breakingPython 3.10+ only; drops support for Python <3.10.
fix
Use Python 3.10 or later.
affects: >=0.2.0
gotchasavemat with default options writes HDF5-compatible files but MATLAB may not read nested structures correctly without specifying 'format'.
fix
Always pass format='7.3' for MATLAB compatibility.
affects: all
gotchaString arrays are stored as HDF5 datasets; when reading, returned strings may be bytes. Use encoding='utf-8' in loadmat if needed.
fix
Specify encoding explicitly: loadmat('file.mat', encoding='utf-8')
affects: <0.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'hdf5storage'
Library not installed
fix
Run: pip install hdf5storage
OSError: Unable to open file (file signature not found)
File is not HDF5 or v7.3 format
fix
Ensure file is a valid HDF5/v7.3 file. Use h5py or check file header.
ValueError: Cannot write object of type <class 'numpy.ndarray'> with dtype object
savemat cannot handle arrays of Python objects directly
fix
Convert object arrays to supported types (e.g., list, string) or use h5py.
TypeError: can't write bytes to HDF5 dataset
Trying to write bytes without encoding
fix
Convert bytes to string (e.g., .decode()) or use 'h5py' with vlen bytes data type.
Upgrade
Version history
0.2.2latest on PyPI · released Sep 30, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
hdf5storage — pip install hdf5storage · libregistry