from fast_excel_to_bill.read_table import Read_unordered_Table, Read_Table from fast_excel_to_bill.table_config import TABLE_PATH, LIST_OF_KEYS def main(): table_object = Read_unordered_Table(path=TABLE_PATH, type= 'xlsx').get_values_after_key_as_dict(list_of_keys=LIST_OF_KEYS) # Get Specific Values only useable for this specific format: table_object['ZWISCHENSUMME']=table_object['BETRAG'][-4] table_object['STEUERSATZ']=table_object['BETRAG'][-3] table_object['STEUER']=table_object['BETRAG'][-2] table_object['SUMME']=table_object['BETRAG'][-1] for c,value in enumerate(table_object['MENGE']): if value == 'ZWISCHENSUMME': table_object['BESCHREIBUNG'] = table_object['BESCHREIBUNG'][1:c] table_object['MENGE'] = table_object['MENGE'][1:c] table_object['EINZELPREIS'] = table_object['EINZELPREIS'][1:c] table_object['BETRAG'] = table_object['BETRAG'][1:c] assert(len(table_object['BESCHREIBUNG'])==len(table_object['MENGE']),'FORMAT von CHRIS IST FEHLERHAFT, BESCHREIBUNGS Länge =! MENGE Länge') return table_object if __name__ == '__main__': table_object = main()