weathervane
Weather data, air quality, and alerts from public APIs. You call the async functions, you get back clean Rust types. That's it.
No UI dependencies. No polling. No timers. No config storage. The frontend owns all of that. This crate fetches data, parses responses, handles unit conversions, and gets out of the way.
Data sources
Weather and air quality come from Open-Meteo, which is free and doesn't require an API key.
Alerts are pulled from whichever provider covers the user's location:
| Region | Provider |
|---|---|
| United States | NWS (National Weather Service) |
| Canada | ECCC (Environment and Climate Change Canada) |
| Europe | MeteoAlarm |
| Australia | BOM (Bureau of Meteorology) |
Region detection is automatic based on coordinates. Everywhere else gets weather and air quality but no alerts.
Usage
[]
= "0.2"
use ;
let weather = fetch_weather.await?;
println!;
Location detection works off the user's IP. Not precise, but good enough for weather.
use detect_location;
let location = detect_location.await?;
println!;
Air quality automatically picks the right AQI standard (US EPA or European) based on where the coordinates land.
use fetch_air_quality;
let aqi = fetch_air_quality.await?;
println!;
What's in the box
Weather: current conditions, 12-hour hourly forecast, 7-day daily forecast. Temperature, humidity, wind, pressure, UV index, visibility, cloud cover, dew point.
Air quality: AQI with region-appropriate categorization, PM2.5, PM10, ozone, NO2, CO.
Alerts: severity, headline, description, expiry. Normalized across all four providers into a single Alert type.
Units: temperature (F/C), pressure (hPa/inHg/PSI), measurement system (imperial/metric). Pass the types in, get formatted values out.
Location: city search via geocoding, IP-based auto-detection, saved location bookmarks.
Network: monitors NetworkManager over D-Bus, yields an event when connectivity comes back. Linux only, degrades gracefully elsewhere.
Sleep: monitors systemd-logind for resume from suspend, yields an event when the system wakes. Linux only, degrades gracefully elsewhere.
Building
License
MIT or Apache-2.0, your choice.