Skip to main content

githubtakeout

Backup and archive Git Repos and Gists from GitHub

Development GitHub
License MIT
Releases
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.

If a repo with history exists from a previous run, it will pull new changes. Otherwise, it will clone the repo. Use the --keep if you don't want repos deleted after an archive is created.

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>

You can also set this in an .env file in the current directory. It should contain:

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:

$ githubtakeout --help
usage: githubtakeout [-h] [--dir DIR] [--pattern PATTERN] [--skip_pattern PATTERN]
                     [--format {tar,zip,none}] [--gists] [--history]
                     [--skip_forks] [--keep] [--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 to include
  --skip_pattern PATTERN   regex matching repo names to skip
  --format {tar,zip,none}  archive format (default: zip)
  --gists                  include gists
  --history                include commit history and branches (.git directory)
  --skip_forks             skip repos that are forks
  --keep                   keep repos after archiving
  --list                   list repos only
  --token                  prompt for auth token

Screenshot:

Screenshot

Usage Example:

Install from PyPI with pipx and run:

pipx install githubtakeout
githubtakeout <github username>

Metadata

Release files for githubtakeout 0.1.31

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for githubtakeout 0.1.31
File Size Uploaded
githubtakeout-0.1.31.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for githubtakeout 0.1.31
File Interpreter ABI Platform
githubtakeout-0.1.31-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / githubtakeout-0.1.31.tar.gz

Download URL githubtakeout-0.1.31.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bf3d5cd04a55e1891c91ff9b667bf075d8d88e096736bb3572cf0a7391760487
BLAKE2b-256 checksum
How to use checksums
528e04f3057a4603d360c7105214259997925475b319651f145d28571c3dacf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / githubtakeout-0.1.31-py3-none-any.whl

Download URL githubtakeout-0.1.31-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4b795bc11b090254998586279ae708c605f9866f8fba9bef24850a0157e702d
BLAKE2b-256 checksum
How to use checksums
5b33b7327b05d4a5ccafadc9d3c364003165ea16860ada3d568b2b6571b9ada5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release history Release notifications | RSS feed

This release

0.1.31 This release

2 release files

0.1.29

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page