# xarray.backends.ZarrStore

### *class* xarray.backends.ZarrStore(zarr_group, mode=None, consolidate_on_close=False, append_dim=None, write_region=None, safe_chunks=True, write_empty=None, close_store_on_close=False, use_zarr_fill_value_as_mask=None, align_chunks=False, cache_members=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/backends/zarr.py#L704-L1520)

Store for reading and writing data via zarr

#### \_\_init_\_(zarr_group, mode=None, consolidate_on_close=False, append_dim=None, write_region=None, safe_chunks=True, write_empty=None, close_store_on_close=False, use_zarr_fill_value_as_mask=None, align_chunks=False, cache_members=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/backends/zarr.py#L835-L878)

### Methods

| [`__init__`](#xarray.backends.ZarrStore.__init__)(zarr_group[, mode, ...])                                                         |                                                                                                                                                                                           |
|--------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `array_keys`()                                                                                                                             |                                                                                                                                                                                           |
| `arrays`()                                                                                                                                 |                                                                                                                                                                                           |
| [`close`](xarray.backends.ZarrStore.close.html.md#xarray.backends.ZarrStore.close)()                                                   |                                                                                                                                                                                           |
| `encode`(variables, attributes)                                                                                                            | Encode the variables and attributes in this store                                                                                                                                         |
| [`encode_attribute`](xarray.backends.ZarrStore.encode_attribute.html.md#xarray.backends.ZarrStore.encode_attribute)(a)                            | encode one attribute                                                                                                                                                                      |
| [`encode_variable`](xarray.backends.ZarrStore.encode_variable.html.md#xarray.backends.ZarrStore.encode_variable)(variable[, name])               | encode one variable                                                                                                                                                                       |
| [`get_attrs`](xarray.backends.ZarrStore.get_attrs.html.md#xarray.backends.ZarrStore.get_attrs)()                                           |                                                                                                                                                                                           |
| `get_child_store`(group)                                                                                                                   | Get a store corresponding to the indicated child group.                                                                                                                                   |
| [`get_dimensions`](xarray.backends.ZarrStore.get_dimensions.html.md#xarray.backends.ZarrStore.get_dimensions)()                                 |                                                                                                                                                                                           |
| `get_encoding`()                                                                                                                           |                                                                                                                                                                                           |
| `get_parent_dimensions`()                                                                                                                  |                                                                                                                                                                                           |
| [`get_variables`](xarray.backends.ZarrStore.get_variables.html.md#xarray.backends.ZarrStore.get_variables)()                                   |                                                                                                                                                                                           |
| `load`()                                                                                                                                   | This loads the variables and attributes simultaneously.                                                                                                                                   |
| [`open_group`](xarray.backends.ZarrStore.open_group.html.md#xarray.backends.ZarrStore.open_group)(store[, mode, group, ...])                |                                                                                                                                                                                           |
| `open_store`(store[, mode, group, ...])                                                                                                    |                                                                                                                                                                                           |
| [`open_store_variable`](xarray.backends.ZarrStore.open_store_variable.html.md#xarray.backends.ZarrStore.open_store_variable)(name)                   |                                                                                                                                                                                           |
| `prepare_variable`(name, variable, ...)                                                                                                    |                                                                                                                                                                                           |
| `set_attribute`(k, v)                                                                                                                      |                                                                                                                                                                                           |
| [`set_attributes`](xarray.backends.ZarrStore.set_attributes.html.md#xarray.backends.ZarrStore.set_attributes)(attributes)                       | This provides a centralized method to set the dataset attributes on the data store.                                                                                                       |
| `set_dimension`(dim, length, is_unlimited)                                                                                                 |                                                                                                                                                                                           |
| [`set_dimensions`](xarray.backends.ZarrStore.set_dimensions.html.md#xarray.backends.ZarrStore.set_dimensions)(variables[, unlimited_dims])      | This provides a centralized method to set the dimensions on the data store.                                                                                                               |
| `set_variable`(k, v)                                                                                                                       |                                                                                                                                                                                           |
| [`set_variables`](xarray.backends.ZarrStore.set_variables.html.md#xarray.backends.ZarrStore.set_variables)(variables, check_encoding_set, ...) | This provides a centralized method to set the variables on the data store.                                                                                                                |
| [`store`](xarray.backends.ZarrStore.store.html.md#xarray.backends.ZarrStore.store)(variables, attributes[, ...])                       | Top level method for putting data on this store, this method:                                                                                                                             |
| `store_dataset`(dataset)                                                                                                                   | in stores, variables are all variables AND coordinates in xarray.Dataset variables are variables NOT coordinates, so here we pass the whole dataset in instead of doing dataset.variables |
| [`sync`](xarray.backends.ZarrStore.sync.html.md#xarray.backends.ZarrStore.sync)()                                                     | Write all buffered data to disk.                                                                                                                                                          |

### Attributes

| `zarr_group`                                                                     |                                                                     |
|----------------------------------------------------------------------------------|---------------------------------------------------------------------|
| [`ds`](xarray.backends.ZarrStore.ds.html.md#xarray.backends.ZarrStore.ds) |                                                                     |
| `members`                                                                        | Model the arrays and groups contained in self.zarr_group as a dict. |
