Last active
July 5, 2019 11:19
-
-
Save trishantpahwa/f1fd65781edf68904fe514913f821feb to your computer and use it in GitHub Desktop.
Download all of your GitHub projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script allows you to download all of your GitHub projects. | |
import requests | |
import os | |
username = raw_input('Enter username: ') | |
projects = requests.get('http://api.github.com/users/' + username + '/repos') | |
projects = projects.json() | |
for project in projects: | |
if project['fork'] == True: | |
projects.remove(project) | |
project_links = {} | |
for project in projects: | |
link = project['html_url'] | |
#link = project['html_url'] + '/archive/master.zip' | |
project_links[project['name']] = link | |
for link in project_links.values(): | |
os.system('git clone ' + link) | |
print 'Downloaded all projects.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment