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.5.0.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for pydantic_zarr-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fc9f637b217492d6b9c0b2bddfd7cca9ad3a2050c12feee01ae5f9b86719402 |
|
MD5 | 0d6e113e9cddc3db4a6acb127484e51a |
|
BLAKE2b-256 | 7aa4c31491664c4519d8df340873d13c17a8dff31bd8aeaf6653c27265cab7a6 |