Install & Compatibility
Where this runs
tested against v1.26.0 · 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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.2MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
WeatherApiRequest
✓ from openmeteo_sdk import WeatherApiRequest
✗ from openmeteo_sdk import WeatherApiRequest
This quickstart demonstrates how to use `openmeteo-sdk` to build a FlatBuffer request for weather data, send it to the Open-Meteo API using the `requests` library, and then parse the binary FlatBuffer response to extract hourly temperatures and daily sunshine duration. It highlights the use of `flatbuffers.Builder` for request creation and direct access to data via the generated `WeatherApiResponse` classes.
import requests
import flatbuffers
from openmeteo_sdk.WeatherApiRequest import WeatherApiRequest
from openmeteo_sdk.WeatherApiResponse import WeatherApiResponse
from openmeteo_sdk.Variables import Variables
def get_weather_data(latitude: float, longitude: float):
builder = flatbuffers.Builder(0)
request = WeatherApiRequest.WeatherApiRequest.StartWeatherApiRequest(builder)
WeatherApiRequest.WeatherApiRequest.AddLatitude(request, latitude)
WeatherApiRequest.WeatherApiRequest.AddLongitude(request, longitude)
WeatherApiRequest.WeatherApiRequest.AddHourly(request, Variables.Variables().TEMPERATURE_2M)
WeatherApiRequest.WeatherApiRequest.AddDaily(request, Variables.Variables().SUNSHINE_DURATION)
WeatherApiRequest.WeatherApiRequest.AddTimezone(request, builder.CreateString("Europe/Berlin"))
request_object = WeatherApiRequest.WeatherApiRequest.EndWeatherApiRequest(builder)
builder.Finish(request_object)
# Send request to Open-Meteo API
response = requests.post(
"https://api.open-meteo.com/v1/forecast?models=gfs_seamless",
data=builder.Output(),
headers={
"Content-Type": "application/flatbuffers",
"Accept": "application/flatbuffers"
}
)
response.raise_for_status()
# Parse response
weather_api_response = WeatherApiResponse.WeatherApiResponse.GetRootAsWeatherApiResponse(response.content)
# Access hourly data
if weather_api_response.Hourly() is not None:
hourly_temperatures = []
for i in range(weather_api_response.Hourly().VariablesLength()):
variable = weather_api_response.Hourly().Variables(i)
if variable.Variable() == Variables.Variables().TEMPERATURE_2M:
for j in range(variable.ValuesLength()):
hourly_temperatures.append(variable.Values(j))
print(f"Hourly Temperatures (2m): {hourly_temperatures[:5]}...") # Print first 5 for brevity
# Access daily data
if weather_api_response.Daily() is not None:
daily_sunshine = []
for i in range(weather_api_response.Daily().VariablesLength()):
variable = weather_api_response.Daily().Variables(i)
if variable.Variable() == Variables.Variables().SUNSHINE_DURATION:
for j in range(variable.ValuesLength()):
daily_sunshine.append(variable.Values(j))
print(f"Daily Sunshine Duration: {daily_sunshine[:5]}...") # Print first 5 for brevity
if __name__ == '__main__':
get_weather_data(latitude=52.52, longitude=13.41)
Upgrade
Version history
1.26.0latest on PyPI · released Mar 21, 2026
Audit
Dependencies
flatbuffersrequiredCore library for efficient serialization and deserialization of API requests and responses based on the FlatBuffers schema.
requestsoptionalCommonly used for making HTTP calls to the Open-Meteo API, as the SDK only provides data models, not an HTTP client itself.