Created
November 9, 2011 18:47
-
-
Save ramalho/1352485 to your computer and use it in GitHub Desktop.
Generate report from pycon-pc JSON
This file contains hidden or 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 sys | |
import json | |
LINE_FORMAT = '{id:>3} {mark} {yay:>2} {nay:>2} {abstain:>2} {name}' | |
with open(sys.argv[1]) as json_in: | |
talks = json.load(json_in) | |
for talk in talks: | |
mark = {'rejected':'-', 'accepted': '+', 'poster': 'p' | |
}[talk['decision']] | |
talk.update(talk['votes']) | |
print LINE_FORMAT.format(mark=mark, **talk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment