Various statistics on the pull requests in your repo.
Usage:
   github-pr-stats [options] <user> [<repo>]
   github-pr-stats --version
   github-pr-stats (-h | --help)
Options:
   -h --help                     Show this screen.
      --version                  Print the program's installed version.
      --github-url=<url>         Github Enterprise URL.
      --basic                    Basic statistics about merged/closed rate.
      --days-open                Analyze number of days opened.
      --comments                 Analyze number of comments created.
      --day-created              Analyze day of the week opened.
      --day-closed               Analyze day of the week closed.
      --hour-created             Analyze hour of the day opened.
      --hour-closed              Analyze hour of the day closed.
      --week-created             Analyze week opened.
      --week-closed              Analyze week closed.
      --user-creating            Analyze user who opened.
      --user-closing             Analyze user who closed.
      --labels                   Analyze attached labels.
      --additions                Analyze number of lines added.
      --deletions                Analyze number of lines deleted.
      --bucketSize=<bucketSize>  The size of the display groups for line
                                 additions and deletions. [default: 10]
      --since=<date>             Only consider pull requests opened on or after
                                 this date.
      --until=<date>             Only consider pull requests opened before this
                                 date.
      --plugins=<plugins>        Comma-separated list of plugins to load.
[$]> github-pr-stats --basic --user-creating ifixit itbrokeand.ifixit.com
 99.0% (20 of 20) closed pulls merged.
User Creating Pull Request
###############################################################################
████                                                         1  treyhunner
██████████████████████████████████████████████████████████  12  danielbeardsley
█████████████████████████████████                            7  xiongchiamiov
[$]> pip install github-pr-stats
or
[$]> easy_install github-pr-stats
I highly recommend using virtualenv:
[$]> python3 -m venv env
[$]> source env/bin/activate
[$]> pip install -r requirements.txt
[$]> pip install -e . # So we can import the version from inside bin/ .
github-pr-stats has a plugin architecture to allow you to run arbitrary additional code without hacking the source.
A plugin should implement three functions that gain access to the full environment at different points in the analysis process:
- setup(globalEnv, localEnv)- called once when we first initialize variables
- analyze_pull(globalEnv, localEnv)- called for every pull request
- print_report(globalEnv, localEnv)- called once after all analysis is done
Take a look at the examples in github_pr_stats/example_plugins/ for more
information.
- (Feature) Add Github Enterprise support (#3, @arikon).  You'll need to
reauthenticate or change the [github-pr-stats]section in~/.gitconfigto[github-pr-stats "github.com"].
- (Bugfix) Allow importing of plugins on systems using pip install.
Pulled.
- (Feature) Add plugin architecture.
- (Feature) Add percentages to all data points.
- (Feature) Optionally analyze all of a user's repos.
- (Feature) --labelsnow shows the count of pulls without a label.
- (Feature) Add LOC analysis with --additionsand--deletions.
- (Bugfix) Fix broken mean in --basic.
- (Bugfix) Don't error on repos without issues.