What is zarr-metadata?
mainzarr-metadata provides Python types, models, and validators for Zarr v2 and v3 metadata. It consists of three main components:
- Typed JSON shapes:
TypedDictdefinitions andLiteralaliases representing the JSON documents specified by the Zarr v2 and v3 specifications, includingzarr-extensionsand consolidated metadata. - Document models (
zarr_metadata.model): Canonical frozen-dataclass models of whole metadata documents. These include structural validators, loc-aware parsers, and store-key (de)serialization. Models produced viato_jsonare decoupled from the original model's mutable state. - Optional Pydantic integration (
zarr_metadata.pydantic): Requires Pydantic 2.13 or newer. Each model can be used as a Pydantic field type that validates raw documents using the same strict parser used by the document models.