-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add GitHub fork statistics analysis tool with visualization, performance optimization and comprehensive tracking #4967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: netmindz <[email protected]>
|
Co-authored-by: DedeHai <[email protected]>
Both requested features have been implemented in commit 7417163: Incremental saving: The script now saves results to "tempresults.json" after every 10 repositories analyzed, with automatic cleanup on successful completion. Owner commit statistics: Added analysis of commits made by fork owners to their own repositories, including:
The new owner commit data is included in both JSON output and the summary display. Updated documentation reflects these enhancements. |
@copilot |
…acking Co-authored-by: DedeHai <[email protected]>
The slow execution was due to inefficient API usage patterns. Fixed in commit 325f408 with several optimizations: Performance improvements:
Root causes that were fixed:
Use |
@copilot please also generate a second python script that loads the json file with the collected data and displays detailed statistics both as a list and as graphs. |
Co-authored-by: DedeHai <[email protected]>
Created fork_stats_visualizer.py in commit 7b37248 with the following features: Text-based statistics:
Visual graphs (with matplotlib):
Usage: # Text-only (no extra dependencies)
python3 tools/fork_stats_visualizer.py results.json --no-graphs
# Interactive graphs
pip install -r tools/fork_stats_visualizer_requirements.txt
python3 tools/fork_stats_visualizer.py results.json
# Save plots to files
python3 tools/fork_stats_visualizer.py results.json --save-plots --output-dir ./plots Full documentation in |
Overview
This PR implements a comprehensive Python toolset to analyze the GitHub fork ecosystem for the WLED repository, addressing the need to understand fork activity and health across the project's 1,200+ forks.
Problem Statement
The WLED repository has accumulated a very high number of forks, but most appear to be inactive. Project maintainers needed insights into:
Solution
New Files Added
tools/fork_stats.py
- A production-ready Python script that uses the GitHub API to analyze repository forks with the following capabilities:tools/fork_stats_visualizer.py
- A companion visualization tool that loads JSON data and displays detailed statistics:tools/README_fork_stats.md
- Comprehensive documentation for the analysis tool covering usage, examples, and troubleshooting.tools/README_fork_stats_visualizer.md
- Complete documentation for the visualization tool with usage examples and integration guide.tools/fork_stats_visualizer_requirements.txt
- Optional dependencies (matplotlib) for graphical visualizations.Key Features
Analysis Tool:
--fast
flag skips detailed analysis of inactive forks (3+ years) for 80% speed improvementVisualization Tool:
Usage Examples
Data Collection:
Visualization:
Sample Output
Analysis Summary:
Visualizer Output:
The visualization tool provides formatted text reports with visual percentage bars and, when matplotlib is installed, generates multiple chart types including pie charts for age distribution, bar charts for activity metrics, histograms for commit distribution, and combined dashboards perfect for presentations.
Implementation Details
The toolset leverages the GitHub REST API v3 and implements sophisticated analysis including:
Testing
Impact
This toolset will enable WLED maintainers to:
The implementation is ready for immediate use and provides a complete workflow from data collection to visualization, scaling from quick analyses to comprehensive repository-wide statistics with professional presentation capabilities.
Fixes #4966
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.