Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ZEP 8 URL Syntax #2943

Open
jhamman opened this issue Apr 1, 2025 · 1 comment
Open

Support ZEP 8 URL Syntax #2943

jhamman opened this issue Apr 1, 2025 · 1 comment

Comments

@jhamman
Copy link
Member

jhamman commented Apr 1, 2025

Summary

ZEP 8 (zarr-developers/zeps#48) proposes a standardized URL syntax for specifying Zarr nodes across multiple implementations. Implementing this in zarr-python would enable more seamless interoperability between different Zarr tools, making it easier to share dataset locations across different backends.

Motivation

  • A standardized URL syntax ensures consistent dataset access across different implementations.
  • The proposed syntax allows for nested storage mechanisms, including ZIP files and hierarchical Zarr groups.
  • Improved integration with libraries like xarray, which could leverage this for seamless dataset loading.

Proposed Implementation

I would encourage us to handle this in two phases.

Phase 1

Implement handling of ZEP8 URLs for stores implemented in Zarr-Python. Practically, this requires parsing URLs into Store, Path, and ZarrFormat components.

Phase 2

Implement an entrypoint mechanism for 3rd party stores (e.g. Icechunk). This would allow external Store developers to provide a function to generate a Store given a URL.

Example Usage in xarray

With ZEP 8 URL syntax, an xarray.Dataset could be opened as follows:

import xarray as xr

dataset = xr.open_dataset(
    "gs://my-bucket/my-archive.zip|zip:inner-dir|zarr3:subgroup",
    engine="zarr"
)

This URL specifies:

  • A ZipStore (my-archive.zip) stored in Google Cloud Storage (gs://my-bucket/)
  • A nested hierarchy inside the Zarr store (subgroup)

Another example:

dataset = xr.open_dataset(
    "https://foobar.com/my-archive|icechunk|zarr3",
    engine="zarr"
)

This URL specifies:

  • An Icechunk Store available over https

Additional Considerations

  • Backward compatibility with existing fsspec URLs.

cc @jbms

xref: earth-mover/icechunk#576, zarr-developers/zeps#48

@d-v-b
Copy link
Contributor

d-v-b commented Apr 1, 2025

this is a great idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants