Skip to main content

High-performance, strictly typed Python wrapper for Open-Meteo API

Project description

xsmeteo

Python 3.12+ License: MIT

High-performance, strictly typed Python wrapper for the Open-Meteo API.

Features

  • 🚀 High Performance – Uses msgspec for maximum serialization speed
  • 🔒 100% Type Safe – Full static typing with mypy --strict compliance
  • 🔄 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)

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)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsmeteo-0.1.0.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xsmeteo-0.1.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file xsmeteo-0.1.0.tar.gz.

File metadata

  • Download URL: xsmeteo-0.1.0.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xsmeteo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad971b3c56eff4b4afcced0a67a51a04a1898709c210eff0d3be80e2446cc0ec
MD5 d270ca8cf5b17d56ef1942614626cfd7
BLAKE2b-256 7e77d12da63dc9609c4c58b78825832667d16370b637b1cc31cd7d29b1469b8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for xsmeteo-0.1.0.tar.gz:

Publisher: python-publish.yml on xsyncio/xsmeteo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xsmeteo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xsmeteo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xsmeteo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 366ddef9cddfbde423f06e47d00af69b951f3070a0db1d528caaf6f46a286e4c
MD5 a453de9016fc4034f98ecee410e2b579
BLAKE2b-256 438191cd4c8db5af43121f956f637fb10eff7de4d2a0b326c1b5c1f5f0b2d93c

See more details on using hashes here.

Provenance

The following attestation bundles were made for xsmeteo-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on xsyncio/xsmeteo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page