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

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.1
File Size Uploaded
statement_parser-0.1.1.tar.gz 21.9 kB Details

Built distribution (wheel)

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

Total release size: 44.0 kB

Release files / statement_parser-0.1.1.tar.gz

Download URL statement_parser-0.1.1.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
be242ed5a99f8e14a1779b73bd737b1e0799a47aa2bc0407e825221134578422
BLAKE2b-256 checksum
How to use checksums
a311dfa618493c40179429efee01758a11dff3525b2b73a9460237ed77890761
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.1-py3-none-any.whl

Download URL statement_parser-0.1.1-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a7aee46dffc0e20562cbe7dc53111dba3e67ad75de2f20e921c1363ec0f7732
BLAKE2b-256 checksum
How to use checksums
358b1a0d497cb470ac7632fc511f610799f1310bb2cc522a06fdc5971e58f516
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

This release

0.1.1 This release

2 release files

0.1.0

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