This program analyzes commit history from a specified Git repository, calculates Elo ratings for contributors based on their activity, and visualizes the ratings over time using animated plots.
- Elo Rating Calculation: Uses the Elo rating system to rank contributors based on their commit activity.
- Dynamic Visualization: Animates Elo ratings over time, allowing for a clear view of contributions and changes in ratings.
- Customizable Settings: Easily configure the repository path, branch, Elo parameters, inactivity thresholds, and more.
- Python 3.x
- Required Python libraries:
gitpython
pandas
matplotlib
You can install the required libraries using pip:
pip install gitpython pandas matplotlib
To run the script, execute the following command in your terminal:
python your_script.py --repo_path /path/to/your/repo --branch your_branch_name --initial_rating 1500 --K 32 --inactivity_threshold 30 --stagnant_elo_threshold 30 --days_to_show 365 --top_contributors_count 5 --name_mapping_file name_mapping.json
--repo_path
: Path to the Git repository.--branch
: The branch to analyze commits (default:master
).--initial_rating
: Initial Elo rating for contributors (default:1500
).--K
: K-factor for Elo rating adjustments (default:32
).--inactivity_threshold
: Days without commits before being considered inactive (default:30
).--stagnant_elo_threshold
: Days at 1500 before hiding contributor (default:30
).--days_to_show
: Number of days of data to show in the animation (default:365
).--top_contributors_count
: Number of top contributors to display (default:5
).--name_mapping_file
: Path to a JSON file containing author name mappings, allowing you to consolidate multiple author names into a single canonical name. For example, aname_mapping.json
file might contain:{ "EnZaXD": "EnZaXD", "FlorianMichael": "EnZaXD" }
python git_ratings_analyzer.py --repo_path /path/to/your/repo --branch main --initial_rating 1500 --K 32 --inactivity_threshold 30 --stagnant_elo_threshold 30 --days_to_show 365 --top_contributors_count 5 --name_mapping_file name_mapping.json
This project is licensed under the Apache-2.0 License. See the LICENSE file for more details.