Table Of Contents

Previous topic

Low-level API reference

Next topic

Module H5A

This Page

Module H5

Common support and versioning module for the h5py HDF5 interface.

This is an internal module which is designed to set up the library and enables HDF5 exception handling.

Exception classes are now located in the module h5py.h5e.

Library API

h5py.h5.get_config() → H5PYConfig
Get a reference to the global library configuration object.
h5py.h5.get_libversion() -> TUPLE (major, minor, release)
Retrieve the HDF5 library version as a 3-tuple.

Base classes for library

class h5py.h5.ObjectID

Base class for all HDF5 identifiers.

This is an extremely thin object layer, which makes dealing with HDF5 identifiers a less frustrating experience. It synchronizes Python object reference counts with their HDF5 counterparts, so that HDF5 identifiers are automatically closed when they become unreachable.

The only (known) HDF5 property which can problematic is locked objects; there is no way to determine whether or not an HDF5 object is locked or not, without trying an operation and having it fail. A “lock” flag is maintained on the Python side, and is set by methods like TypeID.lock(), but this is not tracked across copies. Until HDF5 provides something like H5Tis_locked(), this will not be fixed.

The truth value of an ObjectID (i.e. bool(obj_id)) indicates whether the underlying HDF5 identifier is valid.

class h5py.h5.H5Error
Base class for internal HDF5 library exceptions.
class h5py.h5.H5PYConfig

Provides runtime access to global library settings. You retrieve the master copy of this object by calling h5py.get_config().

API_16 (T/F, readonly)
Is the HDF5 1.6 API available? Currently always true.
API_18 (T/F, readonly)
If the HDF5 1.8 API available?
complex_names (tuple, r/w)
Settable 2-tuple controlling how complex numbers are saved. Defaults to (‘r’,’i’).
bool_names (tuple, r/w)
Settable 2-tuple controlling the HDF5 enum names used for boolean values. Defaults to (‘FALSE’, ‘TRUE’) for values 0 and 1.

Module constants

These constants are only available with HDF5 1.8.X.

h5py.h5.INDEX_NAME
Resolve indices in alphanumeric order
h5py.h5.INDEX_CRT_ORDER
Resolve indices in order of object creation. Not always available.
h5py.h5.ITER_NATIVE
Traverse index in the fastest possible order. No particular pattern is guaranteed.
h5py.h5.ITER_INC
Traverse index in increasing order
h5py.h5.ITER_DEC
Traverse index in decreasing order