https://github.com/arjunrn/ghe-stats
Data scraper for Github API using PyGithub
https://github.com/arjunrn/ghe-stats
github postgres pygithub python stats
Last synced: 23 days ago
JSON representation
Data scraper for Github API using PyGithub
- Host: GitHub
- URL: https://github.com/arjunrn/ghe-stats
- Owner: arjunrn
- Created: 2018-11-11T18:52:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-17T16:13:45.000Z (about 4 years ago)
- Last Synced: 2025-10-11T02:43:07.827Z (8 months ago)
- Topics: github, postgres, pygithub, python, stats
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 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
```
2. Create Schemas
```bash
pipenv run python main.py create-schemas
```
3. Add Organization and Repositories
```bash
pipenv run python main.py add-orgs
pipenv run python main.py add-repos
```
4. Fetch the contributions
```bash
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:
```bash
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
```