Skip to content

Raise error or warning if fail to parse a transaction date #158

@dev590t

Description

@dev590t

my date format is "%d-%m-%Y":

|       Date | Amount |
| 21-03-2025 |  -4.58 |
| 11-03-2025 |   2000 |
| 13-03-2025 |  -2000 |
| 12-03-2026 |  -1999 |

with default configuration about date parsing:

from operator import itemgetter

mapping = {
    "has_header": True,
    "is_split": False,
    "bank": "?",
    "delimiter": ",",
    "account": "?",
    "date": itemgetter("Date"),
    "amount": itemgetter("Amount"),
}

I get output for the transaction at "21-03-2025", "13-03-2025" in OFX file. The transaction at "11-03-2025" and "12-03-2026" is filtered in OFX file.

My test file is small, so I can see output data is incorrect. But if I run csv2ofx on a big file, I can't see the error in output file. Then it will be time consuming to debug this error in data in accounting tool.
It is better if parsing failure raise a warning, or error (like when use "parse_fmt"), instead of quietly skip the transaction. So user know he should modify the config file to fix missing transaction in output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions