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

issue with test pdf file #60

Open
kiashann opened this issue Mar 13, 2024 · 0 comments
Open

issue with test pdf file #60

kiashann opened this issue Mar 13, 2024 · 0 comments

Comments

@kiashann
Copy link

Hi. I installed the library on Google Colab and I ran the below instruction but I got the following error.

!psr pdf2csv '/content/bank-statement.pdf'

How can I use it in python code?
Error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py", line 3802, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Debit Amount'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/bin/psr", line 8, in
sys.exit(cli())
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/pdf_statement_reader/init.py", line 80, in pdf2csv
df = parse_statement(input_filename, config)
File "/usr/local/lib/python3.10/dist-packages/pdf_statement_reader/parse.py", line 104, in parse_statement
clean_numeric(statement, config)
File "/usr/local/lib/python3.10/dist-packages/pdf_statement_reader/parse.py", line 50, in clean_numeric
df[col] = df[col].apply(format_negatives)
File "/usr/local/lib/python3.10/dist-packages/pandas/core/frame.py", line 3807, in getitem
indexer = self.columns.get_loc(key)
File "/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py", line 3804, in get_loc
raise KeyError(key) from err
KeyError: 'Debit Amount'

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

1 participant