Skip to main content

AnniZarr

CI PyPI docs

Convert to, append, sort anndata zarr storages efficiently with parallel and out of memory operations for all commands and api usage. Also, enable versioned anndata storage with Icechunk ease of use.

Install

the icechunk additional dependencies include gcs, s3 read/writing alongside icechunk usage.

pip install annizarr
pip install "annizarr[icechunk]"

Quickstart usage

Convert

The input format is sniffed from the HDF5 contents (h5ad vs 10x); --from h5ad|10x overrides it. Configuration can enable chunking, sharding, format ... Two or more inputs are concatenated. --ic writes an Icechunk repository instead of plain zarr.

annizarr convert sample.h5ad -o sample.zarr

annizarr convert a.h5ad b.h5ad -o merged.zarr
annizarr convert sample.h5ad -o repo.icechunk --ic -m "initial import"

Zarr operations and edits

rechunk rewrites one matrix with new chunking and streams everything else through unchanged.
sort physically orders rows by obs column(s) into a new store.
append adds cells to an existing zarr/ic store; it prompts before dropping obsm/obsp/layers (--drop-derived consents up front)
add-expr adds a log-normalized layer (layers/gexp) derived from X/. Csc by default for fast column reads

annizarr rechunk merged.zarr -o rechunked.zarr --row-chunk 2000

annizarr sort merged.zarr -o sorted.zarr --by cell_type
annizarr append sorted.zarr more_cells.zarr --drop-derived

annizarr add-expr merged.zarr --layout csr
annizarr add-expr repo.icechunk --layout csr --branch dev -m "add lognorm layer"

Icechunk history, branches, cherry-picks live in the Python API annizarr.Repo below

Python API for Icechunk usage

The full Python API, including the config dataclasses and the ops functions, is in the Python API page.

import annizarr as az

repo = az.Repo("repo.icechunk")

repo.branches()
repo.log()
repo.tree()

root = repo.open_zarr("w")
root.attrs["step"] = "lognorm"
repo.commit("normalize")

repo.checkout("experiment", create=True)  # switches this object only; nothing is persisted
old = repo.open_zarr("r", snapshot_id=repo.log()[1].id)

repo.copy("/work/store")  # clone with every branch and snapshot id intact, good for readonly cases

OpResult(path, n_obs, n_vars, snapshot_id) — snapshot_id is None for plain zarr, the committed Icechunk snapshot id otherwise.

Configuration and zarr stores

Every flag is documented in annizarr <command> --help; the CLI reference has the same text in one place, and each operation has its own page in the documentation. Inputs stream band by band by default, so memory stays bounded at any store size (--eager loads the whole input first, faster for small files), and matrix writes use every core unless --cpus says otherwise.

Some of the main options; the docs have all of them:

  • --cpus N — parallel band workers (default: all cores). Every command.
  • --layout csr|csc|dense — on-disk layout of the matrix being written. Default csr for X on convert, csc for the add-expr layer. CSR suits row-wise access, CSC and dense column queries.
  • --row-chunk N, --col-chunk N — chunk shape. Exact rows and columns for dense; for sparse, about N cells (csr) or N genes (csc) per chunk, sized from the average nonzeros. Defaults: 2048 for dense, about 9,000,000 nonzeros for sparse. convert, rechunk, add-expr.
  • --auto-shard — shard the 1-D sparse arrays and anndata-written elements with zarr's automatic shard shape (default: off). Every command but append.
  • --ic — write through an Icechunk repository; --branch B and -m MSG pick the branch and commit message. append and add-expr detect an existing repo on their own. convert, rechunk, sort.
  • --sort-by COL… on convert / --by COL… on sort — physically order rows by obs columns, primary key first

What gets written. Every store is anndata-readable zarr v3 with encoding-type/encoding-version attrs matching anndata's on-disk spec (anndata 0.12.7 or newer reads them). X and layers may be dense, CSR or CSC on input (h5ad or 10x, mixed across inputs) and are written in whatever --layout asks for; X defaults to CSR. convert/rechunk/sort write to a sibling temp store, verify it opens, then rename it onto the target, so a killed run never leaves a partial store. On Icechunk every op is exactly one commit, and remote (s3://, gs://) outputs require it. More in What annizarr writes.

Development

python -m venv .venv && source .venv/bin/activate
pip install -e ".[icechunk,dev,docs]"
pytest                                  # excludes -m slow by default
pytest -m slow --no-cov                 # large synthetic-store memory-ceiling test
ruff check src tests docs && ruff format --check src tests docs
mypy --strict src/annizarr
mkdocs serve                            # the documentation site, live at http://127.0.0.1:8000

Golden stores for regression tests live in tests/golden/.

License

MIT — see LICENSE.

Metadata

Release files for annizarr 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for annizarr 0.2.3
File Size Uploaded Provenance Actions
annizarr-0.2.3.tar.gz 382.4 kB With provenance Details for annizarr-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for annizarr 0.2.3
File Interpreter ABI Platform Actions
annizarr-0.2.3-py3-none-any.whl Python 3 none any Details for annizarr-0.2.3-py3-none-any.whl

Total release size: 481.0 kB

Release files / annizarr-0.2.3.tar.gz

Download URL annizarr-0.2.3.tar.gz
Size 382.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3ce5b80287202c394f7df1b6ad9756b42cbdabad7a2c944d49026df5ac1dc988
BLAKE2b-256 checksum
How to use checksums
21551297a96303ff31ea135b0088af50cb9b852917ba8e29cd9433c57732e555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / annizarr-0.2.3-py3-none-any.whl

Download URL annizarr-0.2.3-py3-none-any.whl
Size 98.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b502cb8d56e4f895a638ab905fd79d124f77ba322ed689651f221b24f446d680
BLAKE2b-256 checksum
How to use checksums
6fd4681e4b837427bf5afe8ff6e0c41ce7c352a0cf23c1ee618700975b208e34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for annizarr 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for annizarr-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page