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.

This dummy dependency will be overridden when creating the FastAPI application.

Parameters

dataset_id (str) – Unique path-safe key identifying dataset

Return type

Dataset

Returns

Requested Xarray dataset