zarr.metadata.migrate_v3
========================

.. py:module:: zarr.metadata.migrate_v3


Functions
---------

.. autoapisummary::

   zarr.metadata.migrate_v3.migrate_to_v3
   zarr.metadata.migrate_v3.migrate_v2_to_v3
   zarr.metadata.migrate_v3.remove_metadata


Module Contents
---------------

.. py:function:: migrate_to_v3(zarr_v2: zarr.Array | zarr.Group, output_path: zarr.storage.StorePath, dry_run: bool = False) -> None

   
   Migrate all v2 metadata in a Zarr array/group to v3.

   Note - if a group is provided, then all arrays / groups within this group will also be converted.
   A zarr.json file will be created for each level and written to output_path, with any v2 files
   (.zarray, .zattrs etc.) left as-is.

   :Parameters:

       **zarr_v2** : Array | Group
           An array or group with zarr_format = 2

       **output_path** : StorePath
           The store path to write generated v3 metadata to.

       **dry_run** : bool, optional
           Enable a 'dry run' - files that would be created are logged, but no files are created or changed.














   ..
       !! processed by numpydoc !!

.. py:function:: migrate_v2_to_v3(*, input_store: zarr.abc.store.Store, output_store: zarr.abc.store.Store | None = None, dry_run: bool = False) -> None

   
   Migrate all v2 metadata in a Zarr store to v3.

   This will create a zarr.json file at each level of a Zarr hierarchy (for every group / array).
   v2 files (.zarray, .zattrs etc.) will be left as-is.

   :Parameters:

       **input_store** : Store
           Input Zarr to migrate.

       **output_store** : Store, optional
           Output location to write v3 metadata (no array data will be copied). If not provided, v3 metadata will be
           written to input_store.

       **dry_run** : bool, optional
           Enable a 'dry run' - files that would be created are logged, but no files are created or changed.














   ..
       !! processed by numpydoc !!

.. py:function:: remove_metadata(store: zarr.abc.store.Store, zarr_format: zarr.core.common.ZarrFormat, force: bool = False, dry_run: bool = False) -> None
   :async:


   
   Remove all v2 (.zarray, .zattrs, .zgroup, .zmetadata) or v3 (zarr.json) metadata files from the given Zarr.

   Note - this will remove metadata files at all levels of the hierarchy (every group and array).

   :Parameters:

       **store** : Store
           Zarr to remove metadata from.

       **zarr_format** : ZarrFormat
           Which format's metadata to remove - 2 or 3.

       **force** : bool, optional
           When False, metadata can only be removed if a valid alternative exists e.g. deletion of v2 metadata will
           only be allowed when v3 metadata is also present. When True, metadata can be removed when there is no
           alternative.

       **dry_run** : bool, optional
           Enable a 'dry run' - files that would be deleted are logged, but no files are removed or changed.














   ..
       !! processed by numpydoc !!

