Skip to content
Skills Library
Data & analytics · Building & coding

alterlab-zarr

/alterlab-zarr

Chunked, compressed N-dimensional arrays for cloud storage with Zarr — parallel I/O, S3/GCS integration, and NumPy/Dask/Xarray compatibility. Use when storing or reading large N-D scientific arrays, streaming chunked data to/from cloud object stores, or building large-scale scientific computing pipelines. Part of the AlterLab Academic Skills suite.

Licence
MIT
Last repository change
23.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
8
Scripts
0
HTML comments
0
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 23.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Chunked, compressed N-dimensional arrays for cloud storage with Zarr — parallel I/O, S3/GCS integration, and NumPy/Dask/Xarray compatibility. Use when storing or reading large N-D scientific arrays, streaming chunked data to/from cloud object stores, or building large-scale scientific computing pipelines. Part of the AlterLab Academic Skills suite.

Original author description

Chunked, compressed N-dimensional arrays for cloud storage with Zarr — parallel I/O, S3/GCS integration, and NumPy/Dask/Xarray compatibility. Use when storing or reading large N-D scientific arrays, streaming chunked data to/from cloud object stores, or building large-scale scientific computing pipelines. Part of the AlterLab Academic Skills suite.

How it works

  1. Overview
  2. When to Use This Skill
  3. Quick Start
  4. Core Workflow
  5. Routing — where to look
  6. Additional Resources
Original SKILL.md headings · 99 lines, 605 words
SKILL.md preview
---
name: alterlab-zarr
description: Chunked, compressed N-dimensional arrays for cloud storage with Zarr — parallel I/O, S3/GCS integration, and NumPy/Dask/Xarray compatibility. Use when storing or reading large N-D scientific arrays, streaming chunked data to/from cloud object stores, or building large-scale scientific computing pipelines. Part of the AlterLab Academic Skills suite.
license: MIT
allowed-tools: Read Write Edit Bash(python:*) Bash(uv:*)
compatibility: No API key required. Runs locally via `uv run python`; requires zarr >= 3 (current 3.4 as of 2026-09; zarr >= 3.2 needs Python >= 3.12 and NumPy >= 2). Cloud credentials only needed for S3/GCS object stores.
metadata:
    skill-author: AlterLab
    version: "1.1.0"
    last_updated: "2026-09-23"
---

# Zarr Python

## Overview

Zarr is a Python library for storing large N-dimensional arrays with chunking and compression. Apply this skill for efficient parallel I/O, cloud-native workflows, and seamless integration with NumPy, Dask, and Xarray. The guidance targets zarr-python 3.x (current 3.4.0), which writes the Zarr v3 format by default.

## When to Use This Skill

Use this skill when the user wants to:
- Create, open, or write chunked and compressed N-D arrays (`zarr.create_array`, groups, attributes).
- Choose chunk shapes, sharding, and codecs (Zstandard, Blosc, Gzip) for an access pattern.
- Put arrays on S3/GCS or other object stores and read slices remotely (consolidated metadata, sharding).
- Convert HDF5/NumPy/NetCDF data to Zarr, or migrate Zarr v2-era code (`compressor=`, `synchronizer=`, `create_dataset`) to v3.

### Does NOT Trigger

| Scenario | Use Instead |
|----------|-------------|
| Parallel or distributed computation over arrays already stored in Zarr (scheduling, out-of-core math) | `alterlab-dask` |
| Exploring an unknown data file and writing a structure/quality report | `alterlab-eda` |
| Single-cell AnnData objects stored as `.h5ad` or AnnData-on-zarr | `alterlab-anndata` |
| Tabular analytics on large CSV/Parquet files | `alterlab-polars` |

## Quick Start

### Installation

```bash
uv pip install zarr
```

Zarr v3 (`zarr>=3`); zarr 3.2+ requires Python 3.12+ and NumPy 2 (the 3.1.x line still supports
Python 3.11). For cloud storage support, install the matching fsspec backend:
```bash
uv pip install s3fs   # For S3
uv pip install gcsfs  # For Google Cloud Storage
```

### Basic Array Creation

```python
import zarr
import numpy as np

# Create a 2D array with chunking and compression
z = zarr.create_array(
    store="data/my_array.zarr",
    shape=(10000, 10000),
    chunks=(1000, 1000),
    dtype="f4"
)

# Write data using NumPy-style indexing
z[:, :] = np.random.random((10000, 10000))

# Read data
data = z[0:100, 0:100]  # Returns NumPy array
```

## Core Workflow

