Registry / http-networking / openmeteo-requests

openmeteo-requests

JSON →
library1.7.5pypypi✓ verified 85d ago

The openmeteo-requests library is an API client for the Open-Meteo Weather API, currently at version 1.7.5. It uses FlatBuffers for efficient data transfer, particularly for long time-series data, offering zero-copy data transfer to popular libraries like NumPy, Pandas, or Polars. Designed primarily for data scientists, it facilitates quick processing and analysis of weather data, including historical data from 1940 onwards. The library maintains an active development status with regular updates, often focusing on bug fixes and internal improvements, with new features and breaking changes typically introduced in minor or major version bumps.

pip install openmeteo-requests
INSTALL
IMPORT
SIG · OPENMETEO-REQUESTS
O
openmeteo-requests
http-networkingpythonv1.7.5
Install
3.3s avg
Import
854ms
Disk
36MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.897s · 37.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.3s · import 0.811s · 37MB
36MB installed
● package 36MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
import openmeteo_requests om = openmeteo_requests.Client()
from openmeteo_requests import Client
The primary client class is typically accessed via the top-level package import.
Variable
from openmeteo_sdk.Variable import Variable
The Variable enum is part of the `openmeteo-sdk` package, not `openmeteo-requests` directly. It is used for filtering and identifying specific weather variables in the FlatBuffers response.

This quickstart initializes the Open-Meteo client, defines weather parameters for a specific location (Berlin), and fetches current and hourly forecast data. It then demonstrates how to access the FlatBuffers-encoded data, specifically extracting current temperature and relative humidity. Note that Open-Meteo's API generally does not require an API key for non-commercial use.

import openmeteo_requests from openmeteo_sdk.Variable import Variable # Initialize the Open-Meteo API client om = openmeteo_requests.Client() # Define parameters for the weather request params = { "latitude": 52.52, "longitude": 13.41, "hourly": ["temperature_2m", "precipitation", "wind_speed_10m"], "current": ["temperature_2m", "relative_humidity_2m"], "timezone": "Europe/Berlin" } # Make the API call url = "https://api.open-meteo.com/v1/forecast" responses = om.weather_api(url, params=params) # Process the first location's response (assuming single location for brevity) response = responses[0] print(f"Coordinates: {response.Latitude()}°N {response.Longitude()}°E") print(f"Elevation: {response.Elevation()} m asl") print(f"Timezone: {response.Timezone()} {response.TimezoneAbbreviation()}") print(f"Timezone difference to GMT+0: {response.UtcOffsetSeconds()} s") # Access current weather data current = response.Current() current_variables = list(map(lambda i: current.Variables(i), range(0, current.VariablesLength()))) current_temperature_2m = next(filter(lambda x: x.Variable() == Variable.temperature and x.Altitude() == 2, current_variables)) current_relative_humidity_2m = next(filter(lambda x: x.Variable() == Variable.relative_humidity and x.Altitude() == 2, current_variables)) print(f"Current time: {current.Time()}") print(f"Current temperature_2m: {current_temperature_2m.Value()} °C") print(f"Current relative_humidity_2m: {current_relative_humidity_2m.Value()} %")
Debug
Known issues
breakingThe `.close()` method was removed from client objects in `v1.7.0`.
fix
Remove any explicit calls to `.close()` on `openmeteo_requests.Client` instances. The client automatically manages sessions or does not require explicit closing.
affects: >=1.7.0
gotchaData from the FlatBuffers response objects must be accessed using function calls (e.g., `response.Latitude()`) rather than direct attribute access (e.g., `response.Latitude`).
fix
Always use parentheses `()` when accessing properties on response objects (e.g., `response.Attribute()`, `hourly_data.Value()`). This is due to the FlatBuffers format and is necessary for dynamic data retrieval without expensive parsing. Consult the examples for correct usage.
affects: All versions
gotchaThe `openmeteo-requests` library works with `openmeteo-sdk`. You need to install `openmeteo-sdk` separately to properly work with `Variable` enums and fully process the FlatBuffers responses.
fix
Ensure `pip install openmeteo-sdk` is run alongside `pip install openmeteo-requests`. Import `Variable` from `openmeteo_sdk.Variable` as shown in the quickstart.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'openmeteo_sdk'
The `openmeteo-requests` library depends on `openmeteo_sdk`, and this error occurs when `openmeteo_sdk` is not found or accessible in the Python environment, even if `openmeteo-requests` was installed.
fix
Ensure `openmeteo-sdk` is explicitly installed or re-install `openmeteo-requests` to ensure all its dependencies are correctly resolved in your environment: `pip install openmeteo-sdk` or `pip install --upgrade openmeteo-requests`.
ModuleNotFoundError: No module named 'openmeteo_requests'
The `openmeteo-requests` library has not been installed in the current Python environment or is not on the Python path.
fix
Install the library using pip: `pip install openmeteo-requests`.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
This generic pip error indicates a conflict between `openmeteo-requests`'s dependencies (or its sub-dependencies like `flatbuffers`) and other packages already installed in your environment.
fix
Try installing `openmeteo-requests` in a fresh virtual environment to isolate its dependencies, or address specific conflicting packages by upgrading or downgrading them as suggested by the error message.
AttributeError: 'Response' object has no attribute 'Latitude'
Data fields from the Open-Meteo API response (which uses FlatBuffers) are accessed as methods (e.g., `Latitude()`), not as direct attributes (e.g., `Latitude`).
fix
Access the data fields by calling them as methods: `response.Latitude()` instead of `response.Latitude`.
Upgrade
Version history
1.7.5latest on PyPI · released Jan 19, 2026
Audit
Dependencies
niquestsrequiredThe client is based on this library for HTTP requests.
openmeteo-sdkrequiredRequired for FlatBuffers data parsing and accessing weather variable definitions (e.g., Variable enum).
requests-cacheoptionalOptional dependency for implementing caching for API requests.
Agent activity
12 hits · last 30 days
node
10
Resources
openmeteo-requests — pip install openmeteo-requests · libregistry