A Python package for retrieving real-time air temperature from Open-Meteo and OpenWeather APIs. Supports multiple APIs, easy integration, and includes Kelvin-to-Celsius conversion for OpenWeather.
- β Supports Open-Meteo & OpenWeather APIs
- β Object-oriented architecture for easy extension
- β Kelvin to Celsius conversion for OpenWeather
- β Lightweight and easy to use
pip install weatherapi-py
π Usage
from weatherapi import OpenMeteo, OpenWeather
# Using Open-Meteo
open_meteo = OpenMeteo(35.6944, 51.4215)
temperature = open_meteo.get_current_temperature()
print(f"Temperature from Open-Meteo: {temperature}Β°C")
# Using OpenWeather (requires API key)
open_weather = OpenWeather(35.6944, 51.4215, api_key="your_api_key")
temperature = open_weather.get_current_temperature()
temperature = open_weather.kelvin_to_celsius(temperature)
print(f"Temperature from OpenWeather: {temperature}Β°C")
π License
This project is licensed under the MIT License.