def __main__(): global parser parser = args_options() args = parser.parse_args() with timer(): exit(*main(args))
source_data = list_files(pattern) if source_data: print "About to clean the data" clean_df = clean.clean_csv(source_data) print "About to store it in OCDS format" ocds.generate_json(clean_df) else: return["No source data found. Make sure there is at least one CSV file in " + source_folder, 1] return["Prepared and cleaned the files from the Compranet site.",0] def __main__(): global parser parser = args_options() args = parser.parse_args() with timer(): exit(*main(args)) if __name__ == "__main__": try: __main__() except (KeyboardInterrupt, pycurl.error): exit('Received Ctrl + C... Exiting! Bye.', 1)
previous_slice = True # Add the domain to the chart for axis, func in chart['domain'].items(): chart['meta'][axis]['domain'] = d[axis] # Append the chart data lense['charts'].append(chart['meta']) file_name = os.path.join(settings.folder_charts, lense_id + '.json') with open(file_name, 'w') as outfile: json.dump(lense, outfile) def __main__(): global parser parser = args_options() args = parser.parse_args() with timer(): exit(*main(args)) if __name__ == "__main__": try: __main__() except (KeyboardInterrupt, pycurl.error): exit('Received Ctrl + C... Exiting! Bye.', 1)