mirror of
https://github.com/adulau/mmdb-server.git
synced 2024-11-07 11:36:24 +00:00
12 lines
286 B
Python
12 lines
286 B
Python
|
import csv
|
||
|
import json
|
||
|
|
||
|
cn = {}
|
||
|
|
||
|
with open('countries_codes_and_coordinates.csv') as csvfile:
|
||
|
countries = csv.DictReader(csvfile, quotechar='"', delimiter=',', skipinitialspace=True)
|
||
|
for country in countries:
|
||
|
cn[country['Alpha-2 code']] = country
|
||
|
|
||
|
print(json.dumps(cn))
|