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:
- 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 - Pushing the tag fires the
zarr-metadata releaseworkflow, 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
(Actions → zarr-metadata release → Run 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zarr_metadata-0.3.0.tar.gz.
File metadata
- Download URL: zarr_metadata-0.3.0.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8fe02feef43380056ea0429ceb50974b7b5afe6f0386853977506b034e89d53
|
|
| MD5 |
4e03990889ba1f308ffa647b6fa22ecc
|
|
| BLAKE2b-256 |
f29ccfd5aa02a27c63ecec702a77834b395411518da5c748414d7e6a323638ed
|
Provenance
The following attestation bundles were made for zarr_metadata-0.3.0.tar.gz:
Publisher:
zarr-metadata-release.yml on zarr-developers/zarr-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zarr_metadata-0.3.0.tar.gz -
Subject digest:
d8fe02feef43380056ea0429ceb50974b7b5afe6f0386853977506b034e89d53 - Sigstore transparency entry: 1870748457
- Sigstore integration time:
-
Permalink:
zarr-developers/zarr-python@4e79f1bca6cb0fb4a1e763ae8b2706a17d0fde7e -
Branch / Tag:
refs/tags/zarr_metadata-v0.3.0 - Owner: https://github.com/zarr-developers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
zarr-metadata-release.yml@4e79f1bca6cb0fb4a1e763ae8b2706a17d0fde7e -
Trigger Event:
push
-
Statement type:
File details
Details for the file zarr_metadata-0.3.0-py3-none-any.whl.
File metadata
- Download URL: zarr_metadata-0.3.0-py3-none-any.whl
- Upload date:
- Size: 45.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6651f418fcc89cc3c6fc11aa852fb6f8dd6f31d62913abc0d4d37ce7302d671
|
|
| MD5 |
82710693828bead684b552fc2e52c91f
|
|
| BLAKE2b-256 |
919664137930fb40b96b4d207eb1f1e4e42c5d6c9e682a5a7c3e6feff6eb0e29
|
Provenance
The following attestation bundles were made for zarr_metadata-0.3.0-py3-none-any.whl:
Publisher:
zarr-metadata-release.yml on zarr-developers/zarr-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zarr_metadata-0.3.0-py3-none-any.whl -
Subject digest:
e6651f418fcc89cc3c6fc11aa852fb6f8dd6f31d62913abc0d4d37ce7302d671 - Sigstore transparency entry: 1870748502
- Sigstore integration time:
-
Permalink:
zarr-developers/zarr-python@4e79f1bca6cb0fb4a1e763ae8b2706a17d0fde7e -
Branch / Tag:
refs/tags/zarr_metadata-v0.3.0 - Owner: https://github.com/zarr-developers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
zarr-metadata-release.yml@4e79f1bca6cb0fb4a1e763ae8b2706a17d0fde7e -
Trigger Event:
push
-
Statement type: