h5.formats.FormatInfo

class h5.formats.FormatInfo(classname, modulename, doc, hdf5_format, read_fun)[source]

Metadata describing how to reconstruct a Python class from an HDF5 group.

Created and stored in a module-level registry by register_class(), and looked up at read time by get_format_info() from the Format attribute of the HDF5 group.

Parameters:
classnamestr

Name of the Python class to reconstruct.

modulenamestr

Name of the module the class must be imported from.

docstr or dict

Documentation associated with the format.

hdf5_formatstr

The HDF5 format string this info is registered under. Stored on the instance as the format_name attribute.

read_funcallable or None

Optional custom read function read_fun(group, key).

Attributes

classname

(str) Name of the Python class to reconstruct.

modulename

(str) Name of the module the class must be imported from.

doc

(str or dict) Documentation associated with the format.

read_fun

(callable or None) Optional custom read function read_fun(group, key).

format_name

(str) The HDF5 format string (from the hdf5_format argument).

backward_compat

(dict) Backward-compatibility mapping field_name -> hdf5_format; empty for an exact match.