H5Glance demo

In [1]:
import h5py
In [2]:
# Create some example HDF5 data to show
f = h5py.File("example.h5", "w")
f.create_dataset("/group1/subgroup1/dataset1", (200,), dtype='u8')
f.create_dataset("/group1/subgroup1/dataset2", (2, 128, 500), dtype='f4')
f.create_dataset("/group1/subgroup2/dataset1", (12,), dtype='i2')

# Basic h5py repr
f
Out[2]:
<HDF5 file "example.h5" (mode r+)>

Use H5Glance explicitly

In [3]:
from h5glance import H5Glance
H5Glance(f)
Out[3]:
In [4]:
H5Glance(f['group1/subgroup1'])
Out[4]:

View all h5py objects

Install a display hook for IPython so all h5py files & groups are viewed this way.

In [5]:
import h5glance
h5glance.install_ipython_h5py_display()
In [6]:
f
Out[6]:
In [7]:
f['group1']
Out[7]:
In [ ]: