Skip to main content

A simple and powerful Python wrapper for the Open-Meteo API.

Project description

ClimateX 🌦️

ClimateX is a simple, high-performance Python wrapper for the Open-Meteo API. It supports both synchronous and asynchronous requests, making it ideal for everything from data science scripts to real-time bots and web applications.

Features

  • Sync & Async Support: Built on top of httpx.
  • 🔍 Geocoding API: Search for coordinates by city name.
  • 🌡️ Current Weather: Get real-time weather details.
  • 📅 7-Day Forecast: Hourly and daily weather variables.
  • 🛡️ Type Safety: Fully typed with Pydantic models.

Local Development Setup

To set up ClimateX for local development, follow these steps:

  1. Create a Virtual Environment:

    python -m venv .venv
    
  2. Activate the Environment:

    • Windows: .venv\Scripts\activate
    • Mac/Linux: source .venv/bin/activate
  3. Install in Editable Mode (with dev dependencies):

    pip install -e ".[test, dev]"
    

Installation

pip install climatex

Quick Start

Synchronous Usage

from climatex import ClimateXClient

client = ClimateXClient()

# Search for a location
locations = client.search_location("London")
london = locations[0]

# Get current weather
weather = client.get_current_weather(london.latitude, london.longitude)
print(f"Current Temperature: {weather.temperature_2m}°C")

Asynchronous Usage

import asyncio
from climatex import ClimateXClient

async def main():
    async with ClimateXClient() as client:
        weather = await client.get_current_weather(51.5, -0.12)
        print(f"Temperature: {weather.temperature_2m}°C")

asyncio.run(main())

CI/CD Security

This project uses Trusted Publishing (OIDC) for secure deployments to PyPI. This removes the need for permanent API tokens in GitHub Actions, using short-lived, automated handshakes instead. Automated provenance attestations are also generated for every release.

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

climatex-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

climatex-0.1.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file climatex-0.1.1.tar.gz.

File metadata

  • Download URL: climatex-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for climatex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 88215db1d91f4d496b620bbc644b75241a0d8ac5adc22258d3d2b5cab1465fe9
MD5 86acbe44795dd919c3b26ac009900c2d
BLAKE2b-256 fe35c8292f8de94eed03d881405179424deccfd3a12afc1dc6059e844e264474

See more details on using hashes here.

Provenance

The following attestation bundles were made for climatex-0.1.1.tar.gz:

Publisher: publish.yml on Ruchith1018/climatex

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

File details

Details for the file climatex-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: climatex-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for climatex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e09a5f5711c7758e51e93961bf6c1c274371389004a016bf1c0052488b33d5da
MD5 1c2d84b5368857e8d594a9e8d4b1fe58
BLAKE2b-256 f8131b73208e2a324e3887083d86b89411354d2f4c2874d93a1b0f7f06ae347c

See more details on using hashes here.

Provenance

The following attestation bundles were made for climatex-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Ruchith1018/climatex

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