-
Notifications
You must be signed in to change notification settings - Fork 6
/
GenerateHistSeriesFile.py
55 lines (40 loc) · 1.54 KB
/
GenerateHistSeriesFile.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
import DataUpdate
import sqlite3
import time
#Generate database
connection=sqlite3.connect("output/Database/IFsHistSeries.db")
print('Database created at output/Database/IFsHistSeries.db')
cursor=connection.cursor()
#AQUASTAT Data
print('Starting AQUASTAT data')
start=time.time()
Aquastat=DataUpdate.AQUASTATData(write_csv_output=True)
DataUpdate.Write_to_SQL(Aquastat,connection)
end=time.time()
print(end-start)
#IMFGFS Expenditure data
print('Starting IMF GFS expenditure data')
start=time.time()
IMFExp=DataUpdate.IMFGFSExpenditureData(write_csv_output=True)
DataUpdate.Write_to_SQL(IMFExp,connection)
end=time.time()
print(end-start)
#FAO Data
print('Starting FAO Food balance sheet data')
start=time.time()
FAO=DataUpdate.FAOFBS(write_csv_output=True)
DataUpdate.Write_to_SQL(FAO,connection)
end=time.time()
print(end-start)
WDI=DataUpdate.WDIData()
WDI.to_sql(name="WorldDevelopmentIndicators",con=connection,if_exists="replace",index=False)
UIS=DataUpdate.UISData()
UIS.to_sql(name="UISEducationData",con=connection,if_exists="replace",index=False)
IMF=DataUpdate.IMFGFSRevenueData()
IMF.to_sql(name="IMFRevenue", con=connection, if_exists="replace", index=False)
HealthDet=DataUpdate.IHMEDetailedDeathsData()
HealthDet.to_sql(name="HealthDataDetailed",con=connection,if_exists="replace",index=False)
Health=DataUpdate.IHMEHistoricalDeathData(sex_name="Both")
Health.to_sql(name="HealthData",con=connection,if_exists="replace",index=False)
Fish=DataUpdate.FAOFBSFish()
Fish.to_sql(name="FAOFishData", con=connection, if_exists="replace", index=False)