Skip to content
This repository was archived by the owner on Aug 3, 2025. It is now read-only.

Commit 0e6178f

Browse files
feat: Add career stats feature with GitHub commit analysis and UI updates
And reformatted code
1 parent 38696f7 commit 0e6178f

File tree

10 files changed

+257
-77
lines changed

10 files changed

+257
-77
lines changed

.idea/copilotDiffState.xml

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 🔍 GitHub Language Statistics Viewer
22

3-
A dual-interface tool (Python + Web) to explore and visualize the programming languages used in any public GitHub user's repositories. View usage breakdowns, analyze code size, and generate visual summaries with ease.
3+
A dual-interface tool (Python + Web) to explore and visualize the programming languages used in any public GitHub user's
4+
repositories. View usage breakdowns, analyze code size, and generate visual summaries with ease.
45

56
---
67

docs/PAT.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# 🛡️ GitHub Personal Access Token (PAT) Guide
22

3-
This project can optionally use a **GitHub Personal Access Token (PAT)** to increase your API rate limit when fetching data. This guide explains what a PAT is, why it matters, and how to safely create and use one.
3+
This project can optionally use a **GitHub Personal Access Token (PAT)** to increase your API rate limit when fetching
4+
data. This guide explains what a PAT is, why it matters, and how to safely create and use one.
45

56
---
67

78
## 🔍 What Is a GitHub PAT?
89

9-
A Personal Access Token is like a password specifically for GitHub API access. It lets tools and scripts authenticate as *you* when making requests to GitHub — without needing your actual password.
10+
A Personal Access Token is like a password specifically for GitHub API access. It lets tools and scripts authenticate as
11+
*you* when making requests to GitHub — without needing your actual password.
1012

11-
**In this project, the PAT is used only to read public information** (like repository metadata and language stats). No scopes or write permissions are required.
13+
**In this project, the PAT is used only to read public information** (like repository metadata and language stats). No
14+
scopes or write permissions are required.
1215

1316
---
1417

@@ -46,17 +49,17 @@ So if you're querying someone with many repositories, you’ll hit the limit fas
4649

4750
4. **Configure Your Token**
4851

49-
* **Note:** Use a name like `GitHubLangStatsTool`
50-
* **Expiration:** Choose your preferred duration (30 days, 90 days, or no expiration)
51-
* **Scopes:** ✅ Leave **everything unchecked**
52+
* **Note:** Use a name like `GitHubLangStatsTool`
53+
* **Expiration:** Choose your preferred duration (30 days, 90 days, or no expiration)
54+
* **Scopes:** ✅ Leave **everything unchecked**
5255

53-
> This tool only reads public data — no scopes required.
56+
> This tool only reads public data — no scopes required.
5457
5558
5. **Generate and Copy**
5659

57-
* Click **Generate token**
58-
* GitHub will show it **once only** — copy and save it immediately
59-
* Lost it? Just regenerate a new one.
60+
* Click **Generate token**
61+
* GitHub will show it **once only** — copy and save it immediately
62+
* Lost it? Just regenerate a new one.
6063

6164
---
6265

@@ -97,7 +100,8 @@ If you're using the browser-based version:
97100
2. Paste your PAT into the **optional** input field
98101
3. The app will use it for increased rate limits
99102

100-
> **Note:** Your token never leaves your browser — but it can be accessed by browser extensions. Use caution if you have untrusted extensions installed.
103+
> **Note:** Your token never leaves your browser — but it can be accessed by browser extensions. Use caution if you have
104+
> untrusted extensions installed.
101105
102106
---
103107

docs/Python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# GitHub Language Analyzer
22

3-
A Python script that analyzes the programming languages used across a GitHub user's public repositories, with optional authentication, logging, and data visualization.
3+
A Python script that analyzes the programming languages used across a GitHub user's public repositories, with optional
4+
authentication, logging, and data visualization.
45

