summaryrefslogtreecommitdiff
path: root/scripts/datafiles-generate-minimal.py
blob: 896a1ecd47abd68ecacf0fb94934e3e9353ba060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import json, sys

from pyranking.fetch import fetch_ranking

ranking_date = sys.argv[1]
ranking = fetch_ranking(ranking_date)

output = {}
for row in ranking:
    output[row['pid']] = {
        'p': row['place'],
        'r': float(row['score'])
    }

print json.dumps(output)