Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 1.11 KB

README.md

File metadata and controls

52 lines (32 loc) · 1.11 KB

Github Stats

This script is used to collect statistic on contributions to Github or Github Enterprise repositories. The collected statistics are stored in Postgres databases.

Instructions

  1. Install dependencies
    pipenv install 
  1. Create Schemas
pipenv run python main.py create-schemas
  1. Add Organization and Repositories
pipenv run python main.py add-orgs
pipenv run python main.py add-repos
  1. Fetch the contributions
pipenv run python main.py get-contributions --days 30

The --days options can be used to pass the number of days in the past to consider while saving the contributions.

Note: The Access Token and URL used to acces the API can be passed with the environment variable GITHUB_TOKEN and GITHUB_URL. The connection string for the Postgres database can be passed through the environment variable DB_CONN. Following is a sample use:

    GITHUB_URL=https://github.example.com/api/v3 GITHUB_TOKEN=secrettokenxxxx33 \
    DB_CONN=posgres://ghestats:ghestats@localhost:5432/ghestats pipenv run \
    python main.py add-repos