def export_indicator_09(self): provider_prefix = self.config.provider_prefix output_data_path = self.config.output_data_path package = 'wb_indicators' cursor = self.hc.cursor print('########## export indicator_09 ##########') timer = time.time() export_indicator(cursor,package,provider_prefix,'indicator09_admin2_day',output_data_path,'indicator09_admin2_day', time.time()) print('########## FINISHED export indicator_09 ########## Elapsed time: {time} seconds'.format(time=format_two_point_time(timer, time.time())))
def export_indicator_01_02_03(self): provider_prefix = self.config.provider_prefix # cdr_data_table = self.config.cdr_data_table output_data_path = self.config.output_data_path package = 'wb_indicators' cursor = self.hc.cursor print('########## export indicator_1_2_3 ##########') timer = time.time() export_indicator(cursor,package,provider_prefix,'indicator03_admin0_date',output_data_path,'indicator01_02_admin2_hour', time.time()) export_indicator(cursor,package,provider_prefix,'indicator01_admin3_hour',output_data_path,'indicator01_02_admin3_hour', time.time()) export_indicator(cursor,package,provider_prefix,'indicator03_admin0_date',output_data_path,'indicator03_admin0_date', time.time()) export_indicator(cursor,package,provider_prefix,'indicator03_admin1_date',output_data_path,'indicator03_admin1_date', time.time()) export_indicator(cursor,package,provider_prefix,'indicator03_admin2_date',output_data_path,'indicator03_admin2_date', time.time()) export_indicator(cursor,package,provider_prefix,'indicator03_admin3_date',output_data_path,'indicator03_admin3_date', time.time()) # raw_sql = sql_to_string('wb_indicators/indicator01_admin2_hour_export.sql') # query = raw_sql.format(provider_prefix=provider_prefix) # cursor.execute(query) # file_path = '{output_data_path}/{provider_prefix}_indicator01_02_admin2_hour.csv'.format(provider_prefix=provider_prefix,output_data_path=output_data_path) # export_to_csv(file_path,cursor) print('########## FINISHED exprot indicator_1_2_3 ########## Elapsed time: {time} seconds'.format(time=format_two_point_time(timer, time.time())))