skillfed

pydantic-zarr

Pydantic models for the Zarr file format

pydantic-zarr v0.10.0 87.1K downloads/30d#13,816 on PyPI49
Permissive license MIT Active released

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-zarr

uv

uv add pydantic-zarr

poetry

poetry add pydantic-zarr

Installing 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

Programming Language :: PythonProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPython

Tags

pydantic zarr validationzarr array metadata modelszarr group specificationtype-safe zarr handlingzarr schema validation
zarrdata-validationscientific-computing

More Scientific/Engineering packages