| Crates.io | weer_api |
| lib.rs | weer_api |
| version | 0.1.1 |
| created_at | 2022-08-31 03:26:20.106677+00 |
| updated_at | 2022-08-31 03:30:58.490803+00 |
| description | A wrapper library for using Weather API |
| homepage | |
| repository | https://github.com/Gael-devv/weer/tree/main/weer_api |
| max_upload_size | |
| id | 655458 |
| size | 37,305 |
A wrapper library for using Weather API
This is an unofficial library
Put this in your Cargo.toml:
[dependencies]
weer_api = "0.1.0"
use weer_api::{*, chrono::{Utc, TimeZone}}; let client = Client::new("api_key", true); let result = client.forecast() .query(Query::City("London".to_string())) .dt(Utc.ymd(2022, 08, 21).and_hms(0, 0, 0)) .lang(Language::Spanish) .call(); assert!(result.is_ok())
use weer_api::{*, chrono::{Utc, TimeZone}}; let client = Client::new("api_key", true); let result = client.future() .query(Query::Coords(48.8567, 2.3508)) .dt(Utc.ymd(2022, 09, 21).and_hms(0, 0, 0)) .lang(Language::Spanish) .call(); assert!(result.is_ok())
use weer_api::{*, chrono::{Utc, TimeZone}}; let client = Client::new("api_key", true); let result = client.history() .query(Query::Ip(None)) .dt(Utc.ymd(2022, 07, 21).and_hms(0, 0, 0)) .hour() .call(); assert!(result.is_ok())