simplezarr
A lightweight, async Rust crate for reading Zarr V2 arrays and groups.
Features
- Zarr V2 support -- read arrays and groups stored in the Zarr V2 format
- Async / Tokio -- all I/O is fully async; chunks are fetched concurrently
- Pluggable storage backends -- ships with
LocalBackend(local filesystem viatokio::fs) andObjectStoreBackend(wraps anyobject_storeimplementation for S3, GCS, Azure, etc.) - Consolidated metadata -- transparently reads
.zmetadatawhen available, with fallback to per-array.zarrayfiles - Rich type system -- preserves the full Zarr type hierarchy (bool, int8–int64, uint8–uint64, float16/32/64, complex64/128, string, bytes) without forcing lossy f64 conversion
- Compression codecs -- built-in support for Blosc, Gzip, Zlib, Zstd, and LZ4
- Both C and Fortran array order
Quick start
Add the dependency:
[]
= "0.1"
= { = "1", = ["full"] }
Read a single array
use Arc;
use LocalBackend;
use v2;
async
Read a group of arrays
use Arc;
use LocalBackend;
use v2;
async
Cloud storage via object_store
use Arc;
use ObjectStoreBackend;
use v2;
async
Supported data types
| Zarr dtype | Rust representation |
|---|---|
bool |
bool |
int8 – int64 |
i8 – i64 |
uint8 – uint64 |
u8 – u64 |
float16 |
half::f16 |
float32 / float64 |
f32 / f64 |
complex64 / complex128 |
num_complex::Complex<f32> / Complex<f64> |
| string / bytes | String / Vec<u8> |
Supported compressors
| Compressor | V2 compressor.id |
|---|---|
| Blosc (lz4, lz4hc, blosclz, zstd, snappy, zlib) | blosc |
| Gzip | gzip |
| Zlib | zlib |
| Zstd | zstd |
| LZ4 | lz4 |
Both little-endian and big-endian byte orders are supported.
License
MIT