1. **Create or open** an array/group, picking a store appropriate to the environment (local, in-memory, ZIP, S3/GCS).
2. **Choose chunking** aligned to your access pattern (aim for 1-10 MB chunks; rows-first → chunks span columns, and vice versa). This is the single biggest performance lever.
3. **Pick compression** via `compressors=` based on workload — Zstandard (the default), Blosc+LZ4 (fast), Gzip (max ratio); `compressors=None` to disable. Pass Blosc options as strings (`shuffle="shuffle"`, `cname="zstd"`); the `BloscShuffle`/`BloscCname` enums are deprecated since 3.1.
4. **Read/write** with NumPy-style indexing; resize/append as data grows.
5. **Scale out** with Dask (lazy, out-of-core, parallel) or label with Xarray for climate/geospatial data.
6. **For cloud and many-array stores**, consolidate metadata and consider sharding to cut object/file count. Consolidated metadata is a zarr-python convention, not yet part of the v3 spec (zarr warns), so other readers may ignore it.

```python
# Minimal end-to-end
import zarr, numpy as np
z = zarr.create_array(store="data/my_array.zarr", shape=(10000, 10000),
                      chunks=(1000, 1000), dtype="f4")
z[:, :] = np.random.random((10000, 10000))
sub = z[0:100, 0:100]            # returns a NumPy array
```

## Routing — where to look

| You need… | Go to |
|-----------|-------|
| Array create/open, read/write, resize/append, attributes, groups & hierarchies, consolidated metadata | `references/array_operations.md` |
| Chunk-size guidelines, aligning chunks to access patterns, sharding, compression codecs & tips | `references/chunking_compression.md` |
| Local / in-memory / ZIP / S3 / GCS stores and cloud best practices | `references/storage_backends.md` |
| NumPy / Dask / Xarray integration, thread- and process-safe parallel writes | `references/integration.md` |
| Performance checklist, profiling, common patterns (time series, large matrices, cloud-native, format conversion), troubleshooting | `references/patterns_performance.md` |
| Full API surface | `references/api_reference.md` |

## Additional Resources

- **Official Documentation**: https://zarr.readthedocs.io/
- **Zarr Specifications**: https://zarr-specs.readthedocs.io/
- **GitHub Repository**: https://github.com/zarr-developers/zarr-python
- **Related**: Xarray (labeled arrays), Dask (parallel computing), NumCodecs (compression codecs)

Part of the AlterLab Academic Skills suite.

Files in this package (8)
  • SKILL.md 5 KB
  • evals/evals.json 5 KB
  • references/api_reference.md 14 KB
  • references/array_operations.md 5 KB
  • references/chunking_compression.md 4 KB
  • references/integration.md 3 KB
  • references/patterns_performance.md 5 KB
  • references/storage_backends.md 3 KB

Versions

The database has no other skills named alterlab-zarr.

Database snapshot: 13.11.2026 · package version 3f299715ba3a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100zarr-python
    Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3/GCS storage, and NumPy/Dask/Xarray integration. Use for array layout, bounded I/O, format migration, or scientific metadata preservation.
  • 95zarr-xarray-integration
    Integrates Zarr with xarray and Dask for labeled, multi-dimensional scientific data workflows. Covers reading and writing Zarr stores with xarray, append and region-write operations, multi-file virtual datasets, Dask chunk alignment with Zarr chunks, encoding configuration,…
  • 100xarray-for-multidimensional-data
    Use when the user asks about Xarray, xarray datasets, NetCDF files, multidimensional labeled arrays, or scientific/climate data analysis in Python. Work with labeled multidimensional arrays for scientific data analysis using Xarray. Covers NetCDF/HDF5/Zarr I/O, Dask integration…
  • 100alterlab-dask
    Scales pandas/NumPy workflows beyond memory with Dask distributed computing — parallel DataFrames, arrays, delayed task graphs, and cluster execution. Use when existing pandas/NumPy code must run on larger-than-RAM data or across clusters, for parallel file processing,…
  • 100geozarr
    GeoZarr conventions for geospatial Zarr stores: CF grid_mapping, coordinate arrays, Zarr v2/v3 dimension declarations, multiscales, proj:/spatial: namespaces, and xarray/rioxarray/GDAL interop. Use when authoring, patching, validating, or ingesting Zarr stores intended to…
  • 100xarray
    N-dimensional labeled arrays for geoscience data. Read/write NetCDF, work with climate and oceanographic datasets, perform multi-dimensional analysis with labeled coordinates. Use when the agent needs to: (1) Read/write NetCDF or Zarr files, (2) Work with multidimensional arrays…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.