-
Notifications
You must be signed in to change notification settings - Fork 2
/
update_data.py
101 lines (74 loc) · 3.11 KB
/
update_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
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
import time
import logging
import traceback
from data_pandas_subclasses.date_index_classes.CoronaCasesAndDeaths import CoronaCasesAndDeathsDataFrame
from data_pandas_subclasses.date_index_classes.NowcastRKI import NowcastRKIDataFrame
from data_pandas_subclasses.date_index_classes.IntensiveRegister import IntensiveRegisterDataFrame
from data_pandas_subclasses.week_index_classes.CasesPerOutbreak import CasesPerOutbreakDataFrame
from data_pandas_subclasses.week_index_classes.DeathsByWeekOfDeathAndAgeGroup import DeathsByWeekOfDeathAndAgeGroupDataFrame
from data_pandas_subclasses.week_index_classes.NumberPCRTests import NumberPCRTestsDataFrame
from data_pandas_subclasses.week_index_classes.ClinicalAspects import ClinicalAspectsDataFrame
from data_pandas_subclasses.week_index_classes.MedianAndMeanAges import MedianAndMeanAgesDataFrame
from data_pandas_subclasses.AgeDistribution import AgeDistributionDataFrame
logging.basicConfig(level=logging.INFO)
def update_CoronaCasesAndDeathsDataFrame():
try:
CoronaCasesAndDeathsDataFrame.update_csv_with_data_from_rki_api()
except Exception:
traceback.print_exc()
def update_NowcastRKIDataFrame():
try:
NowcastRKIDataFrame.update_with_new_data_from_rki()
except Exception:
traceback.print_exc()
def update_IntensiveRegisterDataFrame():
try:
IntensiveRegisterDataFrame.update_csv_with_intensive_register_data()
except Exception:
traceback.print_exc()
def update_ClinicalAspectsDataFrame():
try:
ClinicalAspectsDataFrame.update_csv_with_new_data_from_rki()
except Exception:
traceback.print_exc()
def update_AgeDistributionDataFrame():
try:
AgeDistributionDataFrame.get_age_distribution_of_cases_and_deaths()
except Exception:
traceback.print_exc()
def update_NumberPCRTestsDataFrame():
try:
NumberPCRTestsDataFrame.update_csv_with_new_data_from_rki()
except Exception:
traceback.print_exc()
def update_CasesPerOutbreakDataFrame():
try:
CasesPerOutbreakDataFrame.update_csv_with_new_data_from_rki()
except Exception:
traceback.print_exc()
def update_DeathsByWeekOfDeathAndAgeGroupDataFrame():
try:
DeathsByWeekOfDeathAndAgeGroupDataFrame.update_csv_with_new_data_from_rki()
except Exception:
traceback.print_exc()
def update_MedianAndMeanAgesDataFrame():
try:
MedianAndMeanAgesDataFrame.update_csv_with_new_data_from_rki()
except Exception:
traceback.print_exc()
def update_dataframes():
update_CoronaCasesAndDeathsDataFrame()
update_NowcastRKIDataFrame()
update_IntensiveRegisterDataFrame()
update_ClinicalAspectsDataFrame()
update_AgeDistributionDataFrame()
update_NumberPCRTestsDataFrame()
update_CasesPerOutbreakDataFrame()
update_DeathsByWeekOfDeathAndAgeGroupDataFrame()
update_MedianAndMeanAgesDataFrame()
if __name__ == '__main__':
logging.info("START COMPLETE UPDATE PROCESS")
start_time = time.time()
update_dataframes()
end_time = time.time()
logging.info(f"FINISHED COMPLETE UPDATE PROCESS IN {end_time - start_time} SECONDS")