pyRepoStats

Simple repository contribution statistics

Download as .zip Download as .tar.gz View on GitHub

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

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

The CLI provides two commands: scrape (fetch data from GitHub) and analyze (analyze cached data).

Basic command structure

# General format
repostat <command> <repository> [options]

# Or using python -m
python -m repo_stats <command> <repository> [options]

Available commands

  1. scrape - Fetch repository data from GitHub (always requires internet connection)
  2. analyze - Analyze previously fetched data (works offline by default)

Examples

Note: When using python -m repo_stats, consider passing --output_path 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.

Command-specific options

Use --help to see all available options for each command:

# See all commands
python -m repo_stats --help

# See options for scrape command
python -m repo_stats scrape --help

# See options for analyze command
python -m repo_stats analyze --help

Analyze command options

The analyze command provides various options for visualizing and summarizing repository data:

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

Contribution

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