earthkit_data_meteoswiss_opendata#

Copyright (c) 2026 MeteoSwiss, contributors listed in AUTHORS

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

SPDX-License-Identifier: BSD-3-Clause

Submodules#

Attributes#

Classes#

Collection

Supported MeteoSwiss Open Data NWP collections.

Request

Validated MeteoSwiss forecast request.

MeteoSwissOpenDataSource

Earthkit source for MeteoSwiss Open Data.

Functions#

get_asset_urls(→ list[str])

Return assets matching a MeteoSwiss request.

Package Contents#

API_URL = 'https://data.geo.admin.ch/api/stac/v1'#
get_asset_urls(request: earthkit_data_meteoswiss_opendata.request.Request) → list[str][source]#

Return assets matching a MeteoSwiss request.

For requests with several lead times, only complete forecast runs are returned.

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.

class MeteoSwissOpenDataSource(*, collection: earthkit_data_meteoswiss_opendata.request.Collection | str, variable: str, perturbed: bool, ref_time: str | datetime.datetime, lead_time: str | datetime.timedelta | list[str | datetime.timedelta])[source]#

Bases: earthkit.data.sources.Source

Earthkit source for MeteoSwiss Open Data.

request#
mutate() → earthkit.data.sources.Source[source]#

Convert the request into Earthkit’s URL source.