fosskers/credit

credit is a fast tool for measuring Github contributions

Credit

credit is a fast tool for measuring Github contributions.

Use credit to find out:

  • Who the most productive developers are in a given country.
  • Who has the most Pull Requests merged to a project.
  • Who engages in the most discussion in Issues and PRs.
  • How long it takes maintainers to respond to and solve Issues.
  • How long it takes to get PRs merged.
  • If a library would be a safe long-term (i.e. maintained) dependency.

Table of Contents

  • Credit
    • Installation
      • Arch Linux
      • Cargo
    • Usage
      • Repository Analysis
        • Markdown Output
        • JSON Output
        • Large Projects
      • Developer Rankings
    • Configuration
    • FAQ
      • How accurate is this?
      • Can I see commit counts too?
      • Why do the Median and Average values differ?

Installation

Arch Linux

With an AUR-compatible package manager like aura:

sudo aura -A credit-bin

Cargo

cargo install credit

Usage

To use credit, you'll need a Github Personal Access Token with public_repo permissions. See here for an additional example.

💡 Note: credit calls the GraphQL-based Github v4 API, which has a much higher rate limit than the REST-based v3 API. This allows credit to run quickly and work on projects with a long development history.

You can use credit limit to check your current API query allowance.

Repository Analysis

Markdown Output

By default, credit outputs text to stdout that can be piped into a .md file and displayed as you wish:

> credit repo --token=<token> rust-lang/rustfmt

# Project Report for rustfmt

## Issues

2462 issues found, 2189 of which are now closed (88.9%).

- 1899 (77.1%) of these received a response.
- 1553 (63.1%) have an official response from a repo Owner or organization Member.

Response Times (any):
- Median: 10 hours
- Average: 34 days

Response Times (official):
- Median: 13 hours
- Average: 39 days

## Pull Requests

1821 Pull Requests found, 1650 of which are now merged (90.6%).
168 have been closed without merging (9.2%).

- 1505 (82.6%) of these received a response.
- 1379 (75.7%) have an official response from a repo Owner or organization Member.

Response Times (any):
- Median: 8 hours
- Average: 2 days

Response Times (official):
- Median: 12 hours
- Average: 2 days

Time-to-Merge:
- Median: 17 hours
- Average: 3 days

## Contributors

Top 10 Commentors (Issues and PRs):
1. nrc: 2772
2. topecongiro: 1526
3. marcusklaas: 718
4. calebcartwright: 461
5. scampi: 331
6. kamalmarhubi: 120
7. rchaser53: 103
8. cassiersg: 100
9. gnzlbg: 79
10. otavio: 63

Top 10 Code Contributors (by merged PRs):
1. topecongiro: 513
2. marcusklaas: 125
3. calebcartwright: 74
4. nrc: 72
5. scampi: 64
6. rchaser53: 57
7. davidalber: 34
8. kamalmarhubi: 31
9. ayazhafiz: 28
10. sinkuu: 24

💡 Tip: You can pass multiple repos at once to the repo command. The results will be aggregated, which can give a good view of contributions across an organization.

JSON Output

You can also output the raw results as --json, which could then be piped to tools like jq or manipulated as you wish:

> credit repo --token=<token> rust-lang/rustfmt --json

Large Projects

By default, credit queries for Issues and Pull Requests at the same time, which is fast and works well for most projects. For very large projects, however, this can make the Github API unhappy.

If you notice credit failing on projects ones with many thousands of Issues and Pull Requests, consider the --serial flag. This will pull Issues first, and then Pull Requests. --serial allows credit to even work on the Rust compiler itself!

> credit repo --token=<token> rust-lang/rust --serial

Developer Rankings

credit users can be used to determine a rough list of the most productive Open Source programmers in a given country. This reports a similar number to the one seen on a "Contribution Calendar", although contributions to private repositories have been subtracted.

> credit users --token=<token> --location=Switzerland

💡 Note: Due to the nature of the query made to Github, the data fetching will take several minutes to complete.

# Top 100 Open Source Contributors in Switzerland

There are currently 18518 Github users in Switzerland.

  1. oleg-nenashev (7331 contributions)
  2. cclauss (6378 contributions)
  3. dpryan79 (5604 contributions)
  4. peterpeterparker (4869 contributions)
  5. ReneNyffenegger (4722 contributions)
  6. eregon (4415 contributions)
  7. jeremytammik (3864 contributions)
  8. liufengyun (3787 contributions)
  9. swissspidy (3775 contributions)
 10. pvizeli (3706 contributions)
... and so on

As with repo, the --json flag can be used to output JSON data instead.

Configuration

A configuration file can be specified at your XDG_CONFIG_HOME, which by default is $HOME/.config/credit.toml.

# Your Github Access Token. With this set, you need not pass `--token` on the command line.
token = "abc123"

