Git Product home page Git Product logo

pwr-airly's Introduction

pwr_airly

Version Documentation

pwr_airly is an unofficial client for the Airly's v2 API.

Examples

A few examples are ready for you inside the examples directory - just replace the my-api-key string with your actual key and you'll be able to run them with cargo run --example example-name.

As for a sneak peek, here's the getting-measurements-for-installation.rs:

use std::error::Error;
use std::result::Result;

use pwr_airly::AirlyClient;

fn main() -> Result<(), Box<Error>> {
    let airly = AirlyClient::new("my-api-key");

    // To query for measurements of a specific installation, you can use the `measurements().get()` method.
    // It models the <https://developer.airly.eu/docs#endpoints.measurements.installation> endpoint.
    let response = airly.measurements().get(250)?;

    // After the response has been fetched, you can use the `rate_limit()` method to access
    // information about the rate-limiting (i.e. how many requests per API key you can perform), and
    // you can use the `model()` method to access the model (contents) of the response.
    println!("{:#?}", response.rate_limit());
    println!("{:#?}", response.model());

    Ok(())
}

Roadmap

  1. Implement all the /v2/meta endpoints.
  2. Add support for asynchronous requests.

License

Copyright (c) 2018, Patryk Wychowaniec <[email protected]>.
Licensed under the MIT license.

pwr-airly's People

Contributors

patryk27 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

icodein

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.