Projekt

Obecné

Profil

Akce

DatasetProcessing » Historie » Revize 1

Revize 1/10 | Další »
Petr Hlaváč, 2020-05-05 09:13


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

Generovaný Processor

from Utilities.CSV import CSVDataLine, CSVutils

def process_file(filename):
    """ 
    Method that take path to crawled file and outputs date 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:
    False if not implemented
    True when implemented
    """ 
    #with open(filename, "r") as file:
    print("You must implements process_file method first!")
    #CSVutils.export_data_to_csv(filename, date_dict)
    return False

Aktualizováno uživatelem Petr Hlaváč před asi 4 roky(ů) · 1 revizí