Crates.io | aloft |
lib.rs | aloft |
version | 0.3.1 |
source | src |
created_at | 2015-06-06 02:20:18.991843 |
updated_at | 2015-12-11 23:57:25.953017 |
description | Simple library for interacting with winds aloft data from NOAA |
homepage | https://github.com/natemara/aloft-rs |
repository | https://github.com/natemara/aloft-rs |
max_upload_size | |
id | 2312 |
size | 16,401 |
This is a sister library to aloft.py. It allows you to interact with winds aloft data from NOAA. This data is normally available as a giant blob from NOAA here and is obviously quite a pain to work with. Aloft-rs makes this easier!
Aloft-rs requires Rust Nightly (regex!
macro relies on unstable features).
[dependencies]
aloft = "*"
extern crate aloft;
use aloft::winds_aloft_for_station;
fn main() {
let winds = winds_aloft_for_station("CVG").unwrap();
println!("{:?}", winds);
println!("{:?}", winds.wind_at_altitude(12000).unwrap());
}
You can also use rustc-serialize to encode/decode the structs to/from JSON for web applications easily
extern crate aloft;
extern crate rustc_serialize;
use aloft::winds_aloft_for_station;
use rustc_serialize::json;
fn main() {
let winds = winds_aloft_for_station("CVG").unwrap();
println!("{}", json::encode(&winds).unwrap());
println!("{}", json::encode(&winds.wind_at_altitude(12000).unwrap()).unwrap());
}