API Reference#

VirtualiZarr has a small API surface, because most of the complexity is handled by xarray functions like xarray.concat and xarray.merge. Users can use xarray for every step apart from reading and serializing virtual references.

User API#

Reading#

open_virtual_dataset

Open a file or store as an xarray Dataset wrapping virtualized zarr arrays.

Serialization#

VirtualiZarrDatasetAccessor.to_kerchunk

Serialize all virtualized arrays in this xarray dataset into the kerchunk references format.

VirtualiZarrDatasetAccessor.to_zarr

Serialize all virtualized arrays in this xarray dataset as a Zarr store.

VirtualiZarrDatasetAccessor.to_icechunk

Write an xarray dataset to an Icechunk store.

Information#

VirtualiZarrDatasetAccessor.nbytes

Size required to hold these references in memory in bytes.

Rewriting#

VirtualiZarrDatasetAccessor.rename_paths

Rename paths to chunks in every ManifestArray in this dataset.

Developer API#

If you want to write a new reader to create virtual references pointing to a custom file format, you will need to use VirtualiZarr’s internal classes.

Manifests#

VirtualiZarr uses these classes to store virtual references internally.

ChunkManifest

In-memory representation of a single Zarr chunk manifest.

ManifestArray

Virtualized array representation of the chunk data in a single Zarr Array.

Array API#

VirtualiZarr’s ManifestArray objects support a limited subset of the Python Array API standard in virtualizarr.manifests.array_api.

concatenate

Concatenate ManifestArrays by merging their chunk manifests.

stack

Stack ManifestArrays by merging their chunk manifests.

expand_dims

Expands the shape of an array by inserting a new axis (dimension) of size one at the position specified by axis.

broadcast_to

Broadcasts a ManifestArray to a specified shape, by either adjusting chunk keys or copying chunk manifest entries.