kedder / ofxstatement

Tool to convert proprietary bank statement to OFX format, suitable for importing to GnuCash or other personal finance applications.
GNU General Public License v3.0
277 stars 61 forks source link

[bug] decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>] #231

Closed dev590t closed 1 year ago

dev590t commented 1 year ago

related issue https://github.com/kedder/ofxstatement-transferwise/issues/3

description

ofxstatement-transferwise doesn't run:

$ ofxstatement convert -t transferwise dir_csv/transaction-history.csv 2023-07-06.wise.ofx
Traceback (most recent call last):
  File "/home/compta/.venv/bin/ofxstatement", line 8, in <module>
    sys.exit(run())
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/tool.py", line 205, in run
    return args.func(args)
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/tool.py", line 176, in convert
    statement = parser.parse()
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/plugins/transferwise.py", line 42, in parse
    stmt = super().parse()
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/parser.py", line 46, in parse
    stmt_line = self.parse_record(line)
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/plugins/transferwise.py", line 54, in parse_record
    sl = super().parse_record(line)
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/parser.py", line 107, in parse_record
    value = self.parse_value(rawvalue, field)
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/parser.py", line 68, in parse_value
    return self.parse_decimal(value)
  File "/home/compta/.venv/lib/python3.9/site-packages/ofxstatement/parser.py", line 81, in parse_decimal
    return D(value.replace(",", ".").replace(" ", ""))
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

reproduce bug

  1. download csv file from wise in dir_csv/transaction-history.csv
  2. configure ofxstatement with:
    [transferwise]
    plugin = transferwise
    currency = EUR
    account = Wise
  3. run:
    ofxstatement convert -t transferwise dir_csv/transaction-history.csv 2023-07-06.wise.ofx
kedder commented 1 year ago

Closing because https://github.com/kedder/ofxstatement-transferwise/issues/3 was closed.