xpublish-community / xpublish

Publish Xarray Datasets via a REST API.
https://xpublish.readthedocs.io
Apache License 2.0
167 stars 23 forks source link

xpublish as a jupyverse plugin #98

Open davidbrochart opened 2 years ago

davidbrochart commented 2 years ago

Jupyverse is a new Jupyter server implementation based on FastAPI and a plugin system. It could be interesting to provide xpublish as an FPS plugin, as it would allow to create a JupyterLab extension for Zarr visualization.

jhamman commented 2 years ago

@davidbrochart - if you could provide a brief summary of what would have to change in xpublish to support integration with Jupyverse, that would be super helpful here.

davidbrochart commented 2 years ago

Thanks for pinging me @jhamman. I opened #102, where I started declaring the routers in base, common and zarr as FPS routers. Nothing much, but with this, after installing xpublish and running jupyverse you should see your endpoints at e.g. http://127.0.0.1:8000/docs#/xpublish. The serve method doesn't apply, as it will automatically be served by jupyverse. I see the FastAPI app is configured in the _init_app method, we would need to find a way to do that through FPS if it's not already possible. Of course without calling serve() no actual data will be served, so we would need something like publish_in_jupyter() which would do the equivalent of the dependency overrides, I think.