h5.archive.HDFArchiveGroup

class h5.archive.HDFArchiveGroup(parent, subpath)[source]

A view on a subgroup of an HDFArchive.

Exposes a dict-like interface (__getitem__, __setitem__, __delitem__, __iter__, keys, values, items) over the keys of one HDF5 group. On read, registered Python classes are automatically reconstructed via their __factory_from_dict__ (see h5.formats); use get_raw() to bypass reconstruction.

Parameters:
parentHDFArchive or HDFArchiveGroup

The archive or group this view is opened relative to.

subpathstr

Name of the subgroup to open. If empty, this group aliases parent’s group (used for the root view).

Methods

create_group(key)

Create a new empty subgroup.

create_softlink(target_key, key[, ...])

Create an HDF5 soft link key pointing at target_key.

get_raw(key)

Return the entry at key without reconstructing a Python object.

is_data(p)

Return whether p names a dataset (leaf) of this group.

is_group(p)

Return whether p names a subgroup of this group.

items()

Iterate over the (key, value) pairs stored in the group.

keys()

Return the names of the entries in this group.

update(object_with_dict_protocol)

Copy all (key, value) pairs of a mapping into the group.

values()

Iterate over the values stored in the group.

write_attr(key, val)

Write an HDF5 attribute on this group.