Skip to main content

Pydantic models for the Zarr file format

Project description

pydantic-zarr

PyPI

Pydantic models for Zarr.

Installation

pip install -U pydantic-zarr
# or, with zarr i/o support
pip install -U "pydantic-zarr[zarr]"

Getting help

  • Docs: see the documentation for detailed information about this project.
  • Chat: We use Zulip for project-related chat.

Example

import zarr
from pydantic_zarr import GroupSpec

group = zarr.group(path='foo')
array = zarr.create(store = group.store, path='foo/bar', shape=10, dtype='uint8')
array.attrs.put({'metadata': 'hello'})

# this is a pydantic model
spec = GroupSpec.from_zarr(group)
print(spec.model_dump())
"""
{
    'zarr_format': 2,
    'attributes': {},
    'members': {
        'bar': {
            'zarr_format': 2,
            'attributes': {'metadata': 'hello'},
            'shape': (10,),
            'chunks': (10,),
            'dtype': '|u1',
            'fill_value': 0,
            'order': 'C',
            'filters': None,
            'dimension_separator': '.',
            'compressor': {
                'id': 'blosc',
                'cname': 'lz4',
                'clevel': 5,
                'shuffle': 1,
                'blocksize': 0,
            },
        }
    },
}
"""

History

This project was developed at HHMI / Janelia Research Campus. It was originally written by Davis Bennett to solve problems he encountered while working on the Cellmap Project team. In December of 2024 this project was migrated from the janelia-cellmap github organization to zarr-developers organization.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_zarr-0.10.0.tar.gz (80.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydantic_zarr-0.10.0-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_zarr-0.10.0.tar.gz.

File metadata

  • Download URL: pydantic_zarr-0.10.0.tar.gz
  • Upload date:
  • Size: 80.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydantic_zarr-0.10.0.tar.gz
Algorithm Hash digest
SHA256 996b5b4225fb05757e7fff831ee7a75c61f54514a4c2493c7b79635bade7b415
MD5 e8a93099f82e9aa7d69f3ae8ddcf1c69
BLAKE2b-256 2f57aac9e500abe15719b7406d55871fc8787e7d0ebf83de5f98d44471139f70

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_zarr-0.10.0.tar.gz:

Publisher: cd.yml on zarr-developers/pydantic-zarr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydantic_zarr-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: pydantic_zarr-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 52.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydantic_zarr-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d15769dab43346b070051fdf6e83509d7f55259dd00c6d12be2400935117e230
MD5 e814c64afff57055b9fcfe795fbdb193
BLAKE2b-256 c70504af0ca9c5747c95591a549509ebbb0a986155015de59f1e4c984e3af9ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_zarr-0.10.0-py3-none-any.whl:

Publisher: cd.yml on zarr-developers/pydantic-zarr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page