Git Product home page Git Product logo

github-rs's Introduction

github-rs

Service Status
TravisCI Build Status
DependencyCI DependencyStatus
AppveyorCI Build status
CodeCov codecov
crates.io crates.io

Pure Rust bindings to the Github API

Incomplete Bindings

Please look at the endpoints docs to see which endpoints are currently covered in the API.

Dependencies and Support

github-rs is intended to work on all tier 1 supported Rust systems:

  • Windows
  • Linux
  • MacOSX

Project Aims

  • Have a robust API where everything is error handled properly to avoid panics of any kind. A library is the base of an application and should be a solid foundation to be built upon
  • Cover all Github stable endpoints. Anything that's deprecated and beta should be obtained only through configuration for those features. As deprecated endpoints are removed from Github so too should they be removed from this library.
  • Having stability as part of the API. As such effort will be taken to make sure this code compiles on stable Rust, rather than nightly.
  • Ease of use. The complexity should be hidden from those not hacking on the code itself.
  • Documentation of everything so not only is it easy to hack on but finding out how to use the library should be easy to find.

Getting Started

Add the following to your Cargo.toml

[dependencies]
github-rs = "0.5"

Then in your lib.rs or main.rs file add:

extern crate github_rs
use github_rs::client::Github;

Now you can start making queries. Here's a small example to get your user information:

extern crate github_rs;
use github_rs::client::Github;

fn main() {
    let client = Github::new("API TOKEN");
    let me = client.get()
                   .user()
                   .execute();
    match me {
        Ok((headers, status, json)) => {
            println!("{}", headers);
            println!("{}", status);
            if let Some(json) = json{
                println!("{}", json);
            }
        },
        Err(e) => println!("{}", e)
    }
}

Hacking on the Library

Contributing

See CONTRIBUTING.md for more information.

License

Licensed under either of

at your option.

Licensing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

github-rs's People

Contributors

mgattozzi avatar ilpianista avatar bennyyip avatar king6cong avatar

Watchers

Bernhard Schuster avatar James Cloos avatar

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.