xpublish.dependencies.get_dataset#
- xpublish.dependencies.get_dataset(dataset_id)[source]#
FastAPI dependency for accessing the published xarray dataset object.
Use this callable as dependency in any FastAPI path operation function where you need access to the xarray Dataset being served.
When the route includes a
{group_path:path}path parameter, the dataset at that node of the underlying DataTree is returned. Otherwise the dataset at the root node is returned.This dummy dependency will be overridden when creating the FastAPI application.