Reference
Information-oriented docs: the exact public API, generated from the docstrings in the source. If you see something here, it’s part of the supported public surface.
openmeteo
Lightweight async Python client for the Open-Meteo weather API.
- class openmeteo.CurrentWeather(**data)[source]
Bases:
BaseModelCurrent weather conditions at a forecast location.
- Variables:
time – Local observation time returned by Open-Meteo.
interval – Observation interval in seconds.
temperature_2m – Air temperature at 2 meters in degrees Celsius.
relative_humidity_2m – Relative humidity at 2 meters in percent.
precipitation – Precipitation amount in millimeters.
weather_code – WMO weather interpretation code.
wind_speed_10m – Wind speed at 10 meters in kilometers per hour.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class openmeteo.Forecast(**data)[source]
Bases:
BaseModelA weather forecast for one resolved location.
- Variables:
location – Resolved forecast location.
timezone – IANA timezone used for returned timestamps.
current – Current weather conditions.
timezone_abbreviation – Short timezone label returned by Open-Meteo.
elevation – Elevation in meters.
utc_offset_seconds – UTC offset of the returned timezone.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- current: CurrentWeather
- class openmeteo.Location(**data)[source]
Bases:
BaseModelA WGS84 location used for weather requests.
- Variables:
latitude – Latitude in decimal degrees, constrained to
[-90, 90].longitude – Longitude in decimal degrees, constrained to
[-180, 180].name – Optional human-readable place name.
timezone – Optional IANA timezone for the location.
country_code – Optional ISO 3166-1 alpha-2 country code.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class openmeteo.OpenMeteoClient(*, http_client=None)[source]
Bases:
objectAsync client exposing low-level Open-Meteo operations.
- Parameters:
http_client (
HttpClient|None) – Optional transport override, primarily useful for tests.
- async forecast(location, *, variables=(Variable.TEMPERATURE_2M, Variable.RELATIVE_HUMIDITY_2M, Variable.PRECIPITATION, Variable.WEATHER_CODE, Variable.WIND_SPEED_10M))[source]
Fetch current forecast data for a location.
- class openmeteo.Variable(*values)[source]
Bases:
StrEnumWeather variable names accepted by the Open-Meteo forecast API.
- APPARENT_TEMPERATURE = 'apparent_temperature'
- APPARENT_TEMPERATURE_MAX = 'apparent_temperature_max'
- APPARENT_TEMPERATURE_MIN = 'apparent_temperature_min'
- CLOUD_COVER = 'cloud_cover'
- CLOUD_COVER_HIGH = 'cloud_cover_high'
- CLOUD_COVER_LOW = 'cloud_cover_low'
- CLOUD_COVER_MID = 'cloud_cover_mid'
- DEW_POINT_2M = 'dew_point_2m'
- DIFFUSE_RADIATION = 'diffuse_radiation'
- DIRECT_NORMAL_IRRADIANCE = 'direct_normal_irradiance'
- DIRECT_RADIATION = 'direct_radiation'
- ET0_FAO_EVAPOTRANSPIRATION = 'et0_fao_evapotranspiration'
- EVAPOTRANSPIRATION = 'evapotranspiration'
- FREEZING_LEVEL_HEIGHT = 'freezing_level_height'
- PRECIPITATION = 'precipitation'
- PRECIPITATION_HOURS = 'precipitation_hours'
- PRECIPITATION_SUM = 'precipitation_sum'
- PRESSURE_MSL = 'pressure_msl'
- RELATIVE_HUMIDITY_2M = 'relative_humidity_2m'
- SHORTWAVE_RADIATION = 'shortwave_radiation'
- SHORTWAVE_RADIATION_SUM = 'shortwave_radiation_sum'
- SNOW_HEIGHT = 'snow_height'
- SOIL_MOISTURE_0_1CM = 'soil_moisture_0_1cm'
- SOIL_MOISTURE_1_3CM = 'soil_moisture_1_3cm'
- SOIL_MOISTURE_27_81CM = 'soil_moisture_27_81cm'
- SOIL_MOISTURE_3_9CM = 'soil_moisture_3_9cm'
- SOIL_MOISTURE_9_27CM = 'soil_moisture_9_27cm'
- SOIL_TEMPERATURE_0CM = 'soil_temperature_0cm'
- SOIL_TEMPERATURE_18CM = 'soil_temperature_18cm'
- SOIL_TEMPERATURE_54CM = 'soil_temperature_54cm'
- SOIL_TEMPERATURE_6CM = 'soil_temperature_6cm'
- SUNRISE = 'sunrise'
- SUNSET = 'sunset'
- TEMPERATURE_2M = 'temperature_2m'
- TEMPERATURE_2M_MAX = 'temperature_2m_max'
- TEMPERATURE_2M_MIN = 'temperature_2m_min'
- UV_INDEX_CLEAR_SKY_MAX = 'uv_index_clear_sky_max'
- UV_INDEX_MAX = 'uv_index_max'
- VAPOUR_PRESSURE_DEFICIT = 'vapour_pressure_deficit'
- WEATHER_CODE = 'weather_code'
- WIND_DIRECTION_10M = 'wind_direction_10m'
- WIND_DIRECTION_10M_DOMINANT = 'wind_direction_10m_dominant'
- WIND_DIRECTION_120M = 'wind_direction_120m'
- WIND_DIRECTION_180M = 'wind_direction_180m'
- WIND_DIRECTION_80M = 'wind_direction_80m'
- WIND_GUSTS_10M = 'wind_gusts_10m'
- WIND_GUSTS_10M_MAX = 'wind_gusts_10m_max'
- WIND_SPEED_10M = 'wind_speed_10m'
- WIND_SPEED_10M_MAX = 'wind_speed_10m_max'
- WIND_SPEED_120M = 'wind_speed_120m'
- WIND_SPEED_180M = 'wind_speed_180m'
- WIND_SPEED_80M = 'wind_speed_80m'
- openmeteo.ping()[source]
Return a small string confirming the package is alive.
Use this as a smoke test after installing, or in an automation to check that open-meteo-client is importable in your environment. It performs no I/O and never raises.
- Return type:
- Returns:
A short human-readable string containing the installed version, e.g.
"open-meteo-client 0.0.4: pong".
Example
>>> from openmeteo import ping >>> ping() 'open-meteo-client 0.0.4: pong'