Last active
December 22, 2015 06:08
-
-
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
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
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