github-repos-downloader v0.2.1

Powerful Python utility for automating comprehensive GitHub backups

Downloads your repositories and gists as ZIP archives with parallel processing for speed and detailed reporting for insight.

Python CLI GitHub Backup Utility Parallel

github-repos-downloader — a powerful Python utility for automating comprehensive backups of your GitHub repositories and gists. This tool downloads your code as .zip archives for safe keeping, with parallel processing for speed and detailed reporting for insight.

  • Complete Backup — Downloads all your GitHub repositories and gists as .zip archives in a single operation
  • Parallel Downloads — Speeds up the process by downloading multiple items simultaneously, automatically using your available CPU cores
  • Detailed Reporting — Generates a quality report with success rates, sizes, and actionable insights after each backup
  • System Automation — Optionally schedules your computer to shut down or reboot after the backup completes
  • Robust Error Handling — Implements retry logic, handles network timeouts, and protects against failed downloads
  • Secure Token Management — Stores your GitHub token securely in your system's configuration directory

Prerequisites: Python 3.7+, curl command-line tool, GitHub Personal Access Token

Installation:

git clone https://github.com/aixandrolab/github-repos-downloader.git
cd github-repos-downloader

Configure Token:

1. Go to GitHub Settings → Developer settings → Personal access tokens

2. Generate token with repo and gist scopes

3. Save token:

python app.py -t

Basic Usage:

CommandAction
python app.py -rDownload all your repositories
python app.py -gDownload all your gists
python app.py -r -gDownload both repositories and gists
python app.py -r --verboseDownload repos with detailed output
python app.py -r --timeout 120Download with 2-minute timeout per request
python app.py -r --shutdownDownload repos and shutdown when done

What Gets Backed Up?

The tool creates snapshot .zip archives of your code at a specific point in time (does not include full Git history).

  • Repositories — Saved as [repository-name].zip in the repositories/ folder
  • Gists — Saved as [gist-id].zip in the gists/ folder

Where Are Files Saved?

~/[your_github_username]_github_downloads/
├── repositories/
│   ├── project-one.zip
│   └── project-two.zip
├── gists/
│   ├── a1b2c3d4.zip
│   └── e5f6g7h8.zip
└── reports/
    └── backup_report_20251215_143022.txt

Post-Backup Archiving: By default, the entire folder is compressed into a single .zip. Use --no-archive to skip.

ArgumentDescriptionDefault
-r, --reposDownload your repositoriesFalse
-g, --gistsDownload your gistsFalse
-t, --tokenUpdate or set your stored GitHub tokenFalse
--no-archiveDo not create a final ZIP archive of the backup folderFalse
--timeout NSet the timeout for each download operation30
--verbosePrint detailed real-time informationFalse
--shutdownShutdown the computer 60 seconds after finishFalse
--rebootReboot the computer 60 seconds after finishFalse

Note: --shutdown and --reboot are mutually exclusive.

Optimizing Download Speed:

  • Uses parallel processing for batches larger than 5 items
  • Workers = CPU cores minus one for optimal performance
  • For large backups (50+ items): use --timeout 120

Handling API Rate Limits:

  • Authenticated users: 5,000 requests per hour
  • Automatic pause and retry with exponential backoff
  • Reduce max_workers parameter if needed

ProblemLikely CauseSolution
Failed to authenticateToken invalid, expired, or lacks scopesRun python app.py -t to update token
Download timeoutNetwork slow or repository largeRe-run with --timeout 120
Some items fail to downloadRepository renamed, deleted, or forkedCheck report for failures — retries up to 3 times
"curl" command not foundcurl not installed on systemInstall curl: apt install curl (Ubuntu)

  • Summary — Counts of successful/failed downloads for repos and gists
  • Statistics — File sizes and success percentages
  • Top Lists — Your 10 largest repositories and gists with the most files
  • Failure Analysis — A list of items that couldn't be downloaded
  • Insights & Recommendations — Actionable advice based on results

  • Token Storage — Stored in encrypted format at ~/.config/github_repos_downloader/github_token.json
  • No Data Sent Elsewhere — Only communicates with GitHub's API
  • Clean Operations — Temporary files deleted after use, failed downloads cleaned up

By using this software, you agree to the full disclaimer terms.

Software provided "AS IS" without warranty. You assume all risks.

Full legal disclaimer: See DISCLAIMER.md

License: BSD 3-Clause License

Links


Created by Aixandrolab

Copyright © 2025-2026, Alexander Suvorov. All rights reserved.