This tool can be used to back up users' GitHub repositories in case they need them later.
Project description
Github Dumper
Github Dumper is a Python program designed to search for users' GitHub repositories and download the repositories. This tool can be used to back up users' GitHub repositories in case they need them later.
Install:
pip install -U dump-github
Usage:
usage: dump-github [-h] [-d] [-p] [--token TOKEN] [--limit_size LIMIT_SIZE] username
Backup users github repo.
positional arguments:
username
options:
-h, --help show this help message and exit
-d, --download_zip only download zip file
-p, --print only print urls
--token TOKEN GitHub personal access token (or set GITHUB_TOKEN)
--limit_size LIMIT_SIZE
limit size(MB) of download zip file, if 0 then no limit(default:100).
https://github.com/Core2002/dump_github
Authentication (token)
GitHub’s API requires a proper Authorization: Bearer <token> header. This tool accepts a personal access token in two ways (first match wins):
--tokenon the command lineGITHUB_TOKENenvironment variable (if--tokenis empty)
Why use a token?
- Private repositories: Without a token, only public repos are listed and can be cloned or archived. With a token that has the right scopes, you can include private repos you are allowed to access (for example when backing up your own account).
- Rate limits: Authenticated API requests get a much higher limit than anonymous requests.
How the token is used
- Listing repos (
GET /users/{username}/repos): sent asBeareron the REST API. - Clone (default mode): HTTPS clone URL is turned into
https://x-access-token:<token>@github.com/...sogit clonecan access private repos. - Zip download (
-d): uses the repository archive (zipball) API with the sameBearerheader (viacurl), which works for private repos; without a token, public archive URLs are used instead.
Create a token under GitHub → Settings → Developer settings → Personal access tokens. For private repo backup, enable access to repository contents (classic PAT: repo scope; fine-grained: read access to the repositories you need).
Examples
# Public repos only (no token)
dump-github Core2002 -p
# Token on the command line (private + higher API limits)
dump-github username --token ghp_xxxxxxxxxxxx
# Same, via environment variable (recommended to avoid shell history)
export GITHUB_TOKEN=ghp_xxxxxxxxxxxx
dump-github Core2002 -d
Security note: Do not commit tokens or paste them into shared logs. Prefer GITHUB_TOKEN in a local shell profile or a secret manager, and rotate the token if it leaks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dump_github-0.1.8-py3-none-any.whl.
File metadata
- Download URL: dump_github-0.1.8-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75c4805bb09956ff0e909398a1431c8150ec879b0abb4b9a44aff4fbaf492cde
|
|
| MD5 |
d93ffe64eac1a8ebbb289cf7b4c3a0d6
|
|
| BLAKE2b-256 |
04f198cb981ed7e6f4d05a0e698f0a1a9c5550058a4f03897fdec9e0eb68fb75
|