API reference¶
The package is organized to mirror the structure of the Zarr specifications:
zarr_metadata.json_schema— JSON Schema output for anyTypedDict, one v3 field, or a whole v3zarr.jsonzarr_metadata.model— document models (each one a document and the scope it was read in), the readers that return problems instead of raising them, and theUNSETsentinelzarr_metadata.problems—ValidationProblem,ProblemKind,ProblemsandMetadataValidationError, which every reader reports, andshown, which formats a value for a messagezarr_metadata.pydantic— optional Pydantic field types over the modelszarr_metadata.typed_json—check, which type-checks a JSON value against any of the package'sTypedDicts, read as the typing spec defines them, with every problem locatedzarr_metadata.v2—TypedDictshapes for Zarr v2 documents (.zarray,.zgroup,.zattrs,.zmetadata), andzarr_metadata.v2.definition: the v2 kinds of metadata, the scopeCORE_V2, and the readers of onedtypeor codec. Each dtype family's definition is inzarr_metadata.v2.data_type, and each codec's inzarr_metadata.v2.codeczarr_metadata.v3—TypedDictshapes for Zarr v3 documents, with subpackages for chunk grids, chunk key encodings, codecs, and data typeszarr_metadata.definition— what both formats share for reading a field:Definition,resolve, the three results of a reading (AcceptedField,UnclaimedField,RefusedField), and the scope typeContext. Its module docstring is the guidezarr_metadata.v3.definition— the five v3 kinds of metadata (CodecDefinition,DataTypeDefinition, ...), the codec pipeline types, and the v3 scopesCOREandCORE_AND_EXTENSIONS
The document types, models, and spec vocabulary — including the store keys —
are re-exported at the top level, so
from zarr_metadata import ZarrV3ArrayMetadataJSON and
from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON are equivalent.
The model layer's readers are imported from
zarr_metadata.model directly, and the problem types every
reader reports from zarr_metadata.problems.
Common types¶
Two cross-cutting types are also exported from the top-level
zarr_metadata namespace: JSONValue, documented in
zarr_metadata.typed_json, and ZarrV3NamedConfigJSON,
documented in zarr_metadata.v3.