pydantic models for zarr
Project description
pydantic-zarr
Installation
pip install -U pydantic-zarr
Help
See the documentation for detailed information about this project.
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.dict())
"""
{
'zarr_version': 2,
'attrs': {},
'items': {
'bar': {
'zarr_version': 2,
'attrs': {'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,
},
}
},
}
"""
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
pydantic_zarr-0.4.0.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for pydantic_zarr-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec34f0273196c3b83db14c67ecc6e01ea754ed577304b257cf2a4a9eb4431df0 |
|
MD5 | 1b18a5da3628ae12809b5b9dab46c9de |
|
BLAKE2b-256 | 7449279a7e786aae69afd8aa1ff93d8db31141dd5856ef2f77ceb7a18117be8a |