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:
-
Create a Virtual Environment:
python -m venv .venv
-
Activate the Environment:
- Windows:
.venv\Scripts\activate - Mac/Linux:
source .venv/bin/activate
- Windows:
-
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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3404063aabc170491d4d404ef90c7586b62577779c0e90c0b71b918498598987
|
|
| MD5 |
3ea66a7a5f949973ec518719902cd739
|
|
| BLAKE2b-256 |
ae443a3635b0dfa6b8fc841b773cee80de49275e348cf73637235bc4d260778f
|
Provenance
The following attestation bundles were made for climatex-0.2.0.tar.gz:
Publisher:
publish.yml on Ruchith1018/climatex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
climatex-0.2.0.tar.gz -
Subject digest:
3404063aabc170491d4d404ef90c7586b62577779c0e90c0b71b918498598987 - Sigstore transparency entry: 1340709682
- Sigstore integration time:
-
Permalink:
Ruchith1018/climatex@aae8b0b8f6d58978eb35180c39dd1b604eb681ff -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Ruchith1018
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aae8b0b8f6d58978eb35180c39dd1b604eb681ff -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74aefe36c6b6cef8a94d3316d9be117badf7b9f8ca29c3dcfa8befc2cd368450
|
|
| MD5 |
d137d757ac9c9857d2f79572ebedf71a
|
|
| BLAKE2b-256 |
8a4c72a737e488124af7a2afa358f02bdb35f7bccf795f255747b877635e5ce6
|
Provenance
The following attestation bundles were made for climatex-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Ruchith1018/climatex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
climatex-0.2.0-py3-none-any.whl -
Subject digest:
74aefe36c6b6cef8a94d3316d9be117badf7b9f8ca29c3dcfa8befc2cd368450 - Sigstore transparency entry: 1340709686
- Sigstore integration time:
-
Permalink:
Ruchith1018/climatex@aae8b0b8f6d58978eb35180c39dd1b604eb681ff -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Ruchith1018
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@aae8b0b8f6d58978eb35180c39dd1b604eb681ff -
Trigger Event:
push
-
Statement type: