A simple Python script to download all public repositories from a specified GitHub user. This tool uses the GitHub API to fetch repository details and then clones them into a local directory.
- Downloads all public repositories of a specified GitHub user.
- Optionally uses a GitHub API token to avoid rate limits.
- Organizes cloned repositories into a specified directory.
Before you use GitHubRepoDownloader
, ensure you have the following:
- Python 3.x installed on your system.
git
installed and accessible from your command line or terminal.requests
library installed in Python. You can install it usingpip install requests
.
- Clone this repository or download
github_repo_downloader.py
to your local machine. - Open
github_repo_downloader.py
in a text editor. - Replace
'username'
in theGITHUB_USER
variable with the GitHub username of the user whose repositories you want to download. - If you have a GitHub API token and want to use it (recommended to avoid hitting rate limits), replace
None
in theGITHUB_TOKEN
variable with your token as a string. - Run the script:
python github_repo_downloader.py
The script will create a directory named github_repos
in the current working directory and clone all the public repositories of the specified user into this directory.
You can modify the script to change the target directory for cloned repositories by editing the TARGET_DIR
variable.
This tool is intended for educational and backup purposes. Please ensure you have the right to clone and store the repositories you download, especially if they are private or contain sensitive information.
This project is open-sourced under the MIT License. See the LICENSE file for more details.