Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error #2

Open
KilianRK opened this issue Nov 11, 2021 · 11 comments
Open

Type error #2

KilianRK opened this issue Nov 11, 2021 · 11 comments

Comments

@KilianRK
Copy link

Hi,

I am interested in using this tool for GLS statements. However, when running the command "statement2csv" I get the following error. I am using python 3.7

_```
File "/usr/local/bin/statement2csv", line 10, in
sys.exit(run())
File "/home/xxx/.local/lib/python3.7/site-packages/bank_statement_reader/cli.py", line 57, in run
main(args or sys.argv[1:])
File "/home/xxx/.local/lib/python3.7/site-packages/bank_statement_reader/cli.py", line 49, in main
bookings: Bookings = files2booking(files)
File "/home/xxx/.local/lib/python3.7/site-packages/bank_statement_reader/statement_reader.py", line 267, in files2booking
bookings = bookings + pdf2bookings(filename)
File "/home/xxx/.local/lib/python3.7/site-packages/bank_statement_reader/bookings.py", line 52, in add
for itm in other:
File "/home/xxx/.local/lib/python3.7/site-packages/bank_statement_reader/bookings.py", line 44, in iter
for itm in sorted(super().iter()):
File "/home/xxx/.local/lib/python3.7/site-packages/bank_statement_reader/booking/booking_base.py", line 292, in lt
return self.date < other.date
TypeError: '<' not supported between instances of 'NoneType' and 'datetime.date

@CarliJoy
Copy link
Owner

Could you send me an example file to [email protected] ?

Otherwise it is hard to debug.

@KilianRK
Copy link
Author

Hi, Thanks for the quick answer. My bank statement is a little bit to sensitive to send you, though. Is there an alternative way?

@KilianRK
Copy link
Author

@CarliJoy
Copy link
Owner

Understandable. You could convert the statement to a txt file using pdftotext -layout bank_report.pdf - and remove critical stuff from there. But try to not change the length of the strings. I.e. replace name John Doe with Xxxx Xxx and 123,34 with 111,11. If you change the length of the strings or remove spaces, things could still brake between the file you give me and the file that is processed.
The issues arises as the script can't determine the correct date and therefore can't sort the entries correctly.

Without a test file there is unfortunately no way to fix it.

@KilianRK
Copy link
Author

That would be a lot of work. Can I delete most of the statement that you have just the header plus one transfer?

@CarliJoy
Copy link
Owner

@KilianRK learn regex, that could help you alot ;-)
You can try that but make sutre that this file causes the same error

@KilianRK
Copy link
Author

Okay, I'll try to set up an example file.

@CarliJoy
Copy link
Owner

@KilianRK any updates?

@ni-ka
Copy link

ni-ka commented Aug 26, 2022

@CarliJoy I have the same error and happy to generate a test file. So you don't need a pdf but just the text with obsfucated data (while keeping the length)?

@CarliJoy
Copy link
Owner

Exactly. Helpful would also be a screenshot of the PDF Statement, with obfuscated private data.

I have to note, that I haven't used the tool in a while as the GLS bank now offers CSV exports dating back at least 2 years (1 year in one file max).

Send me a mail with the data if you want.

@CarliJoy
Copy link
Owner

CarliJoy commented Jan 8, 2023

Still can't reproduce due to missing test data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants