weathernoaa

Crates.ioweathernoaa
lib.rsweathernoaa
version0.2.0
sourcesrc
created_at2021-05-16 14:24:34.303303
updated_at2021-05-21 19:05:32.204618
descriptionAPI wrapper over NOAA's observatory data to find weather information
homepage
repositoryhttps://github.com/psibi/weather_noaa
max_upload_size
id398195
size51,742
Sibi Prabakaran (psibi)

documentation

README

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,
};
Commit count: 26

cargo fmt