Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 304 Bytes
import json
import sys
in_file = sys.argv[1]
out_file = sys.argv[2]
cities = json.loads(open(in_file).read())
out = []
keep = ('city_name', 'nb_visits', 'long', 'lat')
for c in cities:
o = dict()
for p in keep:
o[p] = c[p]
out.append(o)
open(out_file, 'wb').write(json.dumps(out))