5 releases (breaking)

0.5.0 Jan 6, 2021
0.4.0 Sep 10, 2020
0.3.0 Aug 17, 2020
0.2.0 Nov 1, 2019
0.1.0 Oct 7, 2019

#8 in #merged

26 downloads per month

MIT/Apache

24KB
594 lines

github-stats

Crates.io docs.rs Crates.io Travis CI

A tool for using Github's API

View the examples folder for basic usage.


lib.rs:

Gets the stats of a Github repository.

Examples

Get Stats of Repository

use github_stats::Repo;

let repo = Repo::new("rust-lang", "rust", "<my user agent>").await;

match repo {
    Ok(repo) => {/* Do some stuff */},
    Err(e) => eprintln!(":("),
}

Search Latest Merged PR and Get Total Merged PR Count

use github_stats::{Query, Search};

// Gets latest merged PR
let search = Search::issues(
    &Query::new().repo("rust-lang", "rust").is("pr").is("merged"),
)
.per_page(1)
.search("<my user agent>")
.await;

match search {
    Ok(results) => println!("# of merged PRs: {}", results.total_count()),
    Err(e) => eprintln!(":("),
}

Dependencies

~5–18MB
~235K SLoC