56
![GitHub Language Chart Example](https://img.shields.io/badge/matplotlib-enabled-blue)
67
![Colorlog Support](https://img.shields.io/badge/colorlog-enabled-green)
@@ -41,7 +42,6 @@ If omitted, the script will prompt you to enter one or continue unauthenticated.
4142

4243
> More info about [PAT here](PAT.md)!
4344
44-
4545
### 2. Run the Script
4646

4747
```bash

docs/Web.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 🧠 GitHub Language Statistics Viewer
22

3-
A browser-based tool to visualize the programming languages used across any public GitHub user's repositories. No backend required — all API requests are made client-side in your browser.
3+
A browser-based tool to visualize the programming languages used across any public GitHub user's repositories. No
4+
backend required — all API requests are made client-side in your browser.
45

56
---
67

@@ -26,6 +27,17 @@ A browser-based tool to visualize the programming languages used across any publ
2627
* **Language Summary**: A text breakdown of total bytes per language.
2728
* **Usage Chart**: A bar chart of language usage by byte count.
2829

30+
## 🎁 Bonus: Career Insights (Web Exclusive)
31+
32+
This tool offers a web-only career feature: it fetches details of the latest 100 commits from each repository and
33+
includes them in the data analysis. This enables deeper insights into coding activity, commit frequency, and recent
34+
contributions, helping users showcase their GitHub activity for career or portfolio purposes.
35+
36+
*Commit data is retrieved client-side using the GitHub API and is never stored or sent to any server.*
37+
38+
> Note this is VERY slow and API-intensive, so it is **disabled by default**. You can enable it if you provided the PAT
39+
> as well as checked the additional checkbox in the UI.
40+
2941
---
3042

3143
## 🛡 Security Notice
@@ -35,7 +47,7 @@ A browser-based tool to visualize the programming languages used across any publ
3547
> * It may be accessible to browser extensions or other JavaScript executing in the page.
3648
> * Do **not** use this tool on untrusted networks or browsers with unknown extensions.
3749
> * Prefer generating **read-only tokens** with **minimal scopes**.
38-
>
50+
>
3951
> More info about [PAT here](PAT.md)!
4052
4153
---

github_lang_analyzer.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import requests
2-
import matplotlib.pyplot as plt
3-
import sys
41
import os
2+
import sys
3+
54
import colorlog
5+
import matplotlib.pyplot as plt
6+
import requests
67

78
GITHUB_API_URL = "https://api.github.com"
89

@@ -12,10 +13,10 @@ def setup_logger():
1213
formatter = colorlog.ColoredFormatter(
1314
"%(log_color)s[%(levelname)s]%(reset)s %(message)s",
1415
log_colors={
15-
"DEBUG": "cyan",
16-
"INFO": "green",
17-
"WARNING": "yellow",
18-
"ERROR": "red",
16+
"DEBUG": "cyan",
17+
"INFO": "green",
18+
"WARNING": "yellow",
19+
"ERROR": "red",
1920
"CRITICAL": "red,bg_white",
2021
}
2122
)

index.html

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,56 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1" />
4+
<meta charset="UTF-8"/>
5+
<meta content="width=device-width, initial-scale=1" name="viewport"/>
66
<title>GitHub Language Stats Viewer</title>
7-
<link rel="stylesheet" href="static/styles.css">
8-
<link rel="icon" type="image/svg+xml" href="static/favicon.svg">
7+
<link href="static/styles.css" rel="stylesheet">
8+
<link href="static/favicon.svg" rel="icon" type="image/svg+xml">
99
</head>
1010
<body>
1111

1212
<h1>GitHub Language Statistics Viewer</h1>
1313

1414
<div id="warning" role="alert">
15-
<strong>Security notice:</strong> Please be aware that your GitHub Personal Access Token (PAT) is used only in your browser to access GitHub's API and is not stored or sent anywhere else. However, entering your token in this page exposes it to your browser environment and any extensions. Use with caution and only if you trust your extensions
15+
<strong>Security notice:</strong> Please be aware that your GitHub Personal Access Token (PAT) is used only in your
16+
browser to access GitHub's API and is not stored or sent anywhere else. However, entering your token in this page
17+
exposes it to your browser environment and any extensions. Use with caution and only if you trust your extensions
1618
</div>
1719

18-
<form id="githubForm" autocomplete="off" spellcheck="false">
20+
<form autocomplete="off" id="githubForm" spellcheck="false">
1921
<label for="username">GitHub Username <sup>*</sup></label>
20-
<input type="text" id="username" name="username" required placeholder="e.g. octocat" />
22+
<input id="username" name="username" placeholder="e.g. octocat" required type="text"/>
2123

2224
<label for="token">GitHub Personal Access Token (optional)</label>
23-
<input type="password" id="token" name="token" placeholder="Paste your PAT here to increase rate limit" />
25+
<input id="token" name="token" placeholder="Paste your PAT here to increase rate limit" type="password"/>
26+
27+
<label style="display: flex; align-items: center; gap: 0.5em;">
28+
<input disabled id="careerStats" name="careerStats" type="checkbox"/>
29+
<span style="font-size: 0.9em; color: #666;">
30+
Show total career stats <span style="font-size: 0.8em; color: #999;">(all commit history and changes)</span><br>
31+
<span>Note will only by far take 100 commits per repo</span><br>
32+
<span style="display: inline-block; background: #ffeeba; color: #856404; padding: 2px 6px; border-radius: 4px; margin-top: 2px;">
33+
Pretty slow!
34+
</span>
35+
</span>
36+
</label>
2437

2538
<button type="submit">Fetch Language Stats</button>
2639
</form>
2740

28-
<div id="results" hidden>
41+
<div hidden id="results">
2942
<h2>Language Summary</h2>
3043
<pre id="languageSummary"></pre>
44+
<div hidden id="careerResults">
45+
<h2>Total Career Language Summary</h2>
46+
<pre id="careerSummary"></pre>
47+
</div>
3148
<h2>Language Usage Chart</h2>
3249
<canvas id="languageChart"></canvas>
3350
</div>
3451

3552
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
36-
<script src="static/script.js" defer></script>
53+
<script defer src="static/script.js"></script>
3754

3855
</body>
3956
</html>

static/favicon.svg

Lines changed: 40 additions & 19 deletions
Loading

0 commit comments

Comments
 (0)