# zarr_checksum
Algorithms for calculating a zarr checksum against local or cloud storage
# Install
```
pip install zarr-checksum
```
# Usage
## CLI
To calculate the checksum for a local zarr archive
```
zarrsum local <directory>
```
To calculate the checksum for a remote (S3) zarr archive
```
zarrsum remote s3://your_bucket/prefix_to_zarr
```
## Python
To calculate the checksum for a local zarr archive
```python
from zarr_checksum import compute_zarr_checksum
from zarr_checksum.generators import yield_files_local, yield_files_s3
# Local
checksum = compute_zarr_checksum(yield_files_local("local_path"))
# Remote
checksum = compute_zarr_checksum(
yield_files_s3(
bucket="your_bucket",
prefix="prefix_to_zarr",
# Credentials can also be passed via environment variables
credentials={
aws_access_key_id: "youraccesskey",
aws_secret_access_key: "yoursecretkey",
region_name: "us-east-1",
}
)
)
```
Access checksum information
```python
>>> checksum.digest
'c228464f432c4376f0de6ddaea32650c-37481--38757151179'
>>> checksum.md5
'c228464f432c4376f0de6ddaea32650c'
>>> checksum.count
37481
>>> checksum.size
38757151179
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dandi/zarr_checksum",
"name": "zarr-checksum",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Kitware, Inc.",
"author_email": "kitware@kitware.com",
"download_url": "https://files.pythonhosted.org/packages/a9/32/9019e98f45d33b37d48a49c60f2c9cf7a8822016e76c38880e24e1633f5f/zarr_checksum-0.4.2.tar.gz",
"platform": null,
"description": "# zarr_checksum\nAlgorithms for calculating a zarr checksum against local or cloud storage\n\n# Install\n```\npip install zarr-checksum\n```\n\n# Usage\n\n## CLI\nTo calculate the checksum for a local zarr archive\n```\nzarrsum local <directory>\n```\n\nTo calculate the checksum for a remote (S3) zarr archive\n```\nzarrsum remote s3://your_bucket/prefix_to_zarr\n```\n\n## Python\nTo calculate the checksum for a local zarr archive\n```python\nfrom zarr_checksum import compute_zarr_checksum\nfrom zarr_checksum.generators import yield_files_local, yield_files_s3\n\n# Local\nchecksum = compute_zarr_checksum(yield_files_local(\"local_path\"))\n\n# Remote\nchecksum = compute_zarr_checksum(\n yield_files_s3(\n bucket=\"your_bucket\",\n prefix=\"prefix_to_zarr\",\n # Credentials can also be passed via environment variables\n credentials={\n aws_access_key_id: \"youraccesskey\",\n aws_secret_access_key: \"yoursecretkey\",\n region_name: \"us-east-1\",\n }\n )\n)\n```\n\nAccess checksum information\n```python\n>>> checksum.digest\n'c228464f432c4376f0de6ddaea32650c-37481--38757151179'\n>>> checksum.md5\n'c228464f432c4376f0de6ddaea32650c'\n>>> checksum.count\n37481\n>>> checksum.size\n38757151179\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Checksum support for zarrs stored in various backends",
"version": "0.4.2",
"project_urls": {
"Homepage": "https://github.com/dandi/zarr_checksum",
"Repository": "https://github.com/dandi/zarr_checksum"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "952a606eac97dd4b76e2c19c93808b0f94563a97985fe6e0350404c9c1af8c3b",
"md5": "048ad57acfc291e2cf3136638a2b9d03",
"sha256": "9a060b62f4b52f1402d9a038295f3f09c69137501d2a8db8f111bf0fa88fbdcd"
},
"downloads": -1,
"filename": "zarr_checksum-0.4.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "048ad57acfc291e2cf3136638a2b9d03",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 14190,
"upload_time": "2024-07-22T18:42:11",
"upload_time_iso_8601": "2024-07-22T18:42:11.580287Z",
"url": "https://files.pythonhosted.org/packages/95/2a/606eac97dd4b76e2c19c93808b0f94563a97985fe6e0350404c9c1af8c3b/zarr_checksum-0.4.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a9329019e98f45d33b37d48a49c60f2c9cf7a8822016e76c38880e24e1633f5f",
"md5": "8ec7e54a377d0e43acb516ad02ad8d4d",
"sha256": "ab283e0aa1e39f8e8db5c89ce1cb2eea1daf3d6f1db29cd2a167d0ca5bc4e230"
},
"downloads": -1,
"filename": "zarr_checksum-0.4.2.tar.gz",
"has_sig": false,
"md5_digest": "8ec7e54a377d0e43acb516ad02ad8d4d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 11683,
"upload_time": "2024-07-22T18:42:12",
"upload_time_iso_8601": "2024-07-22T18:42:12.938604Z",
"url": "https://files.pythonhosted.org/packages/a9/32/9019e98f45d33b37d48a49c60f2c9cf7a8822016e76c38880e24e1633f5f/zarr_checksum-0.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-22 18:42:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dandi",
"github_project": "zarr_checksum",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "zarr-checksum"
}