Projekt

Obecné

Profil

DatasetProcessing » Historie » Revize 2

Revize 1 (Petr Hlaváč, 2020-05-05 09:13) → Revize 2/10 (Petr Hlaváč, 2020-05-06 10:11)

h1. DatasetProcessing 

 Složka obsahuje implementace processoru pro jednotlivé datasety. Processory jsou dynamicky importovány je tedy proto nutné dodržet pojemnování *"dataset-name"Processor.py*. 

 Je velmi žádoucí aby crawler pro stažení souboru používal funkci *CSVutils.export_data_to_csv(filename, date_dict)*. 

 Po implementování metody je nutné změnit *Return False* na *Return True* 

 h2. Generovaný Processor 

 <pre> 
 from Utilities.CSV import CSVDataLine 


 CSVDataLine, CSVutils 

 def process_file(filename): 
     """ 
     Method that take path to crawled file and outputs date dictionary: dictionary using method: 
     CSVutils.export_data_to_csv(filename, date_dict) 
     Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815) 
     and value is dictionary where keys devices (specified in configuration file) 
     and value is CSVDataLine.CSVDataLine with device,date and occurrence 

     Args: 
     filename: name of processed file 

     Returns: 
     None False if not implemented 
     date_dict True when implemented 
     """ 
     date_dict = dict() 

     #with open(filename, "r") as file: 
     print("You must implements process_file method first!") 
     #CSVutils.export_data_to_csv(filename, date_dict) 
     return None 

 False 
 </pre>