High-performance, strictly typed Python wrapper for Open-Meteo API
Project description
High-performance, strictly typed Python wrapper for the Open-Meteo API.
Features
- 🚀 High Performance – Uses
msgspecfor maximum serialization speed - 🔒 100% Type Safe – Full static typing with
mypy --strictcompliance - 🔄 Sync & Async – Both synchronous and asynchronous clients
- ⏱️ Built-in Rate Limiting – Hierarchical token bucket respecting Open-Meteo limits
- 🌍 Full API Coverage – All 9 Open-Meteo endpoints supported
Installation
pip install xsmeteo
Or with uv:
uv add xsmeteo
Quick Start
Synchronous Usage
from xsmeteo import XSMeteo
with XSMeteo() as client:
# Get weather forecast
forecast = client.get_forecast(
latitude=52.52,
longitude=13.41,
hourly=["temperature_2m", "rain"],
timezone="auto",
)
print(forecast)
# Access data using dictionary syntax:
if forecast.hourly:
print(forecast.hourly["temperature_2m"])
Asynchronous Usage
import asyncio
from xsmeteo import AsyncXSMeteo
async def main():
async with AsyncXSMeteo() as client:
forecast = await client.get_forecast(
latitude=52.52,
longitude=13.41,
hourly=["temperature_2m"],
)
print(forecast)
if forecast.hourly:
print(forecast.hourly["temperature_2m"])
asyncio.run(main())
API Coverage
| Endpoint | Method | Description |
|---|---|---|
| Forecast | get_forecast() |
Current weather and up to 16-day forecast |
| Historical | get_historical() |
Decades of historical weather data (ERA5) |
| Marine | get_marine() |
Oceanographic data (waves, currents) |
| Air Quality | get_air_quality() |
Pollutants and pollen forecasts |
| Geocoding | search_locations() |
Forward geocoding (name to coordinates) |
| Elevation | get_elevation() |
Altitude data for coordinates |
| Flood | get_flood() |
River discharge and flood forecasts |
| Ensemble | get_ensemble() |
Probabilistic ensemble forecasts |
| Climate | get_climate() |
Long-term climate projections (CMIP6) |
Rate Limiting
xsmeteo includes built-in rate limiting that respects Open-Meteo's fair use policy:
| Limit | Value |
|---|---|
| Minutely | ~600 requests |
| Hourly | ~5,000 requests |
| Daily | ~10,000 requests |
Custom limits can be configured:
from xsmeteo import XSMeteo, RateLimitConfig
custom_limits = [
RateLimitConfig(limit=100, period_seconds=60.0), # 100/min
]
client = XSMeteo(rate_limits=custom_limits)
License
MIT License. See LICENSE for details.
Attribution
This library uses the Open-Meteo API under CC-BY 4.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xsmeteo-0.1.1.tar.gz.
File metadata
- Download URL: xsmeteo-0.1.1.tar.gz
- Upload date:
- Size: 55.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a65fa04be21ceae435f0661a540a27a13a17e04398efc4f71ceeeabd08f5cba7
|
|
| MD5 |
72c702df82a865ee215d5d2a28affb8e
|
|
| BLAKE2b-256 |
54823e0982fe8b8a6ebe5de0cb10fcf201f9596d97914564ffef2eb9deece037
|
Provenance
The following attestation bundles were made for xsmeteo-0.1.1.tar.gz:
Publisher:
python-publish.yml on xsyncio/xsmeteo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xsmeteo-0.1.1.tar.gz -
Subject digest:
a65fa04be21ceae435f0661a540a27a13a17e04398efc4f71ceeeabd08f5cba7 - Sigstore transparency entry: 894755594
- Sigstore integration time:
-
Permalink:
xsyncio/xsmeteo@c0ca980eb69277829df83fa2328620f55c9bf66d -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/xsyncio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c0ca980eb69277829df83fa2328620f55c9bf66d -
Trigger Event:
release
-
Statement type:
File details
Details for the file xsmeteo-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xsmeteo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeb0b031e4fbb1041dc1d1207858c06490132ade9a05f236f88ea8365c4ace24
|
|
| MD5 |
dd43ef787e1928a019aa9bae667b34cf
|
|
| BLAKE2b-256 |
47c1d19e24f29b1c8aad865776ea23c91e9ca7cfdca06e945010d173e1c8b87c
|
Provenance
The following attestation bundles were made for xsmeteo-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on xsyncio/xsmeteo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xsmeteo-0.1.1-py3-none-any.whl -
Subject digest:
eeb0b031e4fbb1041dc1d1207858c06490132ade9a05f236f88ea8365c4ace24 - Sigstore transparency entry: 894755597
- Sigstore integration time:
-
Permalink:
xsyncio/xsmeteo@c0ca980eb69277829df83fa2328620f55c9bf66d -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/xsyncio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c0ca980eb69277829df83fa2328620f55c9bf66d -
Trigger Event:
release
-
Statement type: