Pydantic models for the Zarr file format
Project description
pydantic-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_zarr-0.9.2.tar.gz.
File metadata
- Download URL: pydantic_zarr-0.9.2.tar.gz
- Upload date:
- Size: 80.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59f536cbc456ff4dc64d887d651476e2a6a2ca9f3ea13228dce4e3aeb1cf00b9
|
|
| MD5 |
e62be092508772070b0c3e19d7b8a30d
|
|
| BLAKE2b-256 |
6a19ad4f22b7a395408c90cc0f213d70cf5b9ed5f3b0db2b319cacff93b66850
|
File details
Details for the file pydantic_zarr-0.9.2-py3-none-any.whl.
File metadata
- Download URL: pydantic_zarr-0.9.2-py3-none-any.whl
- Upload date:
- Size: 53.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8009b661cdce3e8283c26d281975432841a39fc8af8309f4ff66722e43850c6f
|
|
| MD5 |
de57b1cdbd740578e81acc6492f4228d
|
|
| BLAKE2b-256 |
0ef493a623ab5d2e1c20de0b43e60d6bd8df7704b39e88f5424b4191391a40d9
|