Skip to main content

zarrs-python

PyPI Downloads Downloads Stars CI CD

This project serves as a bridge between zarrs (Rust) and zarr (zarr-python) via PyO3. The main goal of the project is to speed up i/o (see zarr_benchmarks).

To use the project, simply install our package (which depends on zarr-python>=3.0.0), and run:

import zarr
zarr.config.set({"codec_pipeline.path": "zarrs.ZarrsCodecPipeline"})

You can then use your zarr as normal (with some caveats)!

API

We export a ZarrsCodecPipeline class so that zarr-python can use the class but it is not meant to be instantiated and we do not guarantee the stability of its API beyond what is required so that zarr-python can use it. Therefore, it is not documented here.

At the moment, we only support a subset of the zarr-python stores:

A NotImplementedError will be raised if a store is not supported.

Configuration

ZarrsCodecPipeline options are exposed through zarr.config.

Standard zarr.config options control some functionality (see the defaults in the config.py of zarr-python):

  • threading.max_workers: the maximum number of threads used internally by the ZarrsCodecPipeline on the Rust side.
  • array.write_empty_chunks: whether or not to store empty chunks.
    • Defaults to false if None. Note that checking for emptiness has some overhead, see here for more info.

The ZarrsCodecPipeline specific options are:

  • codec_pipeline.chunk_concurrent_maximum: the maximum number of chunks stored/retrieved concurrently.
    • Defaults to the number of logical CPUs if None. It is constrained by threading.max_workers as well.
  • codec_pipeline.chunk_concurrent_minimum: the minimum number of chunks retrieved/stored concurrently when balancing chunk/codec concurrency.
    • Defaults to 4 if None. See here for more info.
  • codec_pipeline.validate_checksums: enable checksum validation (e.g. with the CRC32C codec).
    • Defaults to True. See here for more info.
  • codec_pipeline.direct_io: enable O_DIRECT read/write, needs support from the operating system (currently only Linux) and file system.
    • Defaults to False.
  • codec_pipeline.strict: raise exceptions for unsupported operations instead of falling back to the default codec pipeline of zarr-python.
    • Defaults to False.

For example:

zarr.config.set({
    "threading.max_workers": None,
    "array.write_empty_chunks": False,
    "codec_pipeline": {
        "path": "zarrs.ZarrsCodecPipeline",
        "validate_checksums": True,
        "chunk_concurrent_maximum": None,
        "chunk_concurrent_minimum": 4,
        "direct_io": False,
        "strict": False
    }
})

If the ZarrsCodecPipeline is pickled, and then un-pickled, and during that time one of chunk_concurrent_minimum, chunk_concurrent_maximum, or num_threads has changed, the newly un-pickled version will pick up the new value. However, once a ZarrsCodecPipeline object has been instantiated, these values are then fixed. This may change in the future as guidance from the zarr community becomes clear.

Concurrency

Concurrency can be classified into two types:

  • chunk (outer) concurrency: the number of chunks retrieved/stored concurrently.
    • This is chosen automatically based on various factors, such as the chunk size and codecs.
    • It is constrained between codec_pipeline.chunk_concurrent_minimum and codec_pipeline.chunk_concurrent_maximum for operations involving multiple chunks.
  • codec (inner) concurrency: the number of threads encoding/decoding a chunk.
    • This is chosen automatically in combination with the chunk concurrency.

The product of the chunk and codec concurrency will approximately match threading.max_workers.

Chunk concurrency is typically favored because:

  • parallel encoding/decoding can have a high overhead with some codecs, especially with small chunks, and
  • it is advantageous to retrieve/store multiple chunks concurrently, especially with high latency stores.

zarrs-python will often favor codec concurrency with sharded arrays, as they are well suited to codec concurrency.

Supported Indexing Methods

The following methods will trigger use with the old zarr-python pipeline:

  1. Any oindex or vindex integer np.ndarray indexing with dimensionality >=3 i.e.,

    arr[np.array([...]), :, np.array([...])]
    arr[np.array([...]), np.array([...]), np.array([...])]
    arr[np.array([...]), np.array([...]), np.array([...])] = ...
    arr.oindex[np.array([...]), np.array([...]), np.array([...])] = ...
    
  2. Any vindex or oindex discontinuous integer np.ndarray indexing for writes in 2D

    arr[np.array([0, 5]), :] = ...
    arr.oindex[np.array([0, 5]), :] = ...
    
  3. vindex writes in 2D where both indexers are integer np.ndarray indices i.e.,

    arr[np.array([...]), np.array([...])] = ...
    
  4. Ellipsis indexing. We have tested some, but others fail even with zarr-python's default codec pipeline. Thus for now we advise proceeding with caution here.

    arr[0:10, ..., 0:5]
    

Furthermore, using anything except contiguous (i.e., slices or consecutive integer) np.ndarray for numeric data will fall back to the default zarr-python implementation.

Please file an issue if you believe we have more holes in our coverage than we are aware of or you wish to contribute! For example, we have an issue in zarrs for integer-array indexing that would unblock a lot the use of the rust pipeline for that use-case (very useful for mini-batch training perhaps!).

Further, any codecs not supported by zarrs will also automatically fall back to the python implementation.

