Add program to list badges

This commit is contained in:
Robert Miles 2020-02-24 09:35:11 -05:00
parent 98d3deb401
commit d4782dab33
1 changed files with 12 additions and 0 deletions

12
list_badges.py Normal file
View File

@ -0,0 +1,12 @@
import json
from collections import Counter
with open("badges.json") as f: badges = json.load(f)
for k in badges:
if k.startswith("__"): continue
l = []
counter = Counter([b["name"] for b in badges[k]])
for item in counter.items():
l.append("{} (x{!s})".format(*item))
print("{}: {}".format(k,", ".join(l)))