PDF Bank Statement Parser
Command-line tool for robustly converting PDF bank statements into clean usable CSV. Currently only works for statements from First National Bank (FNB) South Africa (please let me know if you want me to expand the scope).
Install
pip install pdf-bank-statement-parser
Example Usage
# parse a single PDF bank statement #
parse-bank-statement-pdf \
--input_filepath 'bank_statements/2024_03_27 - 2024_06_28.pdf' \
--output_path 'bank_statements/csv/2024_03_27 - 2024_06_28.csv'
# parse all PDF bank statements in a given directory #
parse-bank-statement-pdf \
--input_dir 'bank_statements/' \
--output_path 'bank_statements/csv/' \
--csv_sep_char ';'
The only format available from FNB for downloading historical bank statements is PDF, which is a useless format for any kind of downstream data task other than reading.
This tool uses pypdfium2 for text extraction from PDF and native python for everything else. Transactions are extracted using RegEx.
The parsed results are verified as follows:
-
It is checked (for every transaction extracted) that the balance amount is the sum of the previous balance and the transaction amount.
-
It is checked that the opening balance reported on the statement plus the sum of extracted transactions is equal to the closing balance reported on the statement.
Metadata
Release files for pdf-bank-statement-parser 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdf_bank_statement_parser-0.1.1.tar.gz | 27.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdf_bank_statement_parser-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.4 kB
Release files / pdf_bank_statement_parser-0.1.1.tar.gz
| Download URL | pdf_bank_statement_parser-0.1.1.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c19bd7ed723ac5a29a91af880901e07afad2b4b0e15ed699da0d37fed5bb1ac
|
|
BLAKE2b-256 checksum How to use checksums |
aa43d10dbf8b7faf80842fcd2c14031f5acea813a31c91b63556cf0b648b7044
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.29
|
Release files / pdf_bank_statement_parser-0.1.1-py3-none-any.whl
| Download URL | pdf_bank_statement_parser-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8bc7f6dffafc09ccbed6f28fddb60a3df1e9d7e7ed1e13dabdcf7215f8835d9d
|
|
BLAKE2b-256 checksum How to use checksums |
d5aabc3a920e275848096efbadf41dc55f098f76089a305c00a713b2b6abdbb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.29
|