#weather #noaa #information #api-wrapper #data #find #station

bin+lib weathernoaa

API wrapper over NOAA's observatory data to find weather information

2 unstable releases

0.2.0 May 21, 2021
0.1.0 May 16, 2021

#3 in #noaa

Download history 2/week @ 2024-01-05 2/week @ 2024-01-12 1/week @ 2024-02-09 11/week @ 2024-02-16 29/week @ 2024-02-23 25/week @ 2024-03-01 19/week @ 2024-03-08 14/week @ 2024-03-15 15/week @ 2024-03-22 52/week @ 2024-03-29 15/week @ 2024-04-05 11/week @ 2024-04-12 10/week @ 2024-04-19

90 downloads per month
Used in cnx-contrib

MIT license

21KB
501 lines

weathernoaa

CI

API wrapper over NOAA's observatory data to find weather information. For finding the weather information, you need to know the name of the station code which can be obtained from here.

Usage

use anyhow::Result;
use weathernoaa::weather::*;

#[tokio::main]
async fn main() -> Result<()> {
    let result = get_weather("VOBL".into()).await?;
    println!("{:?}", result);
    Ok(())
}

Running it will give this:

WeatherInfo {
 station: None,
  weather_time:
   WeatherTime {
    year: 2021,
    month: 5,
    day: 16,
    time: "1200 UTC",
   },
  wind:
   WindInfo {
    cardinal: "SSW",
    azimuth: "210",
    mph: "10",
    knots: "9",
   },
  visibility: "4 mile(s):0",
  sky_condition: "partly cloudy",
  weather: Some("light drizzle"),
  temperature: Temperature {
    celsius: 26,
    fahrenheit: 78,
  },
  dewpoint: Temperature {
    celsius: 19,
    fahrenheit: 66,
  },
  relative_humidity: "65%",
  pressure: 1010,
};

Dependencies

~8–21MB
~335K SLoC