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.2.0.tar.gz (5.7 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.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for climatex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3404063aabc170491d4d404ef90c7586b62577779c0e90c0b71b918498598987
MD5 3ea66a7a5f949973ec518719902cd739
BLAKE2b-256 ae443a3635b0dfa6b8fc841b773cee80de49275e348cf73637235bc4d260778f

See more details on using hashes here.

Provenance

The following attestation bundles were made for climatex-0.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: climatex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74aefe36c6b6cef8a94d3316d9be117badf7b9f8ca29c3dcfa8befc2cd368450
MD5 d137d757ac9c9857d2f79572ebedf71a
BLAKE2b-256 8a4c72a737e488124af7a2afa358f02bdb35f7bccf795f255747b877635e5ce6

See more details on using hashes here.

Provenance

The following attestation bundles were made for climatex-0.2.0-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