Account analyzer based on GitHub's language statistics (byte-based code size from public & private repos) using the GitHub API, exporting a beautiful SVG card of your top languages.
The card:
- Shows your top 6 languages by total code size
- Uses a Kanagawa paper‑ink–inspired theme
- Updates automatically every 24 hours via GitHub Actions
How languages are measured
GitHub’s language API returns the number of bytes of code per language.
The percentages in this card are based on those byte-based sizes (not raw line counts), which matches how GitHub itself computes language stats.
Once set up, your card will live at:
https://raw.githubusercontent.com/<username>/RepositoryScanner/main/assets/languages.svgExample usage in a profile README:
## My Coding Languages
Replace <username> with your GitHub username.
If the card doesn’t seem to update right away, append a dummy query parameter like
?v=1to bypass browser caching:
- Comprehensive analysis: scans both public and private repositories
- Top 6 languages by total code size
- Kanagawa theme for a clean, paper‑ink look
- Auto‑updates daily via GitHub Actions
- SVG output that looks sharp anywhere (profile, docs, dashboards)
- Configurable excluded languages and colors
- Click Fork at the top‑right of this page.
- Work from your forked copy (
<username>/RepositoryScanner).
- Go to
https://github.com/settings/tokens - Click “Generate new token (classic)” or create a fine-grained token.
- Give it a name (e.g.
RepositoryScanner Token). - Enable scopes:
repo(for private repositories) orpublic_repoif you only care about publicread:user
- Generate and copy the token (you won’t see it again).
In your forked repository:
- Go to Settings → Secrets and variables → Actions.
- Click “New repository secret” and add:
| Secret name | Required | Example value | Notes |
|---|---|---|---|
GH_TOKEN |
✅ | ghp_xxxxxxxxxxxx |
Your personal access token |
GITHUB_USERNAME |
✅ | your_github_username |
The account to analyze |
EXCLUDED_LANGS |
❌ | HTML,CSS,Dockerfile |
Comma‑separated list of languages to skip |
GITHUB_USERNAMEis used by the script and in the workflow.
For backwards compatibility,USERNAMEis also supported and will be used ifGITHUB_USERNAMEis not set.
EXCLUDED_LANGSis optional; use it to ignore markup / infra languages.
- Go to the Actions tab in your forked repo.
- Click “Update Language Stats”.
- Click “Run workflow” (select
main). - Wait for it to finish (usually 30–60 seconds).
When it succeeds, you should see a new/updated file:
assets/languages.svg
in your repository.
In your username/username profile repo, add:
## My Coding Languages
Replace <username> with your GitHub username.
You can run the generator locally for debugging or customization.
git clone https://github.com/<username>/RepositoryScanner.git
cd RepositoryScannerUse Python 3.10+ (3.11 recommended).
# Optional but recommended:
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install required packages
pip install --upgrade pip
pip install requests python-dotenvThe
requirements.txtmay be updated later; for now the core deps arerequestsandpython-dotenv.
You can either:
Option A – .env file
-
Copy the example:
cp .env.example .env
-
Edit
.envand fill in:GH_TOKEN=ghp_xxxxxxxxxxxx GITHUB_USERNAME=your_github_username EXCLUDED_LANGS=HTML,CSS,Dockerfile
Option B – Shell exports
export GH_TOKEN="ghp_xxxxxxxxxxxx"
export GITHUB_USERNAME="your_github_username"
export EXCLUDED_LANGS="HTML,CSS,Dockerfile"Note: On some systems,
USERNAMEis already set by the OS (e.g. your local login name).
PreferGITHUB_USERNAMEto avoid confusion. For backwards compatibility,USERNAMEis still supported.
From the repository root:
python scripts/fetch_languages.pyIf everything is configured correctly, you’ll get:
assets/languages.svg
Open it in a browser or image viewer to preview.
The workflow file is:
.github/workflows/update-chart.yaml
It is configured to:
- Run daily at 00:00 UTC:
schedule: - cron: "0 0 * * *"
- Run on demand via “Run workflow”
- Commit updated
assets/languages.svgback tomain
Edit .github/workflows/update-chart.yaml and adjust the cron line. Examples:
- Every 12 hours:
- cron: "0 */12 * * *"
- Every Monday at midnight:
- cron: "0 0 * * 1"
- First day of every month:
- cron: "0 0 1 * *"
| Variable | Required | Description | Example |
|---|---|---|---|
GH_TOKEN |
✅ | GitHub personal access token | ghp_xxxxxxxxxxxx |
GITHUB_USERNAME |
✅ | GitHub username to analyze | mavantgarderc |
EXCLUDED_LANGS |
❌ | Comma‑separated languages to ignore | HTML,CSS,Dockerfile |
For backwards compatibility,
USERNAMEis also supported and will be used ifGITHUB_USERNAMEis not set.
IfGH_TOKENis not set, only public repositories will be analyzed and GitHub’s unauthenticated rate limits will apply. Using a token is strongly recommended.
The Kanagawa color palette and per‑language colors are defined in:
scripts/colors.py
Adjust them there to change the chart’s look.
The SVG layout (sizes, spacing, font sizes, bar widths, etc.) is defined in the SVG generation logic inside:
scripts/fetch_languages.py
Modify that function if you want a different layout.
- Uses GitHub’s API to read:
- Your list of repositories
- Language statistics per repository
- Does not read your actual code content.
- Tokens are read from:
- Local
.env/ environment (for local development) - GitHub Secrets (for Actions), never committed to the repo.
- Local
Best practices:
- Keep your
GH_TOKENprivate and never commit it. - Use GitHub Actions secrets for tokens.
- If you only care about public repos, you can use a token with just
public_repoinstead of fullrepo.
- Ensure
GH_TOKENis set and valid. - Confirm it has
repo+read:userscopes (orpublic_repoif you only use public repos). - Without a token, you may hit GitHub’s unauthenticated rate limits quickly.
Possible causes:
- All repos are forks (these are filtered out).
- All languages are in
EXCLUDED_LANGS. - Token doesn’t have access to private repos you expect to see.
- You’re running without
GH_TOKENand GitHub has rate-limited unauthenticated requests.
-
Check that GitHub Actions are enabled for your repo.
-
Ensure the workflow file is named and located exactly as:
.github/workflows/update-chart.yaml -
Verify YAML syntax (you can use the Actions editor’s validator).
-
Confirm you pushed changes to the
mainbranch (or adjust the workflow branches).
Contributions are welcome!
- Report bugs / issues
- Suggest new features
- Improve design and theming
- Enhance documentation
- Add more configuration options
Open a PR or issue on GitHub.
This project is distributed under the MIT License.
Inspired by:
Kanagawa color theme influenced by: