#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

#4 in #noaa

44 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–20MB
~309K SLoC