Skip to main content

Archive public Git Repos and Gists from GitHub

Project description

githubtakeout

Archive Git Repos and Gists from GitHub



About:

githubtakeout is a data export tool for 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, but can also be saved as tarballs (.tar.gz) using the --format=tar option.

Requirements:

  • Python 3.9+
  • Git 1.7+
  • Python packages:
    • GitPython
    • PyGithub

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=<auth token created on GitHub>

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] [--format FORMAT] [--gists] [--history] [--list] [--token] username

positional arguments:
  username         GitHub username

options:
  -h, --help       show this help message and exit
  --dir DIR        output directory
  --format FORMAT  archive format (tar, zip)
  --gists          include gists
  --history        include commit history and branches (.git directory)
  --list           list repos only
  --token          prompt for auth toke

Usage Examples:

Create/Activate Virtual Environment, Install from PyPI, Run:

python3 -m venv venv
source venv/bin/activate
pip 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.1.tar.gz (5.3 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.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: githubtakeout-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for githubtakeout-0.1.1.tar.gz
Algorithm Hash digest
SHA256 adc7d61b0eee24a807921ee00532c406813d848db8730ab4ab91bbff56d53890
MD5 c6be7a032a4c031db3f9fa57daa8a900
BLAKE2b-256 1d57480646cab644e0d43b11a04401245d9021d77e574e1b4ad20e89cf51aab8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: githubtakeout-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for githubtakeout-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e64432ada2572fb729298b6493c5143b9dde6f27d31f7ba25f26864b03125f2
MD5 1278f0fd23356bde45f6cb1a0b8538bc
BLAKE2b-256 8dad8495ffafe4c890b3eb69b4fca96b734418ff6e786c6f5a36fc9df1b7ce66

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