Zarrdump: printing metadata of Zarr's from the command line

Hello!

I hope this is an appropriate topic for this forum. I recently wrote a small package to make it easy to inspect metadata of zarr stores from the command-line. It was designed with xarray-dataset zarr stores in mind but also works with generic zarr stores. Pretty much a bare-bones ncdump for zarr:

$ zarrdump gs://my-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>

I was getting tired of popping open a python console or notebook every time I wanted to remind myself the variables/dimensions/coordinates/attributes of some given dataset :upside_down_face:

I’m unaware of any other efforts in this direction, but I’d be interested if anyone is already thinking about this! And of course any feedback is welcome.

It’s available on PyPI: pip install zarrdump

Cheers,
Oli

5 Likes