Skip to content

Commit 40ab975

Browse files
committed
docs(zarr-metadata): describe the widened package scope
The README tagline, intro, and scope section (and the PyPI description) still presented the package as type definitions only. Restructure them around the two layers plus optional integration, extend the contribution scope to models and structural validation, and state the runtime-behavior boundary explicitly. Assisted-by: ClaudeCode:claude-fable-5
1 parent 3f17dc0 commit 40ab975

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

packages/zarr-metadata/README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
# zarr-metadata
22

3-
Python type definitions for Zarr v2 and v3 metadata.
3+
Python types, models, and validators for Zarr v2 and v3 metadata.
44

55
## What this is
66

7-
A typed-data package: `TypedDict` definitions and `Literal` aliases for the
8-
JSON shapes specified by the [Zarr v2](https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html)
9-
and [Zarr v3](https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html)
10-
specifications, plus types for [`zarr-extensions`](https://github.com/zarr-developers/zarr-extensions/)
11-
and a few widely-used-but-unspecified entities (e.g. consolidated metadata).
12-
It also provides canonical frozen-dataclass models, structural validators,
13-
parsers, store-key serialization, and optional Pydantic field integrations.
14-
The optional integration requires Pydantic 2.13 or newer.
7+
Two layers and an optional integration:
8+
9+
- **Typed JSON shapes**: `TypedDict` definitions and `Literal` aliases for the
10+
JSON documents specified by the [Zarr v2](https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html)
11+
and [Zarr v3](https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html)
12+
specifications, plus types for [`zarr-extensions`](https://github.com/zarr-developers/zarr-extensions/)
13+
and a few widely-used-but-unspecified entities (e.g. consolidated metadata).
14+
- **Document models** (`zarr_metadata.model`): canonical frozen-dataclass
15+
models of whole metadata documents, with structural validators, loc-aware
16+
parsers, and store-key (de)serialization. A document produced by `to_json`
17+
shares no mutable state with the model that produced it.
18+
- **Optional Pydantic integration** (`zarr_metadata.pydantic`, requires
19+
Pydantic 2.13 or newer): each model as a Pydantic field type that validates
20+
raw documents through the same strict parser.
1521

1622
## What this is for
1723

@@ -67,7 +73,14 @@ versus `shape`. Consumers should run the model parser after schema validation.
6773
At minimum, this library supports what Zarr-Python needs: the complete
6874
Zarr v2 and v3 specs, consolidated metadata, and a subset of the metadata
6975
defined in `zarr-extensions`. We are generally open to contributions that
70-
add types for Zarr metadata with a published spec.
76+
add types, models, or structural validation for Zarr metadata with a
77+
published spec.
78+
79+
Runtime array behavior is out of scope: nothing here encodes or decodes
80+
chunks, resolves codec or data type names to implementations, or performs
81+
store I/O. The models begin and end at the metadata documents themselves —
82+
`from_key_value` / `to_key_value` map documents to store keys and bytes,
83+
and everything past that belongs to consumer libraries.
7184

7285
## Releasing
7386

packages/zarr-metadata/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
55
[project]
66
name = "zarr-metadata"
77
dynamic = ["version"]
8-
description = "Spec-defined metadata types for Zarr v2 and v3."
8+
description = "Spec-defined metadata types, models, and validators for Zarr v2 and v3."
99
readme = "README.md"
1010
requires-python = ">=3.11"
1111
license = "MIT"

0 commit comments

Comments
 (0)