This repo contains all the code produced for this blog post. Through the streamlit dashboard it's possible to explore the following metrics on a target git repository:
- Commits over time (waffle github-like activity chart)
- Top contributors
- Lines changed/added
- Cumulative lines changed by contributor
- Filter on specific time frame
- Drill down on a specific contributor
This dashboard is publicly available at this url.
Run the streamlit app:
streamlit run app/dashboard.py
The dashboard can ingest data in two ways:
- Provide a url for a remote repository (disclaimer: this solution might take a while to process long commit histories). Consider using 2 if dealing with long commit histories.
- Upload a .json file exported using the
app/repo.py
utility.
app/repo.py
can be used in the following way:
$ python app/repo.py -h
usage: repo.py [-h] [-f OUTPUT_FORMAT] [-o OUTPUT_PATH] [-s SINCE] [-t TO] repo_path
Extract commit hisotry and information from a target repo
positional arguments:
repo_path The path of the repo. This can be a path on your machine or a link to
a hosted service (e.g https://github.com/andodet/myrepo.git)
optional arguments:
-h, --help show this help message and exit
-f OUTPUT_FORMAT, --output-format OUTPUT_FORMAT
Format of the output file
-o OUTPUT_PATH, --output-path OUTPUT_PATH
Path of the output file
-s SINCE, --since SINCE
Start date
-t TO, --to TO End date
This dashboard and blog post has been heavily inspired by this hackernews post.