Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/necraul/git-neko
CLI for downloading all repositories from a specified user
https://github.com/necraul/git-neko
downloader git-api git-cli git-neko kuroneko python python3 repository requests
Last synced: about 5 hours ago
JSON representation
CLI for downloading all repositories from a specified user
- Host: GitHub
- URL: https://github.com/necraul/git-neko
- Owner: NecRaul
- License: lgpl-2.1
- Created: 2024-01-09T01:02:46.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-24T10:25:50.000Z (9 months ago)
- Last Synced: 2024-04-26T05:06:44.949Z (7 months ago)
- Topics: downloader, git-api, git-cli, git-neko, kuroneko, python, python3, repository, requests
- Language: Python
- Homepage: https://pypi.org/project/git-neko/
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```Python
pip install -r requirements.txt
```or install the package by running
```Python
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
```Python
git-neko
-u
-t (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 (this will set as environment variable)
-gpat (this will set 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.
```Python
git-neko -gu -gpat
```This will set the specified **Github username** as your `GITHUB_USERNAME` environment variable. On Linux this is a bit buggy.
```Python
git-neko -gu
```This will set the specified **personal access token** as your `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable. On Linux this is a bit buggy.
```Python
git-neko -gpat
```#### Public Repositories without Environment Variables
This will use the specified **Github username** and download all **public repositories** using `requests`.
```Python
git-neko -u -t
```This will use the specified **Github username** and download all **public repositories** using `git`.
```Python
git-neko -u -t -g
```#### 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`.
```Python
git-neko -u -t
```This will use the specified **Github username** and **personal access token** and download all **public and private repositories** using `git`.
```Python
git-neko -u -t -g
```#### 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`.
```Python
git-neko -e
```This will use the **Github username** and **personal access token** in the **environment variables** and download all **public and private repositories** using `git`.
```Python
git-neko -e -g
```#### 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`.
```Python
git-neko -u -t -e
```This will **ignore** the passed **Github username** and **personal access token** instead using **environment variables** and download all **public and private repositories** using `git`.
```Python
git-neko -u -t -e -g
```### Simplified Examples
If you want to only download your repositories (public), you can do
```Python
git-neko -u
```If you want to only download your repositories (public and private), you can either do
```Python
git-neko -u -t
```or you can put your information on environment variables and do
```Python
git-neko -e
```If you want to download other people's repositories (public), you can do
```Python
git-neko -u
```If you want to download other people's repositories (public and private), you can do
```Python
git-neko -u -t
```