earthkit_data_meteoswiss_opendata.request#

Request validation and STAC query creation.

Copyright (c) 2026 MeteoSwiss, contributors listed in AUTHORS

Distributed under the terms of the BSD 3-Clause License.

SPDX-License-Identifier: BSD-3-Clause

Attributes#

Classes#

Collection

Supported MeteoSwiss Open Data NWP collections.

Request

Validated MeteoSwiss forecast request.

Module Contents#

logger#
DurationAdapter#
class Collection[source]#

Bases: enum.StrEnum

Supported MeteoSwiss Open Data NWP collections.

ICON_CH1 = 'ogd-forecasting-icon-ch1'#
ICON_CH2 = 'ogd-forecasting-icon-ch2'#
KENDA_CH1 = 'ogd-analysis-kenda-ch1'#
property stac_id: str#

Return the full STAC collection identifier.

class Request[source]#

Validated MeteoSwiss forecast request.

ref_time is accepted as an alias for reference_datetime.

lead_time is accepted as an alias for horizon.

collection: Collection#
variable: Annotated[str, Field(min_length=1)]#
reference_datetime: Annotated[str, Field(validation_alias=AliasChoices('reference_datetime', 'ref_time'))]#
perturbed: bool#
horizon: Annotated[datetime.timedelta | list[datetime.timedelta], Field(validation_alias=AliasChoices('horizon', 'lead_time'))]#
classmethod validate_reference_datetime(value: Any) → str[source]#

Validate and normalize the reference datetime.

classmethod validate_horizon(value: datetime.timedelta | list[datetime.timedelta]) → datetime.timedelta | list[datetime.timedelta][source]#

Validate one or more forecast horizons.

property lead_times: list[datetime.timedelta]#

Return the requested horizons as a list.

to_stac_query(*, now: datetime.datetime | None = None) → dict[str, Any][source]#

Create the STAC search request body.

dump() → dict[str, Any][source]#

Backward-compatible alias for the old API.