-
Notifications
You must be signed in to change notification settings - Fork 0
/
trade_get_data.py
30 lines (23 loc) · 1.22 KB
/
trade_get_data.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
import pandas as pd
from api_functions.wb_data import get_wb_data
########################### SPECIFY START AND END YEAR ###############################
START_YEAR = 2000
END_YEAR = 2023
########################### SPECIFY THE WB INDICATORS NEEDED ##########################
featureMap_indicators={
'NE.EXP.GNFS.CD': 'Exports of goods and services (current US$)',
'NE.IMP.GNFS.CD': 'Imports of goods and services (current US$)',
'TX.VAL.MRCH.CD.WT': 'Merchandise exports (current US$)',
'BX.GSR.NFSV.CD': 'Service exports (BoP, current US$)',
'NE.TRD.GNFS.ZS': 'Trade (GDP %)',
'LP.LPI.OVRL.XQ': 'Logistics performance index: Overall (1=low to 5=high)',
'LP.LPI.CUST.XQ': 'Logistics performance index: Efficiency of customs clearance process (1=low to 5=high)',
'LP.LPI.INFR.XQ':'Logistics performance index: Quality of trade and transport-related infrastructure (1=low to 5=high)',
'TM.TAX.MRCH.WM.AR.ZS':'Tariff rate, applied, weighted mean, all products (%)'
}
########################### RETRIEVE DATA ##########################
# World Bank
df_trade = get_wb_data(featureMap_indicators, START_YEAR, END_YEAR)
print(df_trade)
# Save as excel file
df_trade.to_excel('data/trade_data.xlsx', index=False)