Skip to content

Instantly share code, notes, and snippets.

@trishantpahwa
Last active July 5, 2019 11:19
Show Gist options
  • Save trishantpahwa/f1fd65781edf68904fe514913f821feb to your computer and use it in GitHub Desktop.
Save trishantpahwa/f1fd65781edf68904fe514913f821feb to your computer and use it in GitHub Desktop.
Download all of your GitHub projects.
# 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