Metadata-Version: 2.1
Name: zarrdump
Version: 0.6.1
Summary: Describe zarr stores from the command line.
Author-email: Oliver Watt-Meyer <oliverwatt@gmail.com>
License: BSD 3-Clause license
Project-URL: Homepage, https://github.com/oliverwm1/zarrdump
Project-URL: Changelog, https://github.com/oliverwm1/zarrdump/blob/main/HISTORY.rst
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: click>=7.0.0
Requires-Dist: fsspec>=0.7.0
Requires-Dist: xarray>=0.19.0
Requires-Dist: zarr>=2.3.0
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"

.. image:: https://img.shields.io/pypi/v/zarrdump.svg
   :target: https://pypi.org/project/zarrdump/

Describe `zarr <https://github.com/zarr-developers/zarr-python>`_ stores from the command line. A path to any filesystem implemented by `fsspec <https://github.com/intake/filesystem_spec>`_ is valid.

Installation
------------

::

    $ pip install zarrdump

Usage
-----

If zarr store can be opened by `xarray <https://github.com/pydata/xarray>`_, the xarray representation will be displayed:
::

    $ zarrdump gs://bucket/dataset.zarr
    <xarray.Dataset>
    Dimensions:  (lat: 73, lon: 144, time: 32)
    Coordinates:
    * lat      (lat) float64 -90.0 -87.5 -85.0 -82.5 -80.0 ... 82.5 85.0 87.5 90.0
    * lon      (lon) float64 0.0 2.5 5.0 7.5 10.0 ... 350.0 352.5 355.0 357.5
    * time     (time) object 2016-12-01 00:00:00 ... 2017-01-01 00:00:00
    Data variables:
        ps       (time, lat, lon) float32 dask.array<chunksize=(4, 73, 144), meta=np.ndarray>
        ts       (time, lat, lon) float32 dask.array<chunksize=(4, 73, 144), meta=np.ndarray>


Can show information for a particular variable/array:
::

    $ zarrdump -v ts gs://bucket/dataset.zarr
    <xarray.DataArray 'ts' (time: 32, lat: 73, lon: 144)>
    dask.array<zarr, shape=(32, 73, 144), dtype=float32, chunksize=(4, 73, 144), chunktype=numpy.ndarray>
    Coordinates:
    * lat      (lat) float64 -90.0 -87.5 -85.0 -82.5 -80.0 ... 82.5 85.0 87.5 90.0
    * lon      (lon) float64 0.0 2.5 5.0 7.5 10.0 ... 350.0 352.5 355.0 357.5
    * time     (time) object 2016-12-01 00:00:00 ... 2017-01-01 00:00:00
    Attributes:
        longname:  surface temperature
        units:     K

Diagnostic information will also be printed for zarr arrays or zarr groups which do not represent xarray datasets:
::

    $ zarrdump group.zarr
    Name        : /
    Type        : zarr.hierarchy.Group
    Read-only   : False
    Store type  : fsspec.mapping.FSMap
    No. members : 2
    No. arrays  : 2
    No. groups  : 0
    Arrays      : bar, foo