FAQ

How accurate is this?

The numbers given by credit are not perfect measures of developer productivity nor maintainer responsiveness. Please use its results in good faith.

Response Times: Particularly in the Open Source world, volunteer developers are under no obligation to respond in a time frame that is most convenient for us the users.

Merged PRs: Without human eyes to judge a code contribution, its importance can be difficult to measure. Some PRs are long, but do little. Some PRs are only a single commit, but save the company. credit takes the stance that, over time, with a large enough sample size, general trends of "who's doing the work" will emerge. Expect weird results for one-man projects or projects that otherwise have a long history of pushing directly to master without using PRs.

User Rankings: What is a "Top Developer" anyway? Since it is possible to artificially inflates one's contribution numbers, credit uses the following assumption to filter out false positives:

Users with both high contribution counts and somewhat high follower counts must be working on something of value.

So, at first only the top 1,000 most followed developers are considered. Afterward, other metrics are applied to arrive at a fair list of the Top 100.

Can I see commit counts too?

Yes! Pass --commits to the repo command. Keep in mind that this requires more data from Github, and so will take longer to complete.

Why do the Median and Average values differ?

Given the presence of outliers in a data set, it can sometimes be more accurate to consider the Median and not the Mean.

In the case of maintainer response times, consider a developer who usually responds to all new Issues within 10 minutes. Then he goes on vacation, and misses a few until his return 2 weeks later. His Average would be skewed in this case, but the Median would remain accurate.

credit doesn't attempt to remove outliers, but might in the future.

Versions

Find the latest versions by id

v1.4.0 - Feb 06, 2021

Added

  • A config file can now be defined at your XDG_CONFIG_HOME, which by default is $HOME/.config/credit.toml. At the moment the only field is token:

With this, you no longer need to pass --token on the command line.

Changed

  • The dependency reqwest has been removed in favour of raw curl. This reduces dependency count by about 100 crates, and the final stripped binary size is now 1.5mb, down from about 4.5mb.

v1.3.0 - Aug 24, 2020

Added

  • A --version flag to display the current version of credit.

v1.2.1 - Aug 11, 2020

  • Swapped isahc for reqwest, which allows credit to be compiled with the MUSL target and be fully statically linked.

v1.2.0 - Jul 22, 2020

Added

  • New users command to produce per-country Developer Rankings.

v1.1.1 - Jul 18, 2020

Changed

  • Better release profile which produces smaller binaries.

v1.1.0 - Jun 29, 2020

Added

  • New --start and --end options for repo that will only consider contributions/comments between the given dates.
  • New --commits option for repo. This adds another contributor ranking: the number of commits that appear in merged PRs. Keep in mind that using this requires more data from Github, and so takes longer to complete.

v1.0.0 - Jun 28, 2020

Added

  • New repo command that holds the old default behaviour. Use this to analyse projects.
  • New limit command for reporting the remaining Github API query allowance for a given token.
  • New json command for generating a full Markdown report for JSON results produced by a previous run of credit repo --json.

Changed

  • credit now uses the GraphQL-based V4 Github API. This has drastically improved performance and uses far less of a user's API quota upon each run.

v0.2.0 - Jun 22, 2020

Changed

  • Allow multiple repositories to be checked at the same time. Their results are aggregated into a single report.

v0.1.0 - Jun 19, 2020

This is the initial release.

Information - Updated Jan 17, 2022

Stars: 25
Forks: 2
Issues: 0

Repositories & Extras

CLI

317

electron-hardener

A Rust library and command line tool to harden Electron binaries against runtime behavior modifications

electron-hardener

This is a Rust command line tool that calculates a histogram of the separate types...

This is a Rust command line tool that calculates a histogram of the separate types of JSON records in an input JSON log file (one...

This is a Rust command line tool that calculates a histogram of the separate types...

cmsis-pack-manager

is a python module, Rust crate and command line utility for managing current device information that is stored in many CMSIS PACKs

cmsis-pack-manager

Find all your notes with one command!

Todo_r is a simple rust command line utility that keeps track of your todo items in code

Find all your notes with one command!

A Rust command line utility tool to connect to the QuanticTelecom captive portal

So far, the only mode supported so far requires providing password and login

A Rust command line utility tool to connect to the QuanticTelecom captive portal

Rust Command Line Experiment

This is just a little learning exercise on how to write a command line application in rust and manipulate the

Rust Command Line Experiment

Rust command-line program to automatically RSVP new Meetup events

I still haven't gotten meetup's API to respond and haven't heard back from Meetup

Rust command-line program to automatically RSVP new Meetup events

The crs command is a Rust version of the Carbon CLI

The crs command is a Rust version of the jq for pretty-printing

The crs command is a Rust version of the Carbon CLI
Facebook Instagram Twitter GitHub Dribbble
Privacy