Skip to content

API reference ​

Arrays ​

ZarrCore.zcreate Function
julia
zcreate(T, dims...;kwargs)

Creates a new empty zarr array with element type T and array dimensions dims. The following keyword arguments are accepted:

  • path="" directory name to store a persistent array. If left empty, an in-memory array will be created

  • name="" name of the zarr array, defaults to the directory name

  • zarr_format=ZarrCore.ZarrFormat{2}(Val{2}()) Zarr format version (2 or 3)

  • storagetype determines the storage to use, current options are DirectoryStore or DictStore

  • chunks=dims size of the individual array chunks, must be a tuple of length length(dims)

  • fill_value=nothing value to represent missing values

  • fill_as_missing=false set to true shall fillvalue s be converted to missings

  • filters=filters to be applied

  • compressor compressor type and properties, defaulting to default_compressor()

  • attrs=Dict() a dict containing key-value pairs with metadata attributes associated to the array

  • writeable=true determines if the array is opened in read-only or write mode

  • indent_json=false determines if indents are added to format the json files .zarray and .zattrs. This makes them more readable, but increases file size.

  • dimension_separator='.' sets how chunks are encoded. The Zarr v2 default is '.' such that the first 3D chunk would be 0.0.0. The Zarr v3 default is /.

source

Create a new subarray of the group g

source
ZarrCore.zzeros Function
julia
zzeros(T, dims...; kwargs... )

Creates a zarr array and initializes all values with zero. Accepts the same keyword arguments as zcreate

source

Group hierarchy ​

ZarrCore.zcreate Method

Create a new subarray of the group g

source
ZarrCore.zgroup Function
julia
zgroup(s::AbstractStore; attrs=Dict())

Create a new zgroup in the store s

source
ZarrCore.zgroup Method

Create a subgroup of the group g

source
ZarrCore.zopen Function
julia
zopen(s::AbstractStore, mode="r"; consolidated = false, path = "")

Opens a zarr Array or Group at Store s. If consolidated is set to "true", Zarr will search for a consolidated metadata field as created by the python zarr consolidate_metadata function. This can substantially speed up metadata parsing of large zarr groups. The expected zarr version can be supplied through zarr_format and defaults to :auto which tries to detect if the zarr version is v2 or v3.

source
ZarrCore.zopen Function
julia
zopen(p::String, mode="r")

Open a zarr Array or group at disc path p.

source
ZarrCore.zopen_noerr Method
julia
zopen_noerr(AbstractStore, mode = "r"; consolidated = false)

Works like zopen with the single difference that no error is thrown when the path or store does not point to a valid zarr array or group, but nothing is returned instead.

source

Compressors ​

The compressor interface and NoCompressor live in ZarrCore; every concrete compressor lives in its own subpackage alongside the matching Zarr v3 codec.

ZarrCore.NoCompressor Type
julia
NoCompressor()

Creates an object that can be passed to ZArray constructors without compression.

source
ZarrCore.default_compressor Method
julia
default_compressor()

Return the compressor used when none is specified. Bare ZarrCore returns NoCompressor; compressor packages may provide a zero-argument method.

source
ZarrCore.v2_to_v3_codecs Method
julia
v2_to_v3_codecs(compressor, typesize::Int)

Return the v3 codec tuple equivalent to a v2 compressor. typesize is the element size in bytes. Unsupported compressor types throw ArgumentError.

source
ZarrBlosc.ZarrBlosc Module
julia
ZarrBlosc

Blosc v2 compressor and v3 codec support.

source
ZarrBlosc.BloscCompressor Method
julia
BloscCompressor(;blocksize=0, clevel=5, cname="lz4", shuffle=1)

Returns a BloscCompressor struct that can serve as a Zarr array compressor. Keyword arguments are:

  • clevel=5 the compression level, number between 0 (no compression) and 9 (max compression)

  • cname="lz4" compressor name, can be one of "blosclz", "lz4", and "lz4hc"

  • shuffle=1 Either NOSHUFFLE (0), SHUFFLE (1), BITSHUFFLE (2) or AUTOSHUFFLE (-1). If AUTOSHUFFLE, bit-shuffle will be used for buffers with itemsize 1, and byte-shuffle will be used otherwise. The default is SHUFFLE.

source
ZarrBlosc.BloscV3Codec Type
julia
BloscV3Codec(cname, clevel, shuffle, blocksize, typesize)

The zarr v3 blosc bytes->bytes codec. shuffle is stored as an integer (0 = noshuffle, 1 = shuffle, 2 = bitshuffle) and (de)serialised to the spec's string spelling.

