Skip to main content

Backup and archive Git Repos and Gists from GitHub

Project description

githubtakeout

Backup and archive Git Repos and Gists from GitHub


Supported Python Versions


About:

githubtakeout is a data export tool for backing up and archiving Git repositories hosted on GitHub. It clones a user's repos and creates an archive of each.

It supports public/private repos and public/secret gists. By default, it doesn't save commit history or branches (.git directory), or Gist repositories (both can be enabled with command line options).

When you run the program, archives of your repos will be saved in a directory named backups inside your current working directory, unless a different location is specified using the --dir option.

Archives are saved in compressed zip format (.zip) by default. You can also save as tarballs (.tar.gz) using the --format=tar option, or skip archiving using the --format=none option.

Requirements:

  • Python 3.12+
  • Git 1.7+

Installation:

Install from PyPI:

pip install githubtakeout

Authentication:

By default, githubtakeout will only retrieve an account's public repos. To access private repos and secret gists, you need to authenticate.

First, you must create a personal access token on Github (either a fine-grained or classic personal access token). Once you have a token, you can set the GITHUB_TOKEN environment variable:

$ export GITHUB_TOKEN=<access token>

If you prefer to be prompted for your token each time you run the program, use the --token argument.

CLI Options:

usage: githubtakeout [-h] [--dir DIR] [--pattern PATTERN] [--format {tar,zip,none}] [--gists] [--history] [--list] [--token] username

positional arguments:
  username                 github username

options:
  -h, --help               show this help message and exit
  --dir DIR                output directory (default: .)
  --pattern PATTERN        regex matching repo names (default: .*)
  --format {tar,zip,none}  archive format (default: zip)
  --gists                  include gists
  --history                include commit history and branches (.git directory)
  --list                   list repos only
  --token                  prompt for auth token

Usage Examples:

Install from PyPI with pipx, Run:

pipx install githubtakeout
githubtakeout <github username>

Clone Repo, Create/Activate Virtual Environment, Install from Source, Run:

git clone git@github.com:cgoldberg/githubtakeout.git
cd ./githubtakeout
python3 -m venv venv
source venv/bin/activate
pip install .
githubtakeout <github username>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

githubtakeout-0.1.15.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

githubtakeout-0.1.15-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file githubtakeout-0.1.15.tar.gz.

File metadata

  • Download URL: githubtakeout-0.1.15.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for githubtakeout-0.1.15.tar.gz
Algorithm Hash digest
SHA256 644d0aa20fd74934471f551d885c7b8205cec73a306f67bf8204b6b21a198d1b
MD5 5c7f13bb969c979f3cba3e8bed4ac614
BLAKE2b-256 4202e10f6c2a2adfc7d9ee58e8fe48e07f25f3c670779bd42c725aa236e6cd8a

See more details on using hashes here.

File details

Details for the file githubtakeout-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: githubtakeout-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for githubtakeout-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 ada12c2abaa2a524f91a3bca6d452af10b222917d563d7b940fb1f39f414adb1
MD5 81feef11445be2aff85f8ed9d9de2f04
BLAKE2b-256 7a7d03b5a0d59c8497b9b3d70817a7553e639e274f050b7af79598d737f68aad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page