2 releases

0.1.1 Aug 31, 2022
0.1.0 Aug 31, 2022

#364 in HTTP client

Download history 2046/week @ 2024-12-15 1864/week @ 2024-12-22 2071/week @ 2024-12-29 2377/week @ 2025-01-05 2723/week @ 2025-01-12 2254/week @ 2025-01-19 2263/week @ 2025-01-26 2234/week @ 2025-02-02 2523/week @ 2025-02-09 2752/week @ 2025-02-16 1874/week @ 2025-02-23 1611/week @ 2025-03-02 1839/week @ 2025-03-09 2458/week @ 2025-03-16 2710/week @ 2025-03-23 2601/week @ 2025-03-30

9,798 downloads per month

MIT license

37KB
987 lines

Weer api

A wrapper library for using Weather API

This is an unofficial library

Usage

Put this in your Cargo.toml:

[dependencies]
weer_api = "0.1.0"

Examples

Get forecast

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())

Get future

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())

Get history

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())

License

Dependencies

~9MB
~218K SLoC