Skip to content

Instantly share code, notes, and snippets.

@maxtortime
Created August 23, 2016 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxtortime/d31f97038fb58717b518b9afcee94000 to your computer and use it in GitHub Desktop.
Save maxtortime/d31f97038fb58717b518b9afcee94000 to your computer and use it in GitHub Desktop.
Delete repository by github3.py api.
import github3
gh = github3.login(token='your access token')
for repo in gh.iter_user_repos(login='maxtortime'):
choice = str(input(repo.name + ' '))
if choice == 'd':
repo.delete()
else:
continue
@cwillenterprise
Copy link

Had to modify some to get it to work for me.

import github3
gh=github3.login(token='token')

for repo in gh.iter_user_repos(login='user'):
choice = raw_input("Select d to delete " + repo.name + " : " )
if choice != 'd':
continue
else:
print "Delete " + repo.name
repo.delete()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment