A Streamlit dashboard that analyzes a GitHub user's activity and visualizes:
- Commit patterns over time (heatmap)
- Weekly code additions/deletions (line chart)
- Top active repositories (pie chart)
- Summary metrics (total commits, active repositories, total lines added)
Web URL: https://githu8-activity-analyzer.streamlit.app/
- Clean, responsive Streamlit UI with custom styling
- GitHub API data extraction using
PyGithub - Commit and code frequency processing with
pandas - Visual analytics using
matplotlibandseaborn - Progress logs shown in-app while data is being fetched
github-analyzer/
├── app.py # Streamlit entrypoint and UI
├── data_extractor.py # GitHub authentication + data extraction
├── data_processor.py # Data transformation with pandas
├── visualizer.py # Chart generation (heatmap/line/pie)
├── test_auth.py # Quick token authentication check
├── requirements.txt # Python dependencies
└── .env # Environment variables (local only)
- Input Username: User enters a GitHub username in the Streamlit app.
- Extract Data (
data_extractor.py):- Loads
GITHUB_TOKENfrom.env - Authenticates with GitHub
- Iterates through user repositories
- Collects:
- Commit metadata (
repo,date) - Weekly code frequency (
week_timestamp,additions,deletions)
- Commit metadata (
- Loads
- Process Data (
data_processor.py):- Converts raw lists to DataFrames
- Parses timestamps/datetimes
- Derives analysis columns for visualization
- Visualize Data (
visualizer.py):- Commit heatmap (day of week × week of year)
- Additions vs deletions over time
- Top 5 active repositories
- Render Dashboard (
app.py):- Displays key metrics and charts
- Shows progress logs during fetch/processing
- Python 3.10+ (recommended)
- A GitHub Personal Access Token with read access to repositories/activity
-
Clone the repository:
git clone https://github.com/Tharindu-Nimsara/github-activity-analyzer.git cd github-activity-analyzer -
Create and activate a virtual environment:
Windows (PowerShell):
python -m venv venv .\venv\Scripts\Activate.ps1 -
Install dependencies:
pip install -r requirements.txt
Create a .env file in the project root:
GITHUB_TOKEN=your_github_personal_access_tokenKeep your token private. Do not commit
.envto source control.
streamlit run app.pyThen open the local URL shown in the terminal (usually http://localhost:8501).
Use the helper script to verify token setup:
python test_auth.pyExpected success output:
Successfully authenticated as: <your_username>
After generating a report, the app shows:
- Key Metrics
- Total Commits Found
- Active Repositories
- Total Lines Added
- Commit Activity Heatmap
- Commits by day of week and week of year
- Code Frequency Over Time
- Weekly additions vs deletions
- Top 5 Active Repositories
- Distribution by commit count
- GitHub API rate limits can affect data retrieval.
- Some repositories may not return stats (e.g., empty/inactive repos).
- Code frequency data depends on GitHub-generated repository statistics availability.
- Frontend/App: Streamlit
- Data Access: PyGithub, python-dotenv
- Data Processing: pandas, numpy
- Visualization: matplotlib, seaborn
- "No data found or API limit reached"
- Check
GITHUB_TOKENvalidity and scopes. - Retry after API rate limit reset.
- Check
- Authentication failed
- Recreate token and update
.env. - Run
python test_auth.pyto verify credentials.
- Recreate token and update
- Missing dependencies
- Re-run
pip install -r requirements.txtinside your active virtual environment.
- Re-run
No license file is currently included in this repository.
Developed by Tharindu Nimsara.