kerchunk icon indicating copy to clipboard operation
kerchunk copied to clipboard

Have ZarrToZarr write to json in the function?

Open raybellwaves opened this issue 11 months ago • 1 comments

Currently one can write to json outside of the function

zarrchunks = kerchunk.zarr.ZarrToZarr(uri)
with open(out_json, "wb") as f:
    f.write(ujson.dumps(zarrchunks))

Given this is a common operation it could be added to single_zarr

raybellwaves avatar Mar 21 '24 21:03 raybellwaves

Other scanners allow you to pass the filename/storage_options (for JSON output) in the .translate() methods. The functional form is the same as ScanClass(input_args).translate(output_args) .

martindurant avatar Mar 22 '24 14:03 martindurant