# githubtakeout
## Archive Git Repos and Gists from GitHub
---
- Copyright (c) 2015-2025 [Corey Goldberg][github-home]
- Development: [GitHub][github-repo]
- Download/Install: [PyPI][pypi-githubtakeout]
- License: [MIT][mit-license]
----
## 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.12+
- Git 1.7+
- Python packages:
- [GitPython][pypi-gitpython]
- [PyGithub][pypi-pygithub]
- [rich][pypi-rich]
## Installation:
Install from [PyPI][pypyi-githubtakeout]:
```
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][github-pat] 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] [--format {tar,zip}] [--gists] [--history] [--list] [--token] username
positional arguments:
username github username
options:
-h, --help show this help message and exit
--dir DIR output directory (default: ./)
--format {tar,zip} 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>
```
[github-home]: https://github.com/cgoldberg
[github-repo]: https://github.com/cgoldberg/sudokubot
[github-pat]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
[pypi-githubtakeout]: https://pypi.org/project/githubtakeout
[pypi-gitpython]: https://pypi.org/project/GitPython
[pypi-pygithub]: https://pypi.org/project/PyGithub
[pypi-rich]: https://pypi.org/project/rich
[mit-license]: https://raw.githubusercontent.com/cgoldberg/githubtakeout/refs/heads/master/LICENSE
Raw data
{
"_id": null,
"home_page": null,
"name": "githubtakeout",
"maintainer": "Corey Goldberg",
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "git, github, archive, backup, export, takeout",
"author": "Corey Goldberg",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/93/84/8f3880fec10df1412dd29595a4ebdd10d568b13642b890b716e14e49d649/githubtakeout-0.1.10.tar.gz",
"platform": null,
"description": "# githubtakeout\n\n## Archive Git Repos and Gists from GitHub\n\n---\n\n- Copyright (c) 2015-2025 [Corey Goldberg][github-home]\n- Development: [GitHub][github-repo]\n- Download/Install: [PyPI][pypi-githubtakeout]\n- License: [MIT][mit-license]\n\n----\n\n## About:\n\n`githubtakeout` is a data export tool for archiving Git repositories hosted on GitHub.\nIt clones a user's repos and creates an archive of each.\n\nIt supports public/private repos and public/secret gists. By default, it doesn't save\ncommit history or branches (`.git` directory), or Gist repositories (both can be enabled\nwith command line options).\n\nWhen you run the program, archives of your repos will be saved in a directory named\n`backups` inside your current working directory, unless a different location is specified\nusing the `--dir` option.\n\nArchives are saved in compressed zip format (`.zip`) by default, but can also be saved\nas tarballs (`.tar.gz`) using the `--format=tar` option.\n\n## Requirements:\n\n- Python 3.12+\n- Git 1.7+\n- Python packages:\n - [GitPython][pypi-gitpython]\n - [PyGithub][pypi-pygithub]\n - [rich][pypi-rich]\n\n## Installation:\n\nInstall from [PyPI][pypyi-githubtakeout]:\n\n```\npip install githubtakeout\n```\n\n## Authentication:\n\nBy default, `githubtakeout` will only retrieve an account's public repos. To access private repos and secret gists,\nyou need to authenticate.\n\nFirst, you must create a [personal access token][github-pat] on Github (either a fine-grained or classic personal\naccess token). Once you have a token, you can set the `GITHUB_TOKEN` environment variable:\n\n```\n$ export GITHUB_TOKEN=<access token>\n```\n\nIf you prefer to be prompted for your token each time you run the program, use the `--token` argument.\n\n### CLI Options:\n\n```\nusage: githubtakeout [-h] [--dir DIR] [--format {tar,zip}] [--gists] [--history] [--list] [--token] username\n\npositional arguments:\n username github username\n\noptions:\n -h, --help show this help message and exit\n --dir DIR output directory (default: ./)\n --format {tar,zip} archive format (default: zip)\n --gists include gists\n --history include commit history and branches (.git directory)\n --list list repos only\n --token prompt for auth token\n```\n\n## Usage Examples:\n\n### Install from PyPI with pipx, Run:\n\n```\npipx install githubtakeout\ngithubtakeout <github username>\n```\n\n### Clone Repo, Create/Activate Virtual Environment, Install from Source, Run:\n\n```\ngit clone git@github.com:cgoldberg/githubtakeout.git\ncd ./githubtakeout\npython3 -m venv venv\nsource venv/bin/activate\npip install .\ngithubtakeout <github username>\n```\n\n\n[github-home]: https://github.com/cgoldberg\n[github-repo]: https://github.com/cgoldberg/sudokubot\n[github-pat]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens\n[pypi-githubtakeout]: https://pypi.org/project/githubtakeout\n[pypi-gitpython]: https://pypi.org/project/GitPython\n[pypi-pygithub]: https://pypi.org/project/PyGithub\n[pypi-rich]: https://pypi.org/project/rich\n[mit-license]: https://raw.githubusercontent.com/cgoldberg/githubtakeout/refs/heads/master/LICENSE\n",
"bugtrack_url": null,
"license": null,
"summary": "Archive public Git Repos and Gists from GitHub",
"version": "0.1.10",
"project_urls": {
"download": "https://pypi.org/project/githubtakeout",
"homepage": "https://github.com/cgoldberg/githubtakeout",
"source": "https://github.com/cgoldberg/githubtakeout"
},
"split_keywords": [
"git",
" github",
" archive",
" backup",
" export",
" takeout"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f0bc3d9dffcd02791d0b54cea33ae8fd797390ef59eac434badbc2bae56c478c",
"md5": "02f0feee5839004ab5cac2ee777c3aab",
"sha256": "3ce8cc6c56cd4bd65c4c0c1874f43cc50578c17a82de204e63fa8572c5aad88b"
},
"downloads": -1,
"filename": "githubtakeout-0.1.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "02f0feee5839004ab5cac2ee777c3aab",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 7609,
"upload_time": "2025-09-13T22:35:30",
"upload_time_iso_8601": "2025-09-13T22:35:30.204217Z",
"url": "https://files.pythonhosted.org/packages/f0/bc/3d9dffcd02791d0b54cea33ae8fd797390ef59eac434badbc2bae56c478c/githubtakeout-0.1.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "93848f3880fec10df1412dd29595a4ebdd10d568b13642b890b716e14e49d649",
"md5": "a9b9d9899275ecc82f0a158bbeee1ab7",
"sha256": "c814202be01e24e6a86f1fc7dd20cadc325597dba05920819ae4ef5db5cea4da"
},
"downloads": -1,
"filename": "githubtakeout-0.1.10.tar.gz",
"has_sig": false,
"md5_digest": "a9b9d9899275ecc82f0a158bbeee1ab7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 7133,
"upload_time": "2025-09-13T22:35:31",
"upload_time_iso_8601": "2025-09-13T22:35:31.383704Z",
"url": "https://files.pythonhosted.org/packages/93/84/8f3880fec10df1412dd29595a4ebdd10d568b13642b890b716e14e49d649/githubtakeout-0.1.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-13 22:35:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cgoldberg",
"github_project": "githubtakeout",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "githubtakeout"
}