Agriculture advisory engine for OpenWeather API methods wrapper
Project description
AgriVisor - OpenWeather API Integration Library
A library for fetching weather data from OpenWeather APIs, designed for ease of use and to provide easy details
Features
- Current Weather - Get real-time weather data for any location
- Hourly Forecast - 4-day hourly weather forecast (96 hours)
- Daily Forecast - 16-day daily weather forecast
- Air Pollution - Current air quality and pollution data
- Geocoding - Convert city names to coordinates and vice versa
Installation
pip install agrivisor
Quick Start
from agrivisor import OpenWeatherClient
# Initialize the client with your API key
client = OpenWeatherClient(api_key="your_api_key_here")
# Get current weather for Dublin, Ireland
weather = client.get_current_weather(lat=53.3498, lon=-6.2603)
print(f"Temperature: {weather.temperature}°C")
print(f"Humidity: {weather.humidity}%")
print(f"Weather: {weather.weather_description}")
Key Methods:
All methods support both coordinate-based and city name-based lookups:
get_current_weather(lat, lon)orget_current_weather(city_name, country_code)- Get current weatherget_hourly_forecast(lat, lon, cnt)orget_hourly_forecast(city_name, country_code, cnt)- Get hourly forecast (4 days)get_daily_forecast(lat, lon, cnt)orget_daily_forecast(city_name, country_code, cnt)- Get daily forecast (16 days)get_air_pollution(lat, lon)orget_air_pollution(city_name, country_code)- Get air pollution datageocode(city_name, state_code, country_code, limit)- Convert city name to coordinatesreverse_geocode(lat, lon, limit)- Convert coordinates to city nameget_weather_snapshot(lat, lon)orget_weather_snapshot(city_name, country_code)- Get simplified weather for quick view dashboard or cardsis_raining(lat, lon)oris_raining(city_name, country_code)- Check if it's raining, returns a booleanget_weather_summary(lat, lon)orget_weather_summary(city_name, country_code)- Get human-readable summary in a text comma separated
API Endpoints Used
- Current Weather:
/data/2.5/weather - Hourly Forecast (4 days):
/data/2.5/forecast - Daily Forecast (16 days):
/data/3.0/onecall - Air Pollution:
/data/2.5/air_pollution - Geocoding:
/geo/1.0/directand/geo/1.0/reverse
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
agrivisor-1.0.4.tar.gz
(9.2 kB
view details)
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 agrivisor-1.0.4.tar.gz.
File metadata
- Download URL: agrivisor-1.0.4.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0ae73a3cddebb8515cfe0dabad5f3406e030b309d55d39e09f4135f3809c94b
|
|
| MD5 |
5aacb7969b7b05a600b5f8da1ccbaf6d
|
|
| BLAKE2b-256 |
270e6fecf260245df4b7e1272e116ce60b1231264f12b6f8a1f078f5ddf8d17f
|
File details
Details for the file agrivisor-1.0.4-py3-none-any.whl.
File metadata
- Download URL: agrivisor-1.0.4-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0319dabd32caaa1c35eec6032a12333d97067b7aa2fae8dcb9a7c62a67c927c3
|
|
| MD5 |
c96f932e60eee788f05c6cfaf1744d4c
|
|
| BLAKE2b-256 |
f21e4b9af3bda68be5f6e10e19ee08cdaec7a0e3eab506860d377e3f4e649ddf
|