Fetching contributors…
Cannot retrieve contributors at this time
123 lines (74 sloc) 3.71 KB


Attributes are a critical part of what makes HDF5 a "self-describing" format. They are small named pieces of data attached directly to :class:`Group` and :class:`Dataset` objects. This is the official way to store metadata in HDF5.

Each Group or Dataset has a small proxy object attached to it, at <obj>.attrs. Attributes have the following properties:

  • They may be created from any scalar or NumPy array
  • Each attribute should be small (generally < 64k)
  • There is no partial I/O (i.e. slicing); the entire attribute must be read.

The .attrs proxy objects are of class :class:`AttributeManager`, below. This class supports a dictionary-style interface.


AttributeManager objects are created directly by h5py. You should access instances by group.attrs or dataset.attrs, not by manually creating them.