Skip to content

Zarr Streaming Python API Reference

This documentation details the functions, modules, and objects provided by the Python API. For learning about the core concepts of Zarr, see the Core Concepts page. For examples of using the Python API, see the Python Examples page.

acquire_zarr.ArraySettings

Settings for a single array in the Zarr stream.

Attributes:

Name Type Description
output_key str

Key within the Zarr dataset where this array will be stored.

dimensions List[Dimension]

List of dimension properties defining the dataset structure. Should be ordered from slowest to fastest changing (e.g., [Z, Y, X] for 3D data).

data_type Union[DataType, dtype]

The pixel data type for the dataset.

compression Optional[CompressionSettings]

Optional compression settings for chunks. If None, no compression is applied.

downsampling_method Optional[DownsamplingMethod]

Method used for generating optional multiscale levels (image pyramid).

acquire_zarr.CompressionCodec

Codec to use for compression, if any.

Attributes:

Name Type Description
NONE CompressionCodec

No compression

BLOSC_LZ4 CompressionCodec

LZ4 compression using Blosc

BLOSC_ZSTD CompressionCodec

Zstd compression using Blosc

acquire_zarr.CompressionSettings

Settings for compressing during acquisition.

acquire_zarr.Compressor

Compressor to use, if any.

Attributes:

Name Type Description
NONE Compressor

No compression.

BLOSC1 Compressor

Blosc compressor.

acquire_zarr.DataType

Data type used in the stream.

Attributes:

Name Type Description
UINT8 DataType

Unsigned 8-bit integer.

UINT16 DataType

Unsigned 16-bit integer.

UINT32 DataType

Unsigned 32-bit integer.

UINT64 DataType

Unsigned 64-bit integer.

INT8 DataType

Signed 8-bit integer.

INT16 DataType

Signed 16-bit integer.

INT32 DataType

Signed 32-bit integer.

INT64 DataType

Signed 64-bit integer.

FLOAT32 DataType

Single precision floating point.

FLOAT64 DataType

Double precision floating point.

acquire_zarr.Dimension

Properties of a dimension of the output array.

acquire_zarr.DimensionType

Type of dimension.

Attributes:

Name Type Description
SPACE DimensionType

Spatial dimension.

CHANNEL DimensionType

Channel dimension.

TIME DimensionType

Time dimension.

OTHER DimensionType

Other dimension.

acquire_zarr.DownsamplingMethod

Method used to downsample frames.

Attributes:

Name Type Description
DECIMATE DownsamplingMethod

Take the top left of each 4x4 block of pixels

MEAN DownsamplingMethod

Take the mean value of each 4x4 block of pixels

MIN DownsamplingMethod

Take the minimum value of each 4x4 block of pixels

MAX DownsamplingMethod

Take the maximum value of each 4x4 block of pixels

acquire_zarr.LogLevel

Severity level to filter logs by.

Attributes:

Name Type Description
DEBUG LogLevel

Detailed information for debugging purposes.

INFO LogLevel

Informational messages.

WARNING LogLevel

Warnings.

ERROR LogLevel

Errors.

NONE LogLevel

Disable logging.

acquire_zarr.S3Settings

Settings for connecting to and storing data in S3.

acquire_zarr.StreamSettings

Settings for configuring a Zarr stream.

This class encapsulates all the configuration options needed to create a Zarr stream, including storage location, array configuration, and format options.

Attributes:

Name Type Description
arrays List[ArraySettings]

List of ArraySettings defining the structure and properties of each array in the dataset.

store_path str

Path to the store. Can be a filesystem path or S3 key prefix. For S3, this becomes the key prefix within the specified bucket.

s3 Optional[S3Settings]

Optional S3 settings for cloud storage. If None, writes to local filesystem.

version ZarrVersion

Zarr format version to use (V2 or V3).

max_threads int

Maximum number of threads for parallel processing.

custom_metadata Optional[str]

Optional JSON-formatted custom metadata to include in the dataset.

overwrite bool

If True, removes any existing data at store_path before writing.

Note

For S3 storage with endpoint "s3://my-endpoint.com", bucket "my-bucket", and store_path "my-dataset.zarr", the final location will be "s3://my-endpoint.com/my-bucket/my-dataset.zarr".

acquire_zarr.ZarrStream

acquire_zarr.ZarrVersion

Zarr format version.

Attributes:

Name Type Description
V2 ZarrVersion

Zarr format version 2

V3 ZarrVersion

Zarr format version 3

acquire_zarr.get_log_level() -> LogLevel

Get the current log level for the Zarr API

acquire_zarr.set_log_level(level: LogLevel) -> None

Set the log level for the Zarr API