zarr-python

Create and manage chunked, compressed N-dimensional arrays with Zarr-Python 3 for cloud and local storage.

46.6k|4.2k|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/K-Dense-AI/claude-scientific-skills --skill zarr-python-k-dense-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: zarr-python
Source: https://github.com/K-Dense-AI/claude-scientific-skills/tree/main/skills/zarr-python
Command: npx skills add https://github.com/K-Dense-AI/claude-scientific-skills --skill zarr-python-k-dense-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires zarr, numpy, s3fs, gcsfs, dask, xarray, and includes references (resource) components.

What problem does it solve? Storing and processing large N-dimensional scientific arrays that exceed memory or require cloud-native access is difficult with plain NumPy files. This Skill guides the use of Zarr-Python 3 to create chunked, compressed arrays with parallel I/O on local disk, S3, or GCS. ## Core Features & Use Cases - Chunked Array Storage: Create arrays with configurable chunk shapes, sharding, and Blosc/Zstd/Gzip compression tuned to access patterns. - Cloud-Native I/O: Read and write arrays on S3 or GCS via fsspec URIs and FsspecStore, with consolidated metadata to reduce latency. - Ecosystem Integration: Work seamlessly with NumPy, Dask for out-of-core parallel computation, and Xarray for labeled multidimensional datasets. - Use Case: A climate researcher stores daily global temperature grids (365 x 720 x 1440) as a Zarr group on S3, appends new time steps, and computes regional means in parallel with Dask without loading the full dataset into memory. ## Quick Start Use the zarr-python skill to create a chunked, compressed Zarr array from my NumPy data and store it on S3.

Frequently Asked Questions about zarr-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a chunked Zarr array in Python?▼

Use zarr.create_array with a store path, shape, chunks tuple, and dtype, for example zarr.create_array(store="data.zarr", shape=(10000, 10000), chunks=(1000, 1000), dtype="f4"). Convenience functions like zarr.zeros, zarr.ones, and zarr.array also accept chunk and store arguments.

How do I store Zarr arrays on S3 or GCS?▼

Pass an fsspec URI such as s3://bucket/path.zarr directly to zarr.open_group or zarr.create_array with storage_options, or build an explicit FsspecStore.from_url. Install zarr[remote] plus pinned s3fs or gcsfs, and prefer IAM roles or workload identity for credentials.

Does Zarr-Python 3 work with Dask and Xarray?▼

Yes. Dask loads Zarr arrays lazily with da.from_zarr for parallel out-of-core computation, and Xarray opens Zarr stores with xr.open_zarr for labeled multidimensional datasets. Both can write results back with to_zarr.

What changed in Zarr-Python 3 versus version 2?▼

Zarr 3 defaults to the Zarr format 3 on-disk spec, requires Python 3.12+, moves stores to zarr.storage (LocalStore, FsspecStore), replaces create_dataset with create_array, and uses zarr.codecs instead of numcodecs for v3 arrays. Synchronizers and several legacy stores were removed.

Why is my Zarr array read performance slow?▼

Slow reads usually come from chunk shapes misaligned with the access pattern or chunks that are too small. Aim for 1-10 MB chunks aligned with how you slice the data, use consolidated metadata on cloud stores, and consider sharding when arrays have millions of small chunks.

When should I use sharding in Zarr?▼

Use sharding when an array would produce millions of small chunk files, which causes filesystem overhead and excessive cloud object requests. Shards group many chunks into larger storage objects, though entire shards must fit in memory before writing.