This repo contains a Python implementation for the cast_value codec for Zarr
V3. The spec for that codec is
here.
The relevant section of the Zarr V3 spec is
here.
Be advised that the Zarr V3 spec describes an API but that API is NOT NORMATIVE
and should be ignored as needed.
- Use a functional, declarative style with simple data structures and functions that transform them.
TypedDicts are preferred over classes.- Functions are preferred over methods.
- Accurate type annotations for everything.
- Never use the
Anytype. Always look for a more accurate alternative, likeobject.
This repo has two main parts:
- One or more implementations of the
cast_valuecodec. This follows an internal API defined in this library. - One or more implementations of a
Codecclass compatible with the Zarr-Python codec API. The Zarr-Python codec API is likely to change in the future so the Zarr-Python compatibility layer needs to be robustly versioned.
- Every parameter of every function must have a test.
- Use
@pytest.mark.parametrizeover pytest classes. - Every test must have a docstring that explains what it tests.
uv run <script>
uv sync --group test
uv run pytest tests