Bank Statement Parser
Bank Statement Parser is a Python library designed to parse and normalize transaction data from various bank statement formats ( CSV, Excel, etc.) into a consistent and easy-to-use Pandas DataFrame. It supports multiple banks and file formats, making it a versatile tool for financial data analysis.
Features
- Multi-Format Support: Parse bank statements from CSV, Excel, and more.
- Config-Driven: All parsing behaviour is described by a config dict — no per-bank classes to maintain.
- Resilient: Tolerant of header spacing/punctuation changes and messy number/date formatting.
- Consistent Output: Normalized transaction data with standardized columns (
bank,created_date,remarks,amount,hash). - Easy Integration: Simple API for quick integration into your Python projects.
- Extensible: Add support for a new bank by writing config, not code.
Installation
You can install the library via pip:
pip install statement_parser
Usage
Using a bundled preset
from statement_parser import GenericBank, list_banks
print(list_banks()) # ['HDFC-CREDIT', 'HSBC-CREDIT', ...]
parser = GenericBank.from_builtin("HSBC-CREDIT")
df = parser.getDataFrame("path/to/statement.csv")
print(df.head())
Bring your own config
No subclassing required — define a config dict and hand it to GenericBank:
from statement_parser import GenericBank
config = {
"file": {
"delimiter": ",",
"header": {
"mode": "detect", # detect | fixed | none
"match": ["date", "description", "amount"],
"min_matches": 2,
},
},
"columns": { # logical -> candidate names
"date": ["Txn Date", "Date"],
"details": ["Description", "Narration"],
"amount": ["Amount"],
},
"date_field": "date",
"remarks": [{"field": "details"}],
"amount": {"mode": "direct", "field": "amount"},
}
parser = GenericBank(config, bank_id="MY-BANK")
df = parser.getDataFrame("path/to/statement.csv")
print(df.head())
Amount modes: direct (single amount column), signed (amount column whose
sign is decided by a CR/DR column), or deposit_minus_withdrawal (separate
deposit and withdrawal columns).
Metadata
Release files for statement-parser 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| statement_parser-0.1.2.tar.gz | 22.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| statement_parser-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.4 kB
Release files / statement_parser-0.1.2.tar.gz
| Download URL | statement_parser-0.1.2.tar.gz |
|---|---|
| Size | 22.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97efd8bc72a1f1c0196e83a43fc284b2e0d5bc60f0a368da1c008ebc2c868eba
|
|
BLAKE2b-256 checksum How to use checksums |
5310caeb56fcadc87c48acfe94b78422c3c88d014e65feb623eb64b9b75d94a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / statement_parser-0.1.2-py3-none-any.whl
| Download URL | statement_parser-0.1.2-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9ab0aeb56fea1c9a23640179a255bb5fbeb9cf9a0a5f887ce689eb26b2e291a
|
|
BLAKE2b-256 checksum How to use checksums |
e711bf2ae39038ef7c17e00468982278f67f87bf7b91923c73ad71872e6a8ce3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|