This script is used to collect statistic on contributions to Github or Github Enterprise repositories. The collected statistics are stored in Postgres databases.
- Install dependencies
pipenv install
- Create Schemas
pipenv run python main.py create-schemas
- Add Organization and Repositories
pipenv run python main.py add-orgs
pipenv run python main.py add-repos
- 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