Skip to main content

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) or get_current_weather(city_name, country_code) - Get current weather
  • get_hourly_forecast(lat, lon, cnt) or get_hourly_forecast(city_name, country_code, cnt) - Get hourly forecast (4 days)
  • get_daily_forecast(lat, lon, cnt) or get_daily_forecast(city_name, country_code, cnt) - Get daily forecast (16 days)
  • get_air_pollution(lat, lon) or get_air_pollution(city_name, country_code) - Get air pollution data
  • geocode(city_name, state_code, country_code, limit) - Convert city name to coordinates
  • reverse_geocode(lat, lon, limit) - Convert coordinates to city name
  • get_weather_snapshot(lat, lon) or get_weather_snapshot(city_name, country_code) - Get simplified weather for quick view dashboard or cards
  • is_raining(lat, lon) or is_raining(city_name, country_code) - Check if it's raining, returns a boolean
  • get_weather_summary(lat, lon) or get_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/direct and /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)

Uploaded Source

Built Distribution

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

agrivisor-1.0.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

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

Hashes for agrivisor-1.0.4.tar.gz
Algorithm Hash digest
SHA256 b0ae73a3cddebb8515cfe0dabad5f3406e030b309d55d39e09f4135f3809c94b
MD5 5aacb7969b7b05a600b5f8da1ccbaf6d
BLAKE2b-256 270e6fecf260245df4b7e1272e116ce60b1231264f12b6f8a1f078f5ddf8d17f

See more details on using hashes here.

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

Hashes for agrivisor-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0319dabd32caaa1c35eec6032a12333d97067b7aa2fae8dcb9a7c62a67c927c3
MD5 c96f932e60eee788f05c6cfaf1744d4c
BLAKE2b-256 f21e4b9af3bda68be5f6e10e19ee08cdaec7a0e3eab506860d377e3f4e649ddf

See more details on using hashes here.

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