Skip to content

Instantly share code, notes, and snippets.

@kf0jvt
Last active December 22, 2015 06:08
Show Gist options
  • Save kf0jvt/6428581 to your computer and use it in GitHub Desktop.
Save kf0jvt/6428581 to your computer and use it in GitHub Desktop.
Simple script to count the number of issues closed by each person in a git repo
import urllib
import json
import operator
# Only going to grab 300 issues. May need to change this line
filehandle = urllib.urlopen('https://api.github.com/repos/vz-risk/VCDB/issues?state=closed&per_page=300')
usercount = {}
issues = json.loads(filehandle.read())
for eachissue in issues:
username = 'none'
try:
username = eachissue['assignee']['login']
except:
pass
usercount[username] = usercount.get(username,0) + 1
for eachitem in sorted(usercount.iteritems(),key=operator.itemgetter(1),reverse=True):
print eachitem[0].rjust(11) + ' ' + str(eachitem[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment