Tools and Related Projects
There are a number of projects which build upon h5py, or who build upon HDF5, which will likely be of interest to users of h5py. This page is non-exhaustive, but if you think there should be a project added, feel free to create an issue or pull request at https://github.com/h5py/h5py/.
PyTables is the most significant related project, providing a higher level wrapper around HDF5 then h5py, and optimised to fully take advantage of some of HDF5’s features. h5py provides a comparison between the two projects (see What’s the difference between h5py and PyTables?), as does the PyTables project.
See also
IPython
H5py ships with a custom ipython completer, which provides object introspection and tab completion for h5py objects in an ipython session. For example, if a file contains 3 groups, “foo”, “bar”, and “baz”:
In [4]: f['b<TAB>
bar baz
In [4]: f['f<TAB>
# Completes to:
In [4]: f['foo'
In [4]: f['foo'].<TAB>
f['foo'].attrs f['foo'].items f['foo'].ref
f['foo'].copy f['foo'].iteritems f['foo'].require_dataset
f['foo'].create_dataset f['foo'].iterkeys f['foo'].require_group
f['foo'].create_group f['foo'].itervalues f['foo'].values
f['foo'].file f['foo'].keys f['foo'].visit
f['foo'].get f['foo'].name f['foo'].visititems
f['foo'].id f['foo'].parent
The easiest way to enable the custom completer is to do the following in an IPython session:
In [1]: import h5py
In [2]: h5py.enable_ipython_completer()
The completer can be enabled for every session by adding “h5py.ipy_completer” to
the list of extensions in your ipython config file, for example
~/.config/ipython/profile_default/ipython_config.py
(if this file does
not exist, you can create it by invoking ipython profile create):
c = get_config()
c.InteractiveShellApp.extensions = ['h5py.ipy_completer']
Exploring and Visualising HDF5 files
h5py does not contain a tool for exploring or visualising HDF5 files, but tools that can display the structure of h5py include:
HDFView is a visual tool for browsing and editing HDF5 files.
ViTables is a GUI for browsing and editing files in both PyTables and HDF5 formats, and is built on top of PyTables.
h5glance shows the structure of HDF5 files in IPython & Jupyter, as well as at the command line.
See also
The PaNOSC project’s list of HDF5 & NeXus viewers
Additional Filters
Some projects providing additional HDF5 filter with integration into h5py include:
hdf5plugin: this provides several plugins (currently Blosc, Blosc2, BitShuffle, BZip2, FciDecomp, LZ4, SZ, SZ3, Zfp, ZStd), and newer plugins should look to supporting h5py via inclusion into hdf5plugin.
Libraries extending h5py
These libraries offer additional general functionality on top of h5py:
Versioned HDF5 offers a versioned abstraction on top of h5py. It provides a wrapper around the h5py API that allows storing different versions of groups and datasets within an HDF5 file.
h5preserve lets you define how to save and load instances of a given class in HDF5 files, by writing dumper and loader functions. These functions can also have multiple versions.
Hickle provides an API like
pickle
to dump & load arbitrary Python objects in HDF5 files.h5pickle wraps h5py to allow pickling objects such as
File
orDataset
. This relies on the file being available at the same path when unpickling.b2h5py provides h5py with transparent, automatic optimized reading of n-dimensional slices of Blosc2-compressed datasets, using direct chunk access and 2-level partitioning.