Skip to main content

CLI for downloading all repositories from a specified user.

Project description

git-neko

CLI for downloading all repositories from a specified user.

Requirements

requests is used to get information from the Github API and download the repositories (if you don't use -g/--git to download using git).

Note that requests will not download submodules but git will.

If you want to build this on your own, you can install the requirements with

pip install -r requirements.txt

or install the package by running

pip install git-neko

Python's native os (used to check for whether a folder exists or not), argparse (parse return request and set command argument), subprocess (call git clone and git pull on repositories) and setuptools (used to build the script) packages are also used.

How it works

I send requests to https://api.github.com/users/{username}/repos or https://api.github.com/user/repos, depending on the arguments passed to the script, I either download all the repositories in specified user's account with either requests or git.

You can run the script with

git-neko
    -u <github-username>
    -t <github-personal-access-token> (optional - you will just download the public repositories instead of all repositories)
    -e (optional - means you will be using environment variables. This overrides -u and -t)
    -g (optional - means you will be downloading using git)
    -gu <github-username> (this will set <github-username> as environment variable)
    -gpat <github-personal-access-token> (this will set <github-personal-access-token> as environment variable)

Examples

Setting Environment Variables

This will set the specified Github username and personal access token as your GITHUB_USERNAME and GITHUB_PERSONAL_ACCESS_TOKEN environment variable respectively. On Linux this is a bit buggy.

git-neko -gu <github-username> -gpat <github-personal-access-token>

This will set the specified Github username as your GITHUB_USERNAME environment variable. On Linux this is a bit buggy.

git-neko -gu <github-username>

This will set the specified personal access token as your GITHUB_PERSONAL_ACCESS_TOKEN environment variable. On Linux this is a bit buggy.

git-neko -gpat <github-personal-access-token>

Public Repositories without Environment Variables

This will use the specified Github username and download all public repositories using requests.

git-neko -u <github-username> -t <github-personal-access-token>

This will use the specified Github username and download all public repositories using git.

git-neko -u <github-username> -t <github-personal-access-token> -g <anything>

Public and Private Repositories without Environment Variables

This will use the specified Github username and personal access token and download all public and private repositories using requests.

git-neko -u <github-username> -t <github-personal-access-token>

This will use the specified Github username and personal access token and download all public and private repositories using git.

git-neko -u <github-username> -t <github-personal-access-token> -g <anything>

Public and Private Repositories with Environment Variables

This will use the Github username and personal access token in the environment variables and download all public and private repositories using requests.

git-neko -e <anything>

This will use the Github username and personal access token in the environment variables and download all public and private repositories using git.

git-neko -e <anything> -g <anything>

Public and Private Repositories with Environment Variables (Overriding passed Username and Personal Access Token)

This will ignore the passed Github username and personal access token instead using environment variables and download all public and private repositories using requests.

git-neko -u <github-username> -t <github-personal-access-token> -e <anything>

This will ignore the passed Github username and personal access token instead using environment variables and download all public and private repositories using git.

git-neko -u <github-username> -t <github-personal-access-token> -e <anything> -g <anything>

Simplified Examples

If you want to only download your repositories (public), you can do

git-neko -u <your-username>

If you want to only download your repositories (public and private), you can either do

git-neko -u <your-username> -t <your-personal-access-token>

or you can put your information on environment variables and do

git-neko -e <anything>

If you want to download other people's repositories (public), you can do

git-neko -u <their-username>

If you want to download other people's repositories (public and private), you can do

git-neko -u <their-username> -t <their-personal-access-token>

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

git_neko-1.20.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

git_neko-1.20-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file git_neko-1.20.tar.gz.

File metadata

  • Download URL: git_neko-1.20.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for git_neko-1.20.tar.gz
Algorithm Hash digest
SHA256 137e8f616d24e917a5741a2f159783e5bec90265e5ce42ada6de4d1444d09b43
MD5 2724ef7c5668f7881c8e51a87bad7d87
BLAKE2b-256 c84f5c36cb402d5cbee664584fb581fa744ab9499c17d73298c24efdf4d908e5

See more details on using hashes here.

File details

Details for the file git_neko-1.20-py3-none-any.whl.

File metadata

  • Download URL: git_neko-1.20-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for git_neko-1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 c0edb4f79d65e410b4cba5e3e363325d08f4d14055d48f2849f6ad9791b980fa
MD5 e6a94d3d0613e5f20b51d79b6262a6b0
BLAKE2b-256 46d56a53ab2a92c9348538f880ac066fa6db529668b89b33f56824a43e3a606b

See more details on using hashes here.

Supported by

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