Client¶
glofas_ewds.client ¶
An async front for the EWDS downloads, for code that runs in an event loop.
The EWDS is a queue: a request waits minutes before its file is ready, and
cdsapi blocks while it waits. :class:EwdsClient runs each download in a
thread so your loop keeps serving.
Credentials: pass url and key, or leave them out and cdsapi reads
CDSAPI_URL / CDSAPI_KEY or ~/.cdsapirc. Accept each dataset's
licence once on its page on the EWDS, or every request answers 403.
EwdsClient ¶
GloFAS history and forecast, and the Copernicus FWI, downloaded off the event loop.
retriever
property
¶
retriever: Retriever
The object that sends the requests; a cdsapi.Client unless you gave one.
history
async
¶
history(start: date, end: date) -> list[Path]
Daily discharge files from start to end; see :func:download_history.
forecast
async
¶
forecast(run: date) -> Path
The control forecast file of run; see :func:download_forecast.
ensemble
async
¶
ensemble(run: date) -> Path
The perturbed members of run; see :func:download_ensemble.
latest_forecast
async
¶
latest_forecast(*, today: date | None = None, latest_saved: date | None = None) -> tuple[date, Path] | None
The newest run you do not have yet: today's, or yesterday's if today's is not published.
None when you already have the newest. Raises :class:GlofasEwdsError
when no candidate run could be downloaded.
fire
async
¶
fire(start: date, end: date) -> list[Path]
Copernicus FWI files from start to end; see :func:download_fire.
cdsapi_client ¶
cdsapi_client(url: str | None = None, key: str | None = None) -> Retriever
A quiet cdsapi.Client (needs the ewds extra).