-
Notifications
You must be signed in to change notification settings - Fork 0
/
sipri_info.py
260 lines (253 loc) · 8.35 KB
/
sipri_info.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
"""
@file sipri_info.py
The data structures in this file are constants used for database operations on SIPRI's Arms Transfer Database.
@author Victor Mercola
@author Benjamin Lunden
@author Jack Ayvazian
"""
from typing import Dict, Tuple, List
ENTITY_DICT: Dict[str, Tuple[str, str]] = {
"Afghanistan": ("AFG", "AFG"),
# "African Union": ("AU", ""),
"Albania": ("ALB", "ALB"),
"Algeria": ("ALG", "DZA"),
"Angola": ("ANG", "AGO"),
"Argentina": ("ARG", "ARG"),
"Armenia": ("ARM", "ARM"),
"Aruba": ("ARU", "ABW"), # Part of the Netherlands
"Australia": ("AUS", "AUS"),
"Austria": ("AST", "AUT"),
"Azerbaijan": ("AZB", "AZE"),
"Bahamas": ("BAS", "BHS"),
"Bahrain": ("BAH", "BHR"),
"Bangladesh": ("BAN", "BGD"),
"Barbados": ("BAR", "BRB"),
"Belarus": ("BLR", "BLR"),
"Belgium": ("BEL", "BEL"),
"Belize": ("BLZ", "BLZ"),
"Benin": ("BEN", "BEN"),
"Bhutan": ("BHU", "BTN"),
"Bolivia": ("BOL", "BOL"),
"Bosnia-Herzegovina": ("BOS", "BIH"),
"Botswana": ("BOT", "BWA"),
"Brazil": ("BRA", "BRA"),
"Brunei": ("BRU", "BRN"),
"Bulgaria": ("BUL", "BGR"),
"Burkina Faso": ("BF", "BFA"),
"Burundi": ("BDI", "BDI"),
"Cabo Verde": ("CAP", "CPV"),
"Cambodia": ("CMB", "KHM"),
"Cameroon": ("CAM", "CMR"),
"Canada": ("CAN", "CAN"),
"Central African Republic": ("CAR", "CAF"),
"Chad": ("CHA", "TCD"),
"Chile": ("CHE", "CHL"),
"China": ("CHI", "CHN"),
"Colombia": ("COL", "COL"),
"Comoros": ("COM", "COM"),
"Congo": ("CON", "COG"),
"Costa Rica": ("COS", "CRI"),
"Cote d'Ivoire": ("IVO", "CIV"),
"Croatia": ("CRO", "HRV"),
"Cuba": ("CUB", "CUB"),
"Cyprus": ("CYP", "CYP"),
"Czechia": ("CZR", "CZE"),
"DR Congo": ("DRC", "COD"),
# "Darfur rebels (Sudan)*": ("XSD", ""),
"Denmark": ("DEN", "DNK"),
"Djibouti": ("DJI", "DJI"),
"Dominican Republic": ("DOM", "DOM"),
"Ecuador": ("ECU", "ECU"),
"Egypt": ("EGY", "EGY"),
"El Salvador": ("SAL", "SLV"),
"Equatorial Guinea": ("EQU", "GNQ"),
"Eritrea": ("ERI", "ERI"),
"Estonia": ("EST", "EST"),
"Ethiopia": ("ETH", "ETH"),
"Fiji": ("FJI", "FJI"),
"Finland": ("FIN", "FIN"),
"France": ("FRA", "FRA"),
"Gabon": ("GAB", "GAB"),
"Gambia": ("GAM", "GMB"),
"Georgia": ("GEO", "GEO"),
"Germany": ("FRG", "DEU"),
"Ghana": ("GHA", "GHA"),
"Greece": ("GRE", "GRC"),
"Guatemala": ("GUA", "GTM"),
"Guinea": ("GUI", "GIN"),
"Guinea-Bissau": ("GBI", "GNB"),
"Guyana": ("GUY", "GUY"),
"Haiti": ("HAI", "HTI"),
# "Hamas (Palestine)*": ("XPA", ""),
# "Hezbollah (Lebanon)*": ("XLH", ""),
"Honduras": ("HON", "HND"),
# "Houthi rebels (Yemen)*": ("XYH", ""),
"Hungary": ("HUN", "HUN"),
"Iceland": ("ICE", "ISL"),
"India": ("IND", "IND"),
"Indonesia": ("INS", "IDN"),
"Iran": ("IRA", "IRN"),
"Iraq": ("IRQ", "IRQ"),
"Ireland": ("IRE", "IRL"),
"Israel": ("ISR", "ISR"),
"Italy": ("ITA", "ITA"),
"Jamaica": ("JAM", "JAM"),
"Japan": ("JAP", "JPN"),
"Jordan": ("JOR", "JOR"),
"Kazakhstan": ("KAZ", "KAZ"),
"Kenya": ("KEN", "KEN"),
"Kiribati": ("KIR", "KIR"),
"Kosovo": ("KSV", "KSV"), # Kosovo is disputed, UNK did not work
"Kuwait": ("KUW", "KWT"),
"Kyrgyzstan": ("KYR", "KGZ"),
# "LRA (Uganda)": ("XUL", ""),
# "LTTE (Sri Lanka)": ("XSL", ""),
"Laos": ("LAO", "LAO"),
"Latvia": ("LAT", "LVA"),
"Lebanon": ("LEB", "LBN"),
"Lesotho": ("LES", "LSO"),
"Liberia": ("LIB", "LBR"),
"Libya": ("LYA", "LBY"),
# "Libya GNC": ("LYW", ""),
# "Libya HoR": ("LYE", ""),
"Lithuania": ("LIT", "LTU"),
"Luxembourg": ("LUX", "LUX"),
"Madagascar": ("MAD", "MDG"),
"Malawi": ("MWI", "MWI"),
"Malaysia": ("MAL", "MYS"),
"Maldives": ("MLV", "MDV"),
"Mali": ("MLI", "MLI"),
"Malta": ("MTA", "MLT"),
"Marshall Islands": ("MAR", "MHL"),
"Mauritania": ("MRA", "MRT"),
"Mauritius": ("MAU", "MUS"),
"Mexico": ("MEX", "MEX"),
"Micronesia": ("MIC", "FSM"),
"Moldova": ("MOL", "MDA"),
"Mongolia": ("MON", "MNG"),
"Montenegro": ("MTG", "MNE"),
"Morocco": ("MOR", "MAR"),
"Mozambique": ("MOZ", "MOZ"),
"Myanmar": ("MYA", "MMR"),
# "NATO": ("NAT", ""),
# "NLA (Macedonia)": ("XMN", ""),
# "NTC (Libya)": ("XLB", ""),
"Namibia": ("NAM", "NAM"),
"Nepal": ("NEP", "NPL"),
"Netherlands": ("NET", "NLD"),
"New Zealand": ("NZ", "NZL"),
"Nicaragua": ("NIC", "NIC"),
"Niger": ("NIR", "NER"),
"Nigeria": ("NIG", "NGA"),
"North Korea": ("KON", "PRK"),
"North Macedonia": ("MAC", "MKD"),
# "Northern Alliance (Afghanistan)": ("XAN", ""),
"Norway": ("NOR", "NOR"),
# "OSCE": ("OSC", ""),
"Oman": ("OMA", "OMN"),
# "PIJ (Israel/Palestine)": ("XID", ""),
# "PKK (Turkey)": ("XTP", ""),
# "PRC (Israel/Palestine)": ("XPC", ""),
"Pakistan": ("PAK", "PAK"),
"Palau": ("PAL", "PLW"),
"Palestine": ("PA", "PSE"),
"Panama": ("PAN", "PAN"),
"Papua New Guinea": ("PAP", "PNG"),
"Paraguay": ("PAR", "PRY"),
"Peru": ("PER", "PER"),
"Philippines": ("PHI", "PHL"),
"Poland": ("POL", "POL"),
"Portugal": ("POR", "PRT"),
"Qatar": ("QAT", "QAT"),
# "RUF (Sierra Leone)": ("XSR", ""),
# "Regional Security System": ("RSS", ""),
"Romania": ("ROM", "ROU"),
"Russia": ("RUS", "RUS"),
"Rwanda": ("RWA", "RWA"),
"Saint Kitts and Nevis": ("SKN", "KNA"),
"Saint Vincent and the Grenadines": ("SVG", "VCT"),
"Samoa": ("SAM", "WSM"),
"Saudi Arabia": ("SAU", "SAU"),
"Senegal": ("SEN", "SEN"),
"Serbia": ("SER", "SRB"),
"Seychelles": ("SEY", "SYC"),
"Sierra Leone": ("SIE", "SLE"),
"Singapore": ("SIN", "SGP"),
"Slovakia": ("SLK", "SVK"),
"Slovenia": ("SLO", "SVN"),
"Solomon Islands": ("SOL", "SLB"),
"Somalia": ("SOM", "SOM"),
"South Africa": ("SA", "ZAF"),
"South Korea": ("KOS", "KOR"),
"South Sudan": ("SSD", "SSD"),
"Spain": ("SPA", "ESP"),
"Sri Lanka": ("SRI", "LKA"),
"Sudan": ("SUD", "SDN"),
"Suriname": ("SUR", "SUR"),
"Sweden": ("SWE", "SWE"),
"Switzerland": ("SWI", "CHE"),
"Syria": ("SYR", "SYR"),
# "Syria rebels": ("XSX", ""),
"Taiwan": ("TAI", "TWN"),
"Tajikistan": ("TAJ", "TJK"),
"Tanzania": ("TAN", "TZA"),
"Thailand": ("THA", "THA"),
"Timor-Leste": ("ET", "TLS"),
"Togo": ("TOG", "TGO"),
"Tonga": ("TON", "TON"),
"Trinidad and Tobago": ("TRI", "TTO"),
"Tunisia": ("TUN", "TUN"),
"Turkey": ("TUR", "TUR"),
"Turkmenistan": ("TRK", "TKM"),
"Tuvalu": ("TUV", "TUV"),
"UAE": ("UAE", "ARE"),
# "UIC (Somalia)": ("XSI", ""),
"Uganda": ("UGA", "UGA"),
"Ukraine": ("UKR", "UKR"),
# "Ukraine Rebels": ("XUR", ""),
"United Kingdom": ("UK", "GBR"),
# "United Nations": ("UNO", ""),
"United States": ("USA", "USA"),
# "United Wa State (Myanmar)": ("XMU", ""),
# "Unknown rebel group": ("XXU", ""),
# "Unknown recipient(s)": ("XXR", ""),
"Uruguay": ("URU", "URY"),
"Uzbekistan": ("UZB", "UZB"),
"Vanuatu": ("VAN", "VUT"),
"Venezuela": ("VEN", "VEN"),
"Viet Nam": ("VN", "VNM"),
"Western Sahara": ("SAH", "ESH"),
"Yemen": ("YEM", "YEM"),
"Zambia": ("ZAM", "ZMB"),
"Zimbabwe": ("ZIM", "ZWE"),
"eSwatini": ("SWA", "SWZ"),
}
"""
Dictionary that maps a SIPRI entity's full name to a tuple containing the entity's corresponding SIPRI code and ISO
alpha-3 code.
"""
# SIPRI_CODES: List[str] = list(map(lambda x: x[0], ENTITY_DICT.values()))
# """
# List of SIPRI codes. Deprecated because it already can be derived from ENTITY_DICT.
# """
CSV_HEADER: str = "tidn,buyercod,sellercod,odat,odai,onum,onai,ldat,term,desig2,wcat,desc,coprod,nrdel,nrdelai," \
"delyears,buyer,seller,status,tivunit,tivorder,tivdel "
"""
Default SIPRI CSV header.
"""
WCATS_DICT = {
"AC": "Aircraft",
"AR": "Artillery",
"AV": "Armored vehicles",
"EN": "Engines",
"GR": "Sensors",
"MI": "Missiles",
"SH": "Ships",
"OT": "Other",
"NW": "Naval weapons",
"SA": "Satellites",
"AD": "Air defense"
}
"""
Dictionary that maps SIPRI weapon categories to their descriptions.
"""