API reference¶
Top-level Rest class¶
The Rest
class can be used for publishing a
xarray.Dataset
object or a collection of Dataset objects.
|
Used to publish one or more Xarray Datasets via a REST API (FastAPI application). |
Returns the |
|
Returns the |
|
|
Serve this FastAPI application via |
Dataset.rest (xarray accessor)¶
This accessor extends xarray.Dataset
with the same interface than
Rest
. It is a convenient method for publishing one single
dataset. Proper use of this accessor should be like:
>>> import xarray as xr # first import xarray
>>> import xpublish # import xpublish (the dataset 'rest' accessor is registered)
>>> ds = xr.Dataset() # create or load an xarray Dataset
>>> ds.rest(...) # call the 'rest' accessor on the dataset
>>> ds.rest.<meth_or_prop> # access to the methods and properties listed below
Calling the accessor
|
Initialize this accessor by setting optional configuration values. |
Properties
Returns the |
|
Returns the |
Methods
|
Serve this FastAPI application via |
FastAPI dependencies¶
The functions below are defined in module xpublish.dependencies
and can
be used as FastAPI dependencies
when creating custom API endpoints.
FastAPI dependency for getting the list of ids (string keys) of the collection of datasets being served. |
|
|
FastAPI dependency for accessing the published xarray dataset object. |
FastAPI dependency for accessing the application's cache. |
|
|
FastAPI dependency that returns a dictionary of zarr encoded variables. |
|
FastAPI dependency that returns a consolidated zmetadata dictionary. |