Release files for zarrs 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 zarrs 0.2.3
File Size Uploaded
zarrs-0.2.3.tar.gz 64.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for zarrs 0.2.3
File
zarrs-0.2.3-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
zarrs-0.2.3-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
zarrs-0.2.3-cp311-abi3-musllinux_1_2_armv7l.whl CPython 3.11 abi3 Linux musl 1.2+ ARMv7l Details
zarrs-0.2.3-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details
zarrs-0.2.3-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
zarrs-0.2.3-cp311-abi3-manylinux_2_28_ppc64le.whl CPython 3.11 abi3 Linux glibc 2.28+ PowerPC 64-le Details
zarrs-0.2.3-cp311-abi3-manylinux_2_28_armv7l.whl CPython 3.11 abi3 Linux glibc 2.28+ ARMv7l Details
zarrs-0.2.3-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
zarrs-0.2.3-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
zarrs-0.2.3-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 81.0 MB

Release files / zarrs-0.2.3.tar.gz

Download URL zarrs-0.2.3.tar.gz
Size 64.8 kB
Tags Source
SHA-256 checksum
How to use checksums
61640dbbffb9a0b0ebd73f970ce97b52ef56df2828c2809058016d76da59ee60
BLAKE2b-256 checksum
How to use checksums
f9b39e088d4ab5c971e5d2b52cd4d58e3acce35acb3e131990fdc28b69366233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-win_amd64.whl

Download URL zarrs-0.2.3-cp311-abi3-win_amd64.whl
Size 5.9 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
72eb1f5c4ca8382cb9e38dd98a48a0e484170d703152110f32a39520c7fa570d
BLAKE2b-256 checksum
How to use checksums
7fc1be4e37d80a95347334c287cbb42d94c6181d447f1624c0c5354f593e1fda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL zarrs-0.2.3-cp311-abi3-musllinux_1_2_x86_64.whl
Size 13.0 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
437dd4fcf74607480361f401f15b47416aa69f0ff4379c4ea330c453b7e05098
BLAKE2b-256 checksum
How to use checksums
6c90ca544236092ab4803d1c3c88ac7b143885e280a63954d454d60885784af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-musllinux_1_2_armv7l.whl

Download URL zarrs-0.2.3-cp311-abi3-musllinux_1_2_armv7l.whl
Size 12.2 MB
Tags CPython 3.11 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
991556a7589e93bc5445da2b97e0c89d7d871e539b9ef28dae857b8573c65f5c
BLAKE2b-256 checksum
How to use checksums
e3857ad323d428540ca7add343ade347841d181e4e3d73a69f39e34e447f0acc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL zarrs-0.2.3-cp311-abi3-musllinux_1_2_aarch64.whl
Size 12.5 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
9db202e95c3b5c9116afdfebf9912e1faa5ab60e6a1982e0406953cdb47bec38
BLAKE2b-256 checksum
How to use checksums
a96a7a4230676bd66c0181b4e9000bec30deee1b1695557e5d245514f0454103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL zarrs-0.2.3-cp311-abi3-manylinux_2_28_x86_64.whl
Size 6.5 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
ab4074056f01f3292c89cd769e8c0db92c0df076e3d36665eec7fc557a62a2ed
BLAKE2b-256 checksum
How to use checksums
c5fa471e2511b0c77419ac2228ce72770e94e994ab99c6b9275cb3de1dcead2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-manylinux_2_28_ppc64le.whl

Download URL zarrs-0.2.3-cp311-abi3-manylinux_2_28_ppc64le.whl
Size 6.7 MB
Tags CPython 3.11 Linux glibc 2.28+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
1d387b75a19c31795cb2a81ef973c905c2c04ca3b1a4cca4bc84c81050974827
BLAKE2b-256 checksum
How to use checksums
3fc10aba516796af22be08e82e37ded59f46cc7ffabf6932957455fccb9c6109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-manylinux_2_28_armv7l.whl

Download URL zarrs-0.2.3-cp311-abi3-manylinux_2_28_armv7l.whl
Size 6.0 MB
Tags CPython 3.11 Linux glibc 2.28+ ARMv7l abi3
SHA-256 checksum
How to use checksums
59a29dfdea088bb25c1e9b5107cbb8de15c8d571d51484ff128cd526c40521b9
BLAKE2b-256 checksum
How to use checksums
59a928b91493c7db9f3db191a1bc396cd2e212559536f2bc7325e5d5cdbb8b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL zarrs-0.2.3-cp311-abi3-manylinux_2_28_aarch64.whl
Size 6.1 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
19b194f80139b838bb4bf18ed6ef93ecb1904717a04695fbc50cdc0c6074f282
BLAKE2b-256 checksum
How to use checksums
566327f9f7784006a900ffaa3d62d5c4d0dde98821683cd298cad79f66aa25c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-macosx_11_0_arm64.whl

Download URL zarrs-0.2.3-cp311-abi3-macosx_11_0_arm64.whl
Size 5.8 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e6998bf1a61cd7c4afd3c263130317c1001599b37ff6f27082cc900a0ad48baa
BLAKE2b-256 checksum
How to use checksums
80ad8a8525a72190db2c8d6807c69695ef0ea959fd50a4ac887af80803ff5487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release files / zarrs-0.2.3-cp311-abi3-macosx_10_12_x86_64.whl

Download URL zarrs-0.2.3-cp311-abi3-macosx_10_12_x86_64.whl
Size 6.3 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b9470b17629961badf4261fb0d26ad5fcbe316b63c1b00fb0489a51c3f8ef157
BLAKE2b-256 checksum
How to use checksums
4ac0e10e618293351247e948527c0d2b4c3d8fa9f7478e9f8e945755fc47ecdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

11 release files

0.2.1

11 release files

0.2.0

12 release files

0.1.4

12 release files

0.1.3

12 release files

0.1.2

12 release files

0.1.1

12 release files

0.1.0

13 release files

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