Scan all your GitHub repositories at once and generate a clean summary for each project in one run. π¦
This script reads account credentials from keys.csv, calls the GitHub API for each account's owned repositories, and produces documentation-ready output files.
- Scan multiple accounts in one command
- Capture technologies used in each repo
- Extract README-based project summaries
- Generate JSON, CSV, and Markdown reports
- Generate a beautiful HTML dashboard containing detailed readmes and commit histories
- Support encrypted key files for safer token handling
You can encrypt your key file using a user-defined string so tokens are not stored in plain text.
- If the input file is encrypted, scanning requires
--decrypt-key. - If
--decrypt-keyis missing or incorrect, the script exits with an error. - You can export a decrypted file when needed.
python github_scan.py --input keys.csv --encrypt-input --encrypt-key "your-secret-string"Default encrypted output: keys.enc
Custom encrypted output path:
python github_scan.py --input keys.csv --encrypt-input --encrypt-key "your-secret-string" --encrypted-output secure\my-keys.encpython github_scan.py --input keys.enc --decrypt-key "your-secret-string" --output-dir outputpython github_scan.py --input keys.enc --decrypt-key "your-secret-string" --export-decrypted key.decrypted.csvCreate one token per GitHub account and grant only repo scope.
- Sign in to GitHub for the account you want to scan.
- Open
Settings. - Go to
Developer settings. - Go to
Personal access tokens. - Select
Tokens (classic). - Click
Generate new tokenand thenGenerate new token (classic). - Set a note and expiration as needed.
- Under scopes, select only
repo. - Click
Generate tokenand copy it immediately. - Add it to
keys.csvasusername,token.
Repeat for each account you want to include in the scan.
python github_scan.py --input keys.csv --output-dir outputpython github_scan.py --input keys.csv --output-dir output --timeout 45 --pause 0.2python github_scan.py --input keys.csv --encrypt-input --encrypt-key "your-secret-string"
python github_scan.py --input keys.enc --decrypt-key "your-secret-string" --output-dir outputpython github_scan.py --input keys.enc --decrypt-key "your-secret-string" --export-decrypted key.decrypted.csvpython github_scan.py --input keys.csv --encrypt-input --encrypt-key "your-secret-string" --encrypted-output secure\my-keys.encpython github_scan.py --helppython generate_dashboard.py --input keys.csv --output-dir outputIf using an encrypted key file:
python generate_dashboard.py --input keys.enc --decrypt-key "your-secret-string"keys.csv must contain one account per line:
username,github_personal_access_tokenExample:
octocat,ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
my-org-bot,ghp_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyRunning the scanner creates files under output/:
output/repositories.json: full structured repository dataoutput/repositories.csv: flattened repository list for spreadsheetsoutput/repository-report.md: human-readable inventory report with technologies and README summariesoutput/project-summaries.md: compact summary table (owner,repo,technologies,tags,summary,url)
Running generate_dashboard.py creates:
output/index.html: A premium dark-mode dashboard card listing for all repositories.output/repos/*.html: Detailed subpages for each repository containing the full rendered README, commit counts, and a complete commit trace.
Each repository now includes:
language: GitHub primary languagelanguages: all detected repository languages (from GitHub language stats)technologies: inferred technology stack from language stats and README keywordstags: hashtag-style labels derived from technologies (example:#python #django #react)readme_summary: short summary extracted from the repository README
python github_scan.py --input keys.csv --output-dir outputOptional arguments:
--timeout 30request timeout in seconds (default: 30)--pause 0.0delay in seconds between account scans (default: 0.0)--decrypt-key "..."decrypt key for encrypted input file--encrypt-inputencrypt the input key file and exit--encrypt-key "..."user-defined key for encryption--encrypted-output pathcustom output path for encrypted file--export-decrypted pathexport decrypted key file and exit
python generate_dashboard.py --input keys.csv --output-dir outputOptional arguments for generate_dashboard.py:
--config scan_config.inipath to INI config file--input keys.csvpath to plain or encrypted input CSV--output-dir outputdirectory for generated HTML files--decrypt-key "..."decrypt key for encrypted key file input
- Tokens are used only for API requests and are never written to output files.
- The script continues scanning other accounts if one token fails.
- Ensure each token has permissions to read repositories for its account.
License: MITPython 3.10+GitHub API v3Status: Active
This project is licensed under the MIT License. See LICENSE for details.