source
ZarrZlib.ZarrZlib Module
julia
ZarrZlib

Zlib v2 compressor and gzip v3 codec support.

source
ZarrZlib.GzipV3Codec Type
julia
GzipV3Codec(level=6)

The zarr v3 gzip bytes->bytes codec. This is the v3 spelling of what zarr v2 calls the zlib compressor, see ZlibCompressor.

source
ZarrZlib.ZlibCompressor Type
julia
ZlibCompressor(clevel=-1)

Returns a ZlibCompressor struct that can serve as a Zarr array compressor. Keyword arguments are:

  • clevel=-1 the compression level, number between -1 (Default), 0 (no compression) and 9 (max compression)

  • default is -1 compromise between speed and compression (currently equivalent to level 6).

source
ZarrZstd.ZarrZstd Module
julia
ZarrZstd

Zstandard v2 compressor and v3 codec support.

source
ZarrZstd.ZstdCompressor Type
julia
ZstdCompressor(;level=0, checksum=false)

Returns a ZstdCompressor struct that can serve as a Zarr array compressor. Keyword arguments are:

  • level=0: the compression level, regular levels are 1 to 22, 0 is a special value for default, there are also even faster negative levels.

  • checksum=false: flag to enable saving checksums.

source
ZarrZstd.ZstdV3Codec Type
julia
ZstdV3Codec(level=3)

The zarr v3 zstd bytes->bytes codec, implemented by delegating to ZstdCompressor.

source

Extension registration ​

Each extension package exposes its own qualified registration function:

ZarrCore.should_register_at_init Function
julia
should_register_at_init()::Bool

Return the compile-time ZarrCore preference that controls automatic cross-package registry updates.

Extension packages should call this function from their runtime __init__ and register only when it returns true. The preference defaults to true. Users who disable it can still call an extension package's qualified register! function explicitly for the current Julia process. Restart Julia after changing RegisterAtInit. Downstream packages that require an extension should call its register! from their own runtime __init__, rather than while precompiling.

source
ZarrBlosc.register! Function
julia
ZarrBlosc.register!()

Register the Blosc compressor with ZarrCore under the Zarr v2 compressor name "blosc" and the Zarr v3 codec name "blosc".

Registration runs automatically during package initialization when the ZarrCore RegisterAtInit preference is enabled (the default). When automatic registration is disabled, call this function explicitly. Calling it again restores or overwrites ZarrBlosc's own registry entries.

source
ZarrZlib.register! Function
julia
ZarrZlib.register!()

Register the zlib compressor with ZarrCore under the Zarr v2 compressor name "zlib" and the Zarr v3 codec name "gzip".

Registration runs automatically during package initialization when the ZarrCore RegisterAtInit preference is enabled (the default). When automatic registration is disabled, call this function explicitly. Calling it again restores or overwrites ZarrZlib's own registry entries.

source
ZarrZstd.register! Function
julia
ZarrZstd.register!()

Register the Zstandard compressor with ZarrCore under the Zarr v2 compressor name "zstd" and the Zarr v3 codec name "zstd".

Registration runs automatically during package initialization when the ZarrCore RegisterAtInit preference is enabled (the default). When automatic registration is disabled, call this function explicitly. Calling it again restores or overwrites ZarrZstd's own registry entries.

source
ZarrHTTP.register! Function
julia
ZarrHTTP.register!()

Register the https:// and http:// URL schemes with ZarrCore. Registration runs automatically by default according to the ZarrCore RegisterAtInit preference. Call ZarrHTTP.register!() explicitly when automatic registration is disabled.

source
ZarrGCS.register! Function
julia
ZarrGCS.register!()

Register the https://storage.googleapis.com, http://storage.googleapis.com, and gs:// URL schemes with ZarrCore. Registration runs automatically by default according to the ZarrCore RegisterAtInit preference. Call ZarrGCS.register!() explicitly when automatic registration is disabled.

source
ZarrS3.register! Function
julia
ZarrS3.register!()

Register the s3:// URL scheme with ZarrCore. Registration runs automatically by default according to the ZarrCore RegisterAtInit preference. Call ZarrS3.register!() explicitly when automatic registration is disabled. AWSS3 is still required to operate on S3 stores.

source
ZarrZip.register! Function
julia
ZarrZip.register!()

Provide a registration entry point for ZarrZip. ZarrZip has no registry entries, so this function does nothing and returns nothing. It participates in the same RegisterAtInit initialization hook as other extension packages; calling it explicitly is optional and does not affect ZipStore or writezip.

source