github-archive


Namegithub-archive JSON
Version 6.1.2 PyPI version JSON
download
home_pagehttp://github.com/justintime50/github-archive
SummaryA powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.
upload_time2023-08-28 03:48:10
maintainer
docs_urlNone
authorJustintime50
requires_python>=3.8, <4
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            <div align="center">

# GitHub Archive

A powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.

[![Build Status](https://github.com/Justintime50/github-archive/workflows/build/badge.svg)](https://github.com/Justintime50/github-archive/actions)
[![Coverage Status](https://coveralls.io/repos/github/Justintime50/github-archive/badge.svg?branch=main)](https://coveralls.io/github/Justintime50/github-archive?branch=main)
[![PyPi](https://img.shields.io/pypi/v/github-archive)](https://pypi.org/project/github-archive)
[![Licence](https://img.shields.io/github/license/justintime50/GitHub-archive)](LICENSE)

![Showcase](https://raw.githubusercontent.com/justintime50/assets/main/src/github-archive/showcase.png)

</div>

GitHub Archive is a powerful tool to concurrently clone, pull, or fork repositories or gists from GitHub with incredible flexibility. It's the perfect tool for spinning up a new dev environment, keeping a local copy of your GitHub instance, or quickly pulling in projects from your favorite users and organizations.

The power of GitHub Archive comes in its configuration. Maybe you only want to clone or pull your personal public repos or maybe you want to go all out and include private repos from you and all organizations you belong to along with your gists. GitHub Archive can do it all.

## Install

```bash
# Install tool
pip3 install github-archive

# Install locally
just install
```

## Usage

```text
Usage:
    github-archive --users justintime50 --clone

Options:
    -h, --help            show this help message and exit
    -t TOKEN, --token TOKEN
                            Provide your GitHub token to authenticate with the GitHub API and gain access to private repos and gists.
    -u USERS, --users USERS
                            Pass a comma separated list of users to get repos for.
    -o ORGS, --orgs ORGS  Pass a comma separated list of orgs to get repos for.
    -g GISTS, --gists GISTS
                            Pass a comma separated list of users to get gists for.
    -s STARS, --stars STARS
                            Pass a comma separated list of users to get starred repos for.
    -v, --view            Pass this flag to view git assets (dry run).
    -c, --clone           Pass this flag to clone git assets.
    -p, --pull            Pass this flag to pull git assets.
    -f, --fork            Pass this flag to fork git assets.
    --include INCLUDE     Pass a comma separated list of repos to filter what is included in the Archive.
    --exclude EXCLUDE     Pass a comma separated list of repos to filter what is excluded from the Archive.
    --forks               Pass this flag to include forked git assets (when cloning or pulling).
    --location LOCATION   The location where you want your GitHub Archive to be stored. Default: /Users/USERNAME/github-archive
    --https               Use HTTPS URLs instead of SSH.
    --timeout TIMEOUT     The number of seconds before a git operation times out. Default: 300
    --threads THREADS     The number of concurrent threads to run. Default: 10
    --base_url BASE_URL   The base URL of your GitHub instance (useful for enterprise users with custom hostnames). Default: https://api.github.com
    --log_level {error,critical,warning,info,debug}
                            The log level used for the tool. Default: info
    --version             show program's version number and exit
```

### Authentication

There are three methods of authentication with this tool.

#### Unauthenticated

You can run a command similar to `github-archive --users justintime50 --clone` which would only clone public repositories. GitHub has a hard limit of `60 requests per hour` - not authenticating may quickly burn through that limit if you have a large GitHub instance to archive.

#### SSH

To allow the script to run continuosly without requiring passwords for every repo, you can add your SSH passphrase to the SSH agent:

```bash
# This assumes you've saved your SSH keys to the default location
ssh-add
```

You can then run a command similar to `github-archive --users justintime50 --clone --token 123` where the token is your GitHub API token. This will authenticate you with the GitHub API via the `token` and with GitHub via `ssh`.

#### Git Credential Manager

Alternatively, you can use a tool like [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager) to populate your Git credentials under the hood. When not using SSH, we'll clone/pull from the git URLs instead of the SSH URLs. To trigger this behavior, you must pass the `--https` flag.

You can then run a command similar to `github-archive --users justintime50 --clone --token 123 --https` where the token is your GitHub API token. This will authenticate you with the GitHub API via the `token` and with GitHub via your Git credentials via `GCM`.

### Notes

**Access**: GitHub Archive can only clone or pull git assets that the authenticated user has access to. This means that private repos from another user or org that you don't have access to will not be able to be cloned or pulled. Additionally without using a token and SSH/CGM, you will not be able to interact with private git assets.

**Merge Conflicts:** Be aware that using GitHub Archive could lead to merge conflicts if you do not commit or stash your changes if using these repos as active development repos instead of simply an archive or one-time clone.

## Development

```bash
# Get a comprehensive list of development tools
just --list

# Run the tool locally
venv/bin/python github_archive/cli.py --help
```

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/justintime50/github-archive",
    "name": "github-archive",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8, <4",
    "maintainer_email": "",
    "keywords": "",
    "author": "Justintime50",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/50/94/1b32c184ac8dc38cf5384aa547e7937d7d0a25e7f698c9eb5e2abc31abe6/github-archive-6.1.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# GitHub Archive\n\nA powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.\n\n[![Build Status](https://github.com/Justintime50/github-archive/workflows/build/badge.svg)](https://github.com/Justintime50/github-archive/actions)\n[![Coverage Status](https://coveralls.io/repos/github/Justintime50/github-archive/badge.svg?branch=main)](https://coveralls.io/github/Justintime50/github-archive?branch=main)\n[![PyPi](https://img.shields.io/pypi/v/github-archive)](https://pypi.org/project/github-archive)\n[![Licence](https://img.shields.io/github/license/justintime50/GitHub-archive)](LICENSE)\n\n![Showcase](https://raw.githubusercontent.com/justintime50/assets/main/src/github-archive/showcase.png)\n\n</div>\n\nGitHub Archive is a powerful tool to concurrently clone, pull, or fork repositories or gists from GitHub with incredible flexibility. It's the perfect tool for spinning up a new dev environment, keeping a local copy of your GitHub instance, or quickly pulling in projects from your favorite users and organizations.\n\nThe power of GitHub Archive comes in its configuration. Maybe you only want to clone or pull your personal public repos or maybe you want to go all out and include private repos from you and all organizations you belong to along with your gists. GitHub Archive can do it all.\n\n## Install\n\n```bash\n# Install tool\npip3 install github-archive\n\n# Install locally\njust install\n```\n\n## Usage\n\n```text\nUsage:\n    github-archive --users justintime50 --clone\n\nOptions:\n    -h, --help            show this help message and exit\n    -t TOKEN, --token TOKEN\n                            Provide your GitHub token to authenticate with the GitHub API and gain access to private repos and gists.\n    -u USERS, --users USERS\n                            Pass a comma separated list of users to get repos for.\n    -o ORGS, --orgs ORGS  Pass a comma separated list of orgs to get repos for.\n    -g GISTS, --gists GISTS\n                            Pass a comma separated list of users to get gists for.\n    -s STARS, --stars STARS\n                            Pass a comma separated list of users to get starred repos for.\n    -v, --view            Pass this flag to view git assets (dry run).\n    -c, --clone           Pass this flag to clone git assets.\n    -p, --pull            Pass this flag to pull git assets.\n    -f, --fork            Pass this flag to fork git assets.\n    --include INCLUDE     Pass a comma separated list of repos to filter what is included in the Archive.\n    --exclude EXCLUDE     Pass a comma separated list of repos to filter what is excluded from the Archive.\n    --forks               Pass this flag to include forked git assets (when cloning or pulling).\n    --location LOCATION   The location where you want your GitHub Archive to be stored. Default: /Users/USERNAME/github-archive\n    --https               Use HTTPS URLs instead of SSH.\n    --timeout TIMEOUT     The number of seconds before a git operation times out. Default: 300\n    --threads THREADS     The number of concurrent threads to run. Default: 10\n    --base_url BASE_URL   The base URL of your GitHub instance (useful for enterprise users with custom hostnames). Default: https://api.github.com\n    --log_level {error,critical,warning,info,debug}\n                            The log level used for the tool. Default: info\n    --version             show program's version number and exit\n```\n\n### Authentication\n\nThere are three methods of authentication with this tool.\n\n#### Unauthenticated\n\nYou can run a command similar to `github-archive --users justintime50 --clone` which would only clone public repositories. GitHub has a hard limit of `60 requests per hour` - not authenticating may quickly burn through that limit if you have a large GitHub instance to archive.\n\n#### SSH\n\nTo allow the script to run continuosly without requiring passwords for every repo, you can add your SSH passphrase to the SSH agent:\n\n```bash\n# This assumes you've saved your SSH keys to the default location\nssh-add\n```\n\nYou can then run a command similar to `github-archive --users justintime50 --clone --token 123` where the token is your GitHub API token. This will authenticate you with the GitHub API via the `token` and with GitHub via `ssh`.\n\n#### Git Credential Manager\n\nAlternatively, you can use a tool like [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager) to populate your Git credentials under the hood. When not using SSH, we'll clone/pull from the git URLs instead of the SSH URLs. To trigger this behavior, you must pass the `--https` flag.\n\nYou can then run a command similar to `github-archive --users justintime50 --clone --token 123 --https` where the token is your GitHub API token. This will authenticate you with the GitHub API via the `token` and with GitHub via your Git credentials via `GCM`.\n\n### Notes\n\n**Access**: GitHub Archive can only clone or pull git assets that the authenticated user has access to. This means that private repos from another user or org that you don't have access to will not be able to be cloned or pulled. Additionally without using a token and SSH/CGM, you will not be able to interact with private git assets.\n\n**Merge Conflicts:** Be aware that using GitHub Archive could lead to merge conflicts if you do not commit or stash your changes if using these repos as active development repos instead of simply an archive or one-time clone.\n\n## Development\n\n```bash\n# Get a comprehensive list of development tools\njust --list\n\n# Run the tool locally\nvenv/bin/python github_archive/cli.py --help\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.",
    "version": "6.1.2",
    "project_urls": {
        "Homepage": "http://github.com/justintime50/github-archive"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "625fa206c7763bc0ebd62dd303f8eea1d03ce71ac19301461fd3b1a392dc5990",
                "md5": "30944999c8002ac27acc89c0dea5e229",
                "sha256": "6a841c8fae43a255b28cd66c78abf3dabcb0fa534bb4cef4631a3e3286c56f40"
            },
            "downloads": -1,
            "filename": "github_archive-6.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30944999c8002ac27acc89c0dea5e229",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8, <4",
            "size": 13794,
            "upload_time": "2023-08-28T03:48:08",
            "upload_time_iso_8601": "2023-08-28T03:48:08.636479Z",
            "url": "https://files.pythonhosted.org/packages/62/5f/a206c7763bc0ebd62dd303f8eea1d03ce71ac19301461fd3b1a392dc5990/github_archive-6.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "50941b32c184ac8dc38cf5384aa547e7937d7d0a25e7f698c9eb5e2abc31abe6",
                "md5": "2ddbea73609c2352eccd92cdc2334234",
                "sha256": "26c9f6e2c02d8bd6e3768690d7758df635e909af9a9170fabe559b84caef89f7"
            },
            "downloads": -1,
            "filename": "github-archive-6.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2ddbea73609c2352eccd92cdc2334234",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8, <4",
            "size": 16106,
            "upload_time": "2023-08-28T03:48:10",
            "upload_time_iso_8601": "2023-08-28T03:48:10.081664Z",
            "url": "https://files.pythonhosted.org/packages/50/94/1b32c184ac8dc38cf5384aa547e7937d7d0a25e7f698c9eb5e2abc31abe6/github-archive-6.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-28 03:48:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "justintime50",
    "github_project": "github-archive",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "github-archive"
}
        
Elapsed time: 0.13917s