This Python script collects detailed traffic statistics for all your GitHub repositories using the GitHub API. It generates:
- A comprehensive text report (
github_traffic_report.txt
) - An interactive HTML dashboard (
dashboard.html
) powered by Chart.js
The dashboard features dynamic color generation to ensure that each repository’s data is visually distinct—ideal for users with many repositories.
- Automatic GitHub User Detection: Retrieves your GitHub username via the API.
- Traffic Metrics: Fetches views and clones (last 14 days), including daily breakdowns and unique counts.
- Releases Data: Retrieves release information and download counts (if available).
- Interactive Dashboard: Visualizes data with responsive, interactive line charts.
- Modern UI: Clean, responsive design with dynamic color generation for large datasets.
- Ready-to-use Executable: An attached .exe file (
github_traffic_report_v_1.0.exe
) is available for non-technical users.
- Python 3.6+
- Libraries:
requests
,rich
, and optionallypyperclip
(for clipboard support) - A valid GitHub Personal Access Token (PAT) with appropriate permissions
-
Clone the repository:
git clone https://github.com/RomanTsisyk/GitHub-Traffic-Analysis-Tool.git cd GitHub-Traffic-Analysis-Tool
-
Install required packages:
pip install requests rich pyperclip
-
Copy your GitHub Personal Access Token (PAT) to your clipboard or have it ready.
-
Run the script:
python3 github_traffic_report.py
-
When prompted, paste or enter your PAT.
-
The script will generate:
- A text report (
github_traffic_report.txt
) - An interactive HTML dashboard (
dashboard.html
)
- A text report (
Open dashboard.html
in your browser or visit the live demo here: Live Dashboard to explore the interactive charts.
github_traffic_report.py
– Main Python scriptdashboard.html
– Interactive dashboard webpagegithub_traffic_report.txt
– Sample text report generated by the scriptgithub_traffic_report_v_1.0.exe
– Executable version for non-technical usersgithub_traffic_stats.ico
– Icon file used for the executableLICENSE
– License file (MIT License)
- Additional UI improvements and customization options.
- Extended analytics and metrics.
- Integration with other platforms for broader insights.
This project is licensed under the MIT License.
Contributions are welcome! Please open issues or submit pull requests for any improvements or feature suggestions.
I'm based in Poland and actively engaged in the open source community. For inquiries, feedback, or collaboration opportunities, feel free to contact me on LinkedIn.
Enjoy analyzing your GitHub traffic and optimizing your projects!