API Reference
Arrays
Zarrs.ZarrsArray — Type
ZarrsArray{T,N} <: DiskArrays.AbstractDiskArray{T,N}A Zarr array backed by the zarrs Rust library. Supports the full AbstractArray interface via DiskArrays.jl, including slicing, broadcasting, and reductions.
Zarrs.zopen — Function
zopen(path::AbstractString; kwargs...) -> ZarrsArray{T,N} or ZarrsGroupOpen an existing Zarr array or group. Auto-detects V2/V3 format.
path is a URL pipeline string:
# Local filesystem
zopen("/tmp/data.zarr")
# HTTP (read-only)
zopen("https://example.com/data.zarr")
# S3 (read/write)
zopen("s3://bucket/data.zarr")
# GCS (read/write)
zopen("gs://bucket/data.zarr")
# Icechunk over S3 (read-only)
zopen("s3://bucket/repo|icechunk://branch.main/")Keyword Arguments
anonymous::Bool=false: Use anonymous credentials for S3/GCS.region::String="": AWS region for S3.endpoint_url::String="": Custom S3 endpoint URL.
zopen(session::Session) -> ZarrsArray or ZarrsGroupOpen the root of an Icechunk session as a Zarr array or group.
Zarrs.zcreate — Function
zcreate(T, dims...; chunks, path, compressor="zstd", compressor_level=3,
fill_value=nothing, zarr_version=3, shard_shape=nothing,
dimension_names=nothing) -> ZarrsArray{T,N}Create a new Zarr array at path with the given element type and dimensions.
zcreate(path::AbstractString, data::AbstractArray; kwargs...) -> ZarrsArrayCreate a new Zarr array at path and write data into it.
Zarrs.zzeros — Function
zzeros(T, dims...; kwargs...) -> ZarrsArrayCreate a new zero-filled Zarr array.
Zarrs.zinfo — Function
zinfo(z::ZarrsArray)Print detailed metadata information about the array.
Groups
Zarrs.ZarrsGroup — Type
ZarrsGroupA Zarr group backed by the zarrs Rust library. Supports hierarchical navigation.
Zarrs.zgroup — Function
zgroup(path::AbstractString; attrs=Dict{String,Any}()) -> ZarrsGroupCreate a new Zarr V3 group at path.
Base.getindex — Method
Base.getindex(g::ZarrsGroup, key::AbstractString)Open a child array or subgroup by name.
Metadata
Zarrs.dimnames — Function
dimnames(z::ZarrsArray{T,N}) -> Union{Nothing, NTuple{N, Union{String, Nothing}}}Return the dimension names of the array, or nothing if unset. Names are returned in Julia column-major order (reversed from Zarr C-order).
Zarrs.get_attributes — Function
get_attributes(z::ZarrsArray) -> Dict{String,Any}Return the array's user attributes as a dictionary.
get_attributes(g::ZarrsGroup) -> Dict{String,Any}Return the group's user attributes as a dictionary.
Zarrs.set_attributes! — Function
set_attributes!(z::ZarrsArray, attrs::Dict)Replace the array's user attributes and persist to storage.
set_attributes!(g::ZarrsGroup, attrs::Dict)Replace the group's user attributes and persist to storage.
Resize
Base.resize! — Method
resize!(z::ZarrsArray, dims...) -> ZarrsArrayResize the array to new dimensions. Existing data within the new bounds is preserved.
Zarrs.Icechunk
The Zarrs.Icechunk submodule provides Icechunk integration. Access with using Zarrs.Icechunk.
Storage Types
Zarrs.Icechunk.S3Storage — Type
S3Storage(; bucket, prefix="", region="", anonymous=false,
endpoint_url="", allow_http=false,
access_key_id="", secret_access_key="", session_token="")Configuration for an Icechunk repository stored on Amazon S3 (or S3-compatible services like MinIO).
Zarrs.Icechunk.GCSStorage — Type
GCSStorage(; bucket, prefix="", credential_type=:from_env, credential_value="")Configuration for an Icechunk repository stored on Google Cloud Storage.
Credential types
:from_env— use application default credentials (default):anonymous— no authentication:service_account_path— path to service account JSON file (pass ascredential_value):service_account_key— service account JSON string (pass ascredential_value):bearer_token— bearer token string (pass ascredential_value)
Zarrs.Icechunk.AzureStorage — Type
AzureStorage(; account, container, prefix="",
credential_type=:from_env, credential_value="")Configuration for an Icechunk repository stored on Azure Blob Storage.
Credential types
:from_env— use credentials from environment (default):access_key— Azure access key (pass ascredential_value):sas_token— SAS token (pass ascredential_value):bearer_token— bearer token (pass ascredential_value)
Zarrs.Icechunk.LocalStorage — Type
LocalStorage(path::AbstractString)Configuration for an Icechunk repository on the local filesystem.
Zarrs.Icechunk.MemoryStorage — Type
MemoryStorage()Configuration for an in-memory Icechunk repository (useful for testing).
Repository & Session
Zarrs.Icechunk.Repository — Type
RepositoryAn Icechunk repository handle. Create with Repository(storage; mode=:open).
Modes
:open— open an existing repository (default):create— create a new repository:open_or_create— open if exists, otherwise create
Examples
using Zarrs.Icechunk
storage = S3Storage(bucket="my-bucket", prefix="my-repo", region="us-west-2")
repo = Repository(storage)
repo = Repository(storage; mode=:create)Zarrs.Icechunk.Session — Type
SessionA session on an Icechunk repository. Created via readonly_session or writable_session. Pass to zopen to access Zarr data.
Examples
using Zarrs.Icechunk
repo = Repository(S3Storage(bucket="b", prefix="p", region="us-west-2"))
session = readonly_session(repo; branch="main")
g = zopen(session)Zarrs.Icechunk.readonly_session — Function
readonly_session(repo::Repository; branch="main", tag=nothing) -> SessionCreate a read-only session on the repository.
Specify either branch (default: "main") or tag to select which version to read.
Zarrs.Icechunk.writable_session — Function
writable_session(repo::Repository, branch::AbstractString="main") -> SessionCreate a writable session on the given branch.
Commit & Changes
Zarrs.Icechunk.commit — Function
commit(session::Session, message::AbstractString) -> StringCommit changes in a writable session. Returns the snapshot ID string.
Zarrs.Icechunk.has_uncommitted_changes — Function
has_uncommitted_changes(session::Session) -> BoolCheck if a session has uncommitted changes.
Branch & Tag Management
Zarrs.Icechunk.list_branches — Function
list_branches(repo::Repository) -> Vector{String}List all branches in the repository.
Zarrs.Icechunk.list_tags — Function
list_tags(repo::Repository) -> Vector{String}List all tags in the repository.
Zarrs.Icechunk.create_branch — Function
create_branch(repo::Repository, name::AbstractString, snapshot_id::AbstractString)Create a new branch pointing at the given snapshot ID.
Zarrs.Icechunk.delete_branch — Function
delete_branch(repo::Repository, name::AbstractString)Delete a branch from the repository.
Zarrs.Icechunk.create_tag — Function
create_tag(repo::Repository, name::AbstractString, snapshot_id::AbstractString)Create a new tag pointing at the given snapshot ID.
Zarrs.Icechunk.delete_tag — Function
delete_tag(repo::Repository, name::AbstractString)Delete a tag from the repository.
Zarrs.Icechunk.lookup_branch — Function
lookup_branch(repo::Repository, name::AbstractString) -> StringLook up the snapshot ID for a branch.
Zarrs.Icechunk.lookup_tag — Function
lookup_tag(repo::Repository, name::AbstractString) -> StringLook up the snapshot ID for a tag.
Storage
Zarrs.create_storage — Function
create_storage(path::AbstractString; kwargs...) -> ZarrsStorageHandleCreate a storage handle from a URL pipeline string.
Supports the URL pipeline syntax where stages are separated by |.
Root schemes (direct access, read/write)
"/path/to/store"or"file:///path"— local filesystem"s3://bucket/prefix"— Amazon S3"gs://bucket/prefix"— Google Cloud Storage"http://..."/"https://..."— HTTP (read-only)
Adapter schemes
"| icechunk:"— Icechunk versioned storage (read-only via pipeline)"| icechunk://branch.main/"— specific branch"| icechunk://tag.v1/"— specific tag
Examples
# Direct access
create_storage("/tmp/data.zarr")
create_storage("s3://bucket/data.zarr")
create_storage("gs://bucket/data.zarr")
create_storage("https://example.com/data.zarr")
# Icechunk over S3
create_storage("s3://bucket/repo|icechunk://branch.main/")
# Icechunk over memory (for testing)
create_storage("memory:|icechunk:")Keyword Arguments
anonymous::Bool=false: Use anonymous credentials for S3/GCS.region::String="": AWS region for S3.endpoint_url::String="": Custom endpoint URL for S3-compatible services.
Zarrs.ZarrsStorageHandle — Type
ZarrsStorageHandleOpaque wrapper around a zarrs storage pointer. Automatically freed on GC.
Zarrs.ZarrsArrayHandle — Type
ZarrsArrayHandleOpaque wrapper around a zarrs array pointer. Holds a reference to its ZarrsStorageHandle to prevent GC of storage while the array is alive.
Zarrs.ZarrsGroupHandle — Type
ZarrsGroupHandleOpaque wrapper around a zarrs group pointer. Holds a reference to its ZarrsStorageHandle to prevent GC of storage while the group is alive.
URL Pipeline
Zarrs.parse_url_pipeline — Function
parse_url_pipeline(s::AbstractString) -> URLPipelineParse a URL pipeline string into its root and adapter components. Supports the | delimiter between pipeline stages.
Supported root schemes
file:///pathor bare filesystem pathss3://bucket/prefixgs://bucket/prefixhttp://.../https://...memory:
Supported adapter schemes
icechunk:with optional authority likeicechunk://branch.main/
Zarrs.URLPipeline — Type
URLPipelineA parsed URL pipeline consisting of a root scheme and zero or more adapter schemes.
Examples
"s3://bucket/prefix" → root only (direct S3)
"s3://bucket/prefix|icechunk://branch.main/" → S3 + Icechunk adapter
"memory:|icechunk:" → memory + Icechunk adapterZarrs.RootScheme — Type
RootSchemeParsed root scheme from a URL pipeline string.
Fields
scheme::Symbol— one of:file,:s3,:gs,:http,:https,:memorybucket::String— bucket/container name (S3, GCS) or emptyprefix::String— path within bucket, or filesystem path, or full URLquery::Dict{String,String}— query parameters (e.g.region,endpoint_url)
Zarrs.AdapterScheme — Type
AdapterSchemeParsed adapter scheme from a URL pipeline string.
Fields
scheme::Symbol— e.g.:icechunkauthority::String— e.g."branch.main","tag.v1"path::String— path component after authorityquery::Dict{String,String}— query parameters
Zarrs.has_adapter — Function
has_adapter(pipeline::URLPipeline, scheme::Symbol) -> BoolCheck if the pipeline contains an adapter with the given scheme.
Zarrs.get_adapter — Function
get_adapter(pipeline::URLPipeline, scheme::Symbol) -> AdapterSchemeGet the first adapter with the given scheme, or error if not found.
Zarrs.parse_icechunk_authority — Function
parse_icechunk_authority(authority::AbstractString) -> Tuple{Symbol, String}Parse an Icechunk authority string like "branch.main" or "tag.v1" into a (type, name) tuple. Returns (:branch, "main") if authority is empty.
Internals
Zarrs.julia_shape — Function
julia_shape(zarrs_shape) -> TupleConvert a C-order shape vector from zarrs to Julia column-major order by reversing.
Zarrs.zarrs_subset — Function
zarrs_subset(indices::NTuple{N,UnitRange{Int}}) -> (starts, shapes)Convert Julia 1-based column-major index ranges to zarrs 0-based C-order starts and shapes.
Zarrs.build_v3_metadata — Function
build_v3_metadata(; T, shape, chunks, ...) -> StringBuild a Zarr V3 metadata JSON string with dimensions reversed for C-order storage.
Zarrs.build_v2_metadata — Function
build_v2_metadata(; T, shape, chunks, ...) -> StringBuild a Zarr V2 metadata JSON string.
Zarrs.numpy_dtype_str — Function
numpy_dtype_str(T::DataType) -> StringReturn the NumPy-style dtype string for Julia type T (for V2 metadata).
Zarrs._try_load_consolidated! — Function
_try_load_consolidated!(storage::ZarrsStorageHandle)Attempt to load consolidated metadata from the store. Tries V3 zarr.json (with inline consolidated_metadata) first, then V2 .zmetadata. Sets storage.consolidated to a Dict if found, nothing if not found or invalid.
Zarrs._flatten_v3_consolidated — Function
_flatten_v3_consolidated(metadata) -> Dict{String,Any}Flatten V3 consolidated metadata (which uses nested path keys mapping to node metadata) into V2-style flat keys for use with _keys_from_consolidated.
V3 consolidated metadata has the form: {"childname" => {"zarrformat" => 3, "node_type" => "array", ...}, ...}
We convert to flat keys like: {"childname/zarr.json" => ..., "childname/nested/zarr.json" => ...}
Zarrs._keys_from_consolidated — Function
_keys_from_consolidated(metadata::Dict, zarr_path::AbstractString) -> Vector{String}Extract direct child names from consolidated metadata for the given zarr path.