Skip to main content

Bank Statement Parser

Python Version License PyPI Version

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statement-parser 0.1.0
File Size Uploaded
statement_parser-0.1.0.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for statement-parser 0.1.0
File Interpreter ABI Platform
statement_parser-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.5 kB

Release files / statement_parser-0.1.0.tar.gz

Download URL statement_parser-0.1.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e70b9106b641b81793d8ae71ec6c097f525116640b1127c6bb8c0043551dd7ff
BLAKE2b-256 checksum
How to use checksums
6697e3a21fcbdb4bdbb5a627155a7e92f0e9727fd46966472539aba9bf5d79cd
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.0-py3-none-any.whl

Download URL statement_parser-0.1.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0177280fe410ddb171c46a9e75bd84cb3213e5036a328a9ad8971cc4a9ffd61
BLAKE2b-256 checksum
How to use checksums
c821da762a0732576ddc4f1de05272fe5d4734556aead350070595fd27647f4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

1 release file

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page