The Attributes class (zarr.attrs)#

class zarr.attrs.Attributes(store, key='.zattrs', read_only=False, cache=True, synchronizer=None)[source]#

Class providing access to user attributes on an array or group. Should not be instantiated directly, will be available via the .attrs property of an array or group.

Parameters:
storeMutableMapping

The store in which to store the attributes.

keystr, optional

The key under which the attributes will be stored.

read_onlybool, optional

If True, attributes cannot be modified.

cachebool, optional

If True (default), attributes will be cached locally.

synchronizerSynchronizer

Only necessary if attributes may be modified from multiple threads or processes.

__getitem__(item)[source]#
__setitem__(item, value)[source]#
__delitem__(item)[source]#
__iter__()[source]#
__len__()[source]#
keys() a set-like object providing a view on D's keys[source]#
asdict()[source]#

Retrieve all attributes as a dictionary.

put(d)[source]#

Overwrite all attributes with the key/value pairs in the provided dictionary d in a single operation.

update(*args, **kwargs)[source]#

Update the values of several attributes in a single operation.

refresh()[source]#

Refresh cached attributes from the store.