X-Git-Url: https://piware.de/gitweb/?a=blobdiff_plain;f=consors-report.py;h=81c7e3911e329b4b5a7b5836aa58f18a26bcee67;hb=HEAD;hp=2ed322ede60630b54c0348366d6b4933d24f7163;hpb=aa77966c4018e039afe10c2b56390186b9273c93;p=bin.git diff --git a/consors-report.py b/consors-report.py index 2ed322e..81c7e39 100755 --- a/consors-report.py +++ b/consors-report.py @@ -16,14 +16,15 @@ CATEGORIES = { 'Wohnung': re.compile('Telekom|hands4home|Goetzfried|Green Planet Energy|Beitragsservice.*Rundfunk', re.I), 'Medizin': re.compile(r'Apotheke|MVZ|\bmed\b|ZAB Abrechnung|Caika|HNOeins|PVS|Dr\..*Sellier|' r'BFS Health|Streifeneder|Labor|Physio|(Drescher.*Lung)|Osteopath|' - '(Dr.*Borchers)|(Debeka.*Überweisung)|(DKV.*Überweisung)|Beihilfe|Klinik', re.I), - 'Versicherung': re.compile('(debeka|DKV|Hallesche|Versicherung|Alte Leipziger|ConceptIF|' - 'Baloise).*Lastschrift', re.I), - 'Transport': re.compile('DB Vertrieb|Deutsche Bahn|Nextbike|Carsharing', re.I), + '(Dr.*Borchers)|(Debeka.*Überweisung)|(DKV.*Überweisung)|Beihilfe|Klinik|' + 'Niklas Hermann', re.I), + 'Versicherung': re.compile('((debeka|DKV|Hallesche|Versicherung|Alte Leipziger|ConceptIF|' + 'Baloise).*Lastschrift)|Hallesche.*Bonu', re.I), + 'Transport': re.compile('DB Vertrieb|DB Fernverkehr|Deutsche Bahn|Nextbike|Carsharing|Radstation', re.I), 'Lebensmittel': re.compile('BIOS|Bäcker|Baecker|Ruta|Rewe', re.I), - 'Eigentumswohnungen': re.compile('Rechnung Darl.-Leistung|Semmelweis', re.I), + 'Eigentumswohnungen': re.compile('Rechnung Darl.-Leistung|Semmelweis|BHP Buerkner', re.I), 'Hobby/Sport': re.compile('Holstein|Mrs. Sporty|Kieser|DJK|Dimaso', re.I), - 'Sparen': re.compile('Bausparkasse Mainz AG|FIL Fondsbank|MIG (Fonds|GmbH)|Netfonds AG', re.I), + 'Sparen': re.compile('Bausparkasse Mainz AG|FIL Fondsbank|MIG (Fonds|GmbH)|Netfonds AG|Festgeld', re.I), 'Spenden': re.compile('Spende|Signal Foundation|nebenan.de|(paypal.*Sabine.Hossenf)|' 'Patreon|Umwelthilfe|Foerderer|Malteser|(Aktion Tier.*Mensch)|' 'campact|Amnesty', re.I), @@ -47,6 +48,8 @@ def get_category(item: str) -> str: def parse_entry(raw_fields: Iterable[str]) -> Entry: fields = [f.strip() for f in raw_fields] + # format change in May 2024, adds a 9th field "Währung"; ignore + fields = fields[:8] # last field is the value, parse as float value = float(fields.pop().replace('.', '').replace(',', '.')) # match on who, IBAN, type, or desc @@ -64,7 +67,7 @@ def parse_csv(path: Path, date_filter: str) -> Iterable[Entry]: return filter_re.search(entry.date) with path.open() as f: - reader = csv.reader(f) + reader = csv.reader(f, delimiter=';') next(reader) # skip header # first line is the column headers, chop it off entries = map(parse_entry, reader)