Giter VIP home page Giter VIP logo

pyrepostats's Introduction

Repository Stats

CI testing codecov CodeFactor pre-commit.ci status

This simple tool aims on open-source projects providing simple repository stats which are a bit out of scope of base Git and need some more information about issues and PRs.

Highlighted features

  • cumulative caching (no need to full download, just incremental/needed update)
  • collection of overall user contributions to issues/PRs
  • visualization of aggregated timeline of past contributions

Installation

Simple install with setuptools/pip as

pip install https://github.com/Borda/pyRepoStats/archive/main.zip

or after cloning the repository

python setup.py install

Sample usage

Let's show how to pull data from Github repository, use of the following calls

  • if you just clone this repo without installation, you need to install dependencies and call script
    pip install -r requirements.txt
    python src/repo_stats/__main__.py -gh PyTorchLightning/pytorch-lightning-bolts
  • if you have already installed the package with pip or with setup.py you can call executable
    repostat -gh PyTorchLightning/pytorch-lightning-bolts -t <your-personal-token>
    or package with a pythonic way
    python -m repo_stats -gh PyTorchLightning/pytorch-lightning-bolts
    just note that with this way usage should also consider passing -o argument for output path, otherwise all caches and results will be saved in installation folder, most likely site-packages

To simplify the token passing in each call, you can export the token to environment variables export GH_API_TOKEN=<your-personal-token> for Github.

Github use-case

For GitHub users we recommend using your personal GitHub token which significantly increases request limit per hour.

Extra options

The calls above just pull the data, to get/show some results check available options python -m repo_stats.cli --help

  • To see following summary table use --users_summary "merged PRs" "commented PRs" "opened issues" "commented issues" where the fist column is used for sorting rows with users:

    user merged PRs commented PRs opened issues commented issues
    williamFalcon 74 21 14 8
    Borda 42 35 4 18
    akihironitta 17 1 5 5
    ananyahjha93 14 2 6 21
    annikabrundyn 12 0 0 2
    djbyrne 11 2 4 4
    nateraw 9 1 6 8
    teddykoker 3 2 0 0
  • With --min_contribution N you can a simple filter what is the minimal number of contribution to show users in Table or Figures.

  • You can also define a time frame with --date_from and --date_to for filtering events - created issues, merged PRs and comments/reviews.

  • We also offer showing some contribution aggregation over time such as Day/Week/Month/Year, to do you use option --user_comments W which draw following double chart: (a) cumulative aggregation over all users and (b) heatmap like image with time in Y and user in X axis. Moreover, you can also specify type such as issue or PR; so with --user_comments W issue pr you can simply get two figures - one with weekly aggregation for issue and another for PRs. The very same way you can specify multiple time sampling --user_comments W M for weekly and monthly aggregations.

    User-comments-aggregation

To deny showing figures set environment variable export SHOW_FIGURES=0.

Contribution

Any help or suggestions are welcome, pls use Issues :]

pyrepostats's People

Contributors

borda avatar dependabot[bot] avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyrepostats's Issues

add time window

๐Ÿš€ Feature

define --date-from and --date-to to allow selection of specific history zoom

Motivation

Show just some selection - time window, skip evemtually long history, etc.

add comments timeline

create a special collection of all comments with:

  • author
  • date-time
  • link issue/PR

and provide a few aggregations over time: day, week, month
also, make simple visualization with line style separation for issue/PR

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.