pydantic-zarr
Pydantic models for the Zarr file format
What it is and what it does
pydantic-zarr bridges Pydantic's validation framework with the Zarr array storage format by providing Pydantic models that represent Zarr groups, arrays, and their metadata. It lets you load a Zarr group into a strongly-typed Pydantic model, validate its structure, and serialize it back to a dictionary or JSON. The package depends on numpy, packaging, and pydantic, and is designed for workflows where you need to inspect, validate, or programmatically construct Zarr hierarchies with confidence in their schema.
The library was originally developed at HHMI Janelia Research Campus to support the Cellmap Project and is now maintained by the Zarr developers organization. It is actively maintained, supports Python 3.12 and later, and carries no known security vulnerabilities.
Use it for:
- Validate Zarr group structure and metadata before processing large scientific datasets
- Programmatically construct and serialize Zarr array specifications with schema validation
- Inspect and document Zarr file hierarchies in a type-safe, IDE-friendly way
- Migrate or transform Zarr metadata between different storage backends or formats
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Pydantic models for reading, validating, and working with Zarr array groups and their metadata in a type-safe way.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. Install it if you work with Zarr arrays and want type-safe, validated access to their metadata and structure; skip it if you do not use Zarr or do not need schema validation.
Install
pydantic-zarr on PyPI
pip
pip install pydantic-zarruv
uv add pydantic-zarrpoetry
poetry add pydantic-zarrInstalling pydantic-zarr
Before you install
Low friction installation with only three runtime dependencies (numpy, packaging, pydantic). The package is actively maintained with a recent release and no known vulnerabilities.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install pydantic-zarr
import zarr
from pydantic_zarr import GroupSpec
group = zarr.group(path='foo')
spec = GroupSpec.from_zarr(group)
print(spec.model_dump())
Requires Python 3.12 or later; optional zarr I/O support available via pip install pydantic-zarr[zarr]
Verify before relying
- Whether the package handles Zarr v3 format or is limited to v2
- Performance characteristics when working with large or deeply nested Zarr groups
- Extent of round-trip fidelity (zarr → model → zarr) for all metadata types
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — numpy, packaging, pydantic |
| Maintenance | actively maintained — 113 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 87,058/month — #13,816 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pydantic_zarr-0.10.0-py3-none-any.whl
Keywords: pydantic, zarr
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
numpydanticNumpydantic adds type annotations and…
permissive · top 15,000 on PyPI
sigstore-modelsProvides Pydantic-based data models that mirror…
unclear · top 15,000 on PyPI
jsonschema-pydanticConverts JSON Schema definitions into Pydantic…
unclear · top 15,000 on PyPI
django-pydantic-fieldProvides type-safe Pydantic model schemas for…
permissive · top 5,000 on PyPI
airbyte-connector-modelsProvides automatically generated Pydantic…
permissive · top 15,000 on PyPI
pydantic-numpyIntegrates NumPy arrays into Pydantic models…
permissive · top 15,000 on PyPI
pydantic-geojsonProvides Pydantic-based type-safe validation…
permissive · top 15,000 on PyPI
openresponses-typesProvides Pydantic models for the OpenResponses…
permissive · top 15,000 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
icechunkIcechunk is a transactional storage engine for…
unclear · top 15,000 on PyPI