Skip to main content

Spec-defined metadata types for Zarr v2 and v3.

Project description

zarr-metadata

Python type definitions for Zarr v2 and v3 metadata.

What this is

A typed-data package: TypedDict definitions and Literal aliases for the JSON shapes specified by the Zarr v2 and Zarr v3 specifications, plus types for zarr-extensions and a few widely-used-but-unspecified entities (e.g. consolidated metadata).

What this is for

These types describe the JSON shape of Zarr metadata. They are intended for libraries that read, write, validate, or transform Zarr metadata. Pair them with a runtime validator like pydantic to check JSON loaded from disk:

import json
from pydantic import TypeAdapter
from zarr_metadata.v3.array import ArrayMetadataV3

with open("zarr.json", "rb") as f:
    raw = json.load(f)

metadata = TypeAdapter(ArrayMetadataV3).validate_python(raw)

What this is not

  • Not a parser or builder. There are no make_array_metadata(...) factories — that surface belongs to consumer libraries.
  • Not a runtime validator on its own. Pair with pydantic, msgspec, or similar to enforce shapes at decode time.

Even with a runtime validator, these types only describe structural shape — they will not flag semantically invalid metadata, like a 3D v3 array whose dimension_names has 4 entries instead of 3. That's a job for downstream validator routines.

Scope

At minimum, this library supports what Zarr-Python needs: the complete Zarr v2 and v3 specs, consolidated metadata, and a subset of the metadata defined in zarr-extensions. We are generally open to contributions that add types for Zarr metadata with a published spec.

Releasing

The package version is derived from git tags by hatch-vcs. Tags must match the pattern zarr_metadata-v<version> (e.g. zarr_metadata-v0.2.0) so they do not collide with the main zarr-python release tags.

To cut a release:

  1. Create and push a tag of the form zarr_metadata-v<version> on the commit you want to publish, e.g.:
    git tag zarr_metadata-v0.2.0 <commit>
    git push origin zarr_metadata-v0.2.0
    
  2. Pushing the tag fires the zarr-metadata release workflow, which builds the wheel/sdist (version resolved from the tag), runs an install smoke test, and publishes to PyPI via OIDC trusted publishing.

We intentionally do not create a GitHub Release for zarr-metadata versions — GitHub Releases live at the repo level, and a zarr-metadata release would surface in the zarr-python repo's Releases UI as if it were a zarr-python release.

To dry-run a build against TestPyPI, dispatch the workflow manually (Actionszarr-metadata releaseRun workflow). Manual dispatches build from the current commit; with no recent tag the version will look like 0.1.devN, which is fine for TestPyPI.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zarr_metadata-0.2.0.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zarr_metadata-0.2.0-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file zarr_metadata-0.2.0.tar.gz.

File metadata

  • Download URL: zarr_metadata-0.2.0.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zarr_metadata-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c83427d0e160f8088ad58cd8ea54eec0cbdc943007e3cc8653d6b5889c672ac5
MD5 dec123d86d3bfdd05e0365b9b290af5e
BLAKE2b-256 addcd3b36f4860a701de299947b162dca4feaffc5a3e888dfea1ceb4ec90c1af

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarr_metadata-0.2.0.tar.gz:

Publisher: zarr-metadata-release.yml on zarr-developers/zarr-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zarr_metadata-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: zarr_metadata-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zarr_metadata-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4be39d446a8b1294526eddc1d585be7c089c386f72d6f9534cd345eedf86121b
MD5 3b2b719c20dc53bdb85875c7a31d9d19
BLAKE2b-256 c77d1cb80189c59eb15c50bdaad802d5244b10faeb4c8a91c63d30cd81a13762

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarr_metadata-0.2.0-py3-none-any.whl:

Publisher: zarr-metadata-release.yml on zarr-developers/zarr-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page