Name | pydantic-zarr JSON |
Version |
0.7.0
JSON |
| download |
home_page | None |
Summary | pydantic models for zarr |
upload_time | 2024-03-20 10:42:01 |
maintainer | None |
docs_url | None |
author | Davis Vann Bennett |
requires_python | <4.0,>=3.9 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pydantic-zarr
[![PyPI](https://img.shields.io/pypi/v/pydantic-zarr)](https://pypi.python.org/pypi/pydantic-zarr)
[Pydantic](https://docs.pydantic.dev/1.10/) models for [Zarr](https://zarr.readthedocs.io/en/stable/index.html).
## ⚠️ Disclaimer ⚠️
This project is under a lot of flux -- I want to add [zarr version 3](https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html) support to this project, but the [reference python implementation](https://github.com/zarr-developers/zarr-python) doesn't support version 3 yet. Also, the key ideas in this repo may change in the process of being formalized over in [this specification](https://github.com/zarr-developers/zeps/pull/46) (currently just a draft). As the ecosystem evolves I *will* be breaking things (and versioning the project accordingly), so be advised!
## Installation
`pip install -U pydantic-zarr`
## Help
See the [documentation](https://janelia-cellmap.github.io/pydantic-zarr/) for detailed information about this project.
## Example
```python
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_version': 2,
'attributes': {},
'members': {
'bar': {
'zarr_version': 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,
},
}
},
}
"""
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pydantic-zarr",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Davis Vann Bennett",
"author_email": "davis.v.bennett@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c6/34/a87b287b4b0d3c788c9adc690bfdcec41b3eeaa542f835ee123d04550967/pydantic_zarr-0.7.0.tar.gz",
"platform": null,
"description": "# pydantic-zarr\n\n[![PyPI](https://img.shields.io/pypi/v/pydantic-zarr)](https://pypi.python.org/pypi/pydantic-zarr)\n\n[Pydantic](https://docs.pydantic.dev/1.10/) models for [Zarr](https://zarr.readthedocs.io/en/stable/index.html).\n\n## \u26a0\ufe0f Disclaimer \u26a0\ufe0f\nThis project is under a lot of flux -- I want to add [zarr version 3](https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html) support to this project, but the [reference python implementation](https://github.com/zarr-developers/zarr-python) doesn't support version 3 yet. Also, the key ideas in this repo may change in the process of being formalized over in [this specification](https://github.com/zarr-developers/zeps/pull/46) (currently just a draft). As the ecosystem evolves I *will* be breaking things (and versioning the project accordingly), so be advised!\n\n## Installation\n\n`pip install -U pydantic-zarr`\n\n## Help\n\n\nSee the [documentation](https://janelia-cellmap.github.io/pydantic-zarr/) for detailed information about this project. \n\n\n## Example\n\n```python\nimport zarr\nfrom pydantic_zarr import GroupSpec\n\ngroup = zarr.group(path='foo')\narray = zarr.create(store = group.store, path='foo/bar', shape=10, dtype='uint8')\narray.attrs.put({'metadata': 'hello'})\n\n# this is a pydantic model\nspec = GroupSpec.from_zarr(group)\nprint(spec.model_dump())\n\"\"\"\n{\n 'zarr_version': 2,\n 'attributes': {},\n 'members': {\n 'bar': {\n 'zarr_version': 2,\n 'attributes': {'metadata': 'hello'},\n 'shape': (10,),\n 'chunks': (10,),\n 'dtype': '|u1',\n 'fill_value': 0,\n 'order': 'C',\n 'filters': None,\n 'dimension_separator': '.',\n 'compressor': {\n 'id': 'blosc',\n 'cname': 'lz4',\n 'clevel': 5,\n 'shuffle': 1,\n 'blocksize': 0,\n },\n }\n },\n}\n\"\"\"\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "pydantic models for zarr",
"version": "0.7.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "efc4a21a21e34655052fcf5f5bcfa2d7c8795c6f38bc1aa1ee110754a16d5151",
"md5": "c9e5e421ad8e018e801893d9180aec90",
"sha256": "8fafb481e7dfa77b3202b91937b777b266387d03e9f6dad5b7eaeca3ae4b5baf"
},
"downloads": -1,
"filename": "pydantic_zarr-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c9e5e421ad8e018e801893d9180aec90",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 15714,
"upload_time": "2024-03-20T10:41:59",
"upload_time_iso_8601": "2024-03-20T10:41:59.186694Z",
"url": "https://files.pythonhosted.org/packages/ef/c4/a21a21e34655052fcf5f5bcfa2d7c8795c6f38bc1aa1ee110754a16d5151/pydantic_zarr-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c634a87b287b4b0d3c788c9adc690bfdcec41b3eeaa542f835ee123d04550967",
"md5": "dc369f2592f3c809cd75c28e29309d89",
"sha256": "fdb0129722d5a3454f5107de56ec8370a7dc8ccb3fa34f2729632ed4f8da3acd"
},
"downloads": -1,
"filename": "pydantic_zarr-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "dc369f2592f3c809cd75c28e29309d89",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 14828,
"upload_time": "2024-03-20T10:42:01",
"upload_time_iso_8601": "2024-03-20T10:42:01.880096Z",
"url": "https://files.pythonhosted.org/packages/c6/34/a87b287b4b0d3c788c9adc690bfdcec41b3eeaa542f835ee123d04550967/pydantic_zarr-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-20 10:42:01",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pydantic-zarr"
}