This repository has been archived by the owner on Dec 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcreate_iso_db.py
53 lines (44 loc) · 1.51 KB
/
create_iso_db.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- coding: utf-8 -*-
"""Generate ISO files."""
from covid_updater.iso import ISODB
def main():
# Load DB
db = ISODB.create_from_source()
# Renaming
iso_rename = {
"Friuli-Venezia Giulia": "Friuli Venezia Giulia",
"Brussels Hoofdstedelijk Gewest": "Brussels",
"Saha, Respublika": "Sakha, Respublika",
}
# Add new entries
items = [
["IT", "IT-TN", "Provincia autonoma di Trento"],
["IT", "IT-BZ", "Provincia autonoma di Bolzano - Alto Adige"],
["FR", "FR-RE", "La Reunion"],
["FR", "FR-YT", "Mayotte"],
["BE", "BE-VLG", "Flanders"],
["BE", "BE-WAL", "Wallonia"],
["US", "US-PR", "Puerto Rico"],
["US", "US-AS", "American Samoa"],
["US", "US-GU", "Guam"],
["US", "US-VI", "Virgin Islands"],
["US", "US-MP", "Northern Mariana Islands"],
["FR", "FR-MQ", "Martinique"],
["FR", "FR-GP", "Guadeloupe"],
["FR", "FR-GF", "Guyane"],
["NO", "NO-46", "Vestland"],
["NO", "NO-42", "Agder"],
["NO", "NO-30", "Viken"],
["NO", "NO-54", "Troms og Finnmark"],
["NO", "NO-50", "Trondelag"],
["NO", "NO-38", "Vestfold og Telemark"],
["NO", "NO-34", "Innlandet"],
["CL", "CL-NB", "Nuble"],
["IN", "IN-LA", "Ladakh"],
["FI", "FI-01", "Aland"],
["KR", "KR-50", "Sejong-teukbyeoljachisi"],
]
db.rename_values("subdivision_name", iso_rename)
db.append(items)
if __name__ == "__main__":
main()