Skip to main content

🏦 India Bank Parse

PyPI version Python 3.10+ License: MIT CI

Parse Indian bank statements (SBI, HDFC, ICICI, Axis) into clean, unified pandas DataFrames.

No more manual data entry. No more messy CSVs. Just clean, structured data from your bank PDFs.


✨ Features

  • 🏦 Multi-bank support — SBI, HDFC, ICICI, Axis Bank
  • 🔐 Password-protected PDFs — handles encrypted statements (DOB-based passwords)
  • 📊 Unified DataFrame output — same columns regardless of bank
  • 💳 UPI metadata extraction — parse UPI-ZOMATO-gpay-user@ybl into structured fields
  • 🏷️ Auto-categorization — Food, Salary, EMI, Rent, Investment, etc.
  • ✅ Balance verification — confirms opening + credits - debits = closing
  • 📤 Export to CSV/Excel/JSON — Tally-ready Excel with summary sheet
  • 🖥️ CLI tool — bankparse statement.pdf from your terminal
  • 🔍 Auto bank detection — detects which bank from PDF content

📦 Installation

pip install statementparser

🚀 Quick Start

Python API

from statementparser import parse

# Parse a statement (auto-detects bank)
stmt = parse("sbi_statement.pdf", password="01011990")

# Get a clean DataFrame
df = stmt.to_dataframe()
print(df[['date', 'amount', 'category', 'upi_merchant', 'upi_app']].head())

# Access structured data
for txn in stmt.transactions:
    print(f"{txn.date} | ₹{txn.amount} | {txn.category.value}")
    if txn.upi:
        print(f"  → {txn.upi.merchant} via {txn.upi.app}")

# Check balance verification
if stmt.balance_verification:
    print(f"Balance verified: {stmt.balance_verification.is_valid}")

CLI

# Pretty table output
bankparse statement.pdf --password 01011990

# Export to CSV
bankparse statement.pdf -p 01011990 -f csv -o transactions.csv

# Export to Excel (with summary sheet)
bankparse statement.pdf -p 01011990 -f excel

# Parse all PDFs in a folder
bankparse ./statements/ -p 01011990 -f excel

# Force a specific bank parser
bankparse statement.pdf -b sbi -f json

🏦 Supported Banks

Bank Status Formats
State Bank of India (SBI) ✅ PDF
HDFC Bank ✅ PDF
ICICI Bank ✅ PDF
Axis Bank ✅ PDF

💳 UPI Parsing

The library parses UPI narration strings into structured data:

Input:  "UPI-Hari Enterprises-gpay-11244530509@okbizaxis-UTIB0000553-121864632957"

Output: {
    "merchant": "Hari Enterprises",
    "app": "Google Pay",           # from "gpay" + @okbizaxis
    "vpa": "11244530509@okbizaxis",
    "counterparty_bank": "Axis Bank",  # from IFSC UTIB
    "upi_ref": "121864632957"
}

📊 Auto-Categorization

Transactions are automatically tagged:

Category Keywords
Food Zomato, Swiggy, Restaurant, Hotel
Shopping Amazon, Flipkart, Myntra
Investment Zerodha, Groww, Prudent, SIP
Salary Salary, Payroll
EMI EMI, Loan, Bajaj Finance
Transport Uber, Ola, IRCTC
... and 15+ more

🛠️ Development

# Clone and install
git clone https://github.com/iharshlalakiya/statementparser.git
cd statementparser
uv sync --extra dev

# Run tests
uv run pytest

# Lint & format
uv run ruff check src/ tests/
uv run ruff format src/ tests/

# Build
uv build

📄 License

MIT License — see LICENSE for details.

🤝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Want to add support for your bank? Check the parser guide — it's easier than you think!

Metadata

Release files for statementsparser 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 statementsparser 0.1.0
File Size Uploaded Provenance Actions
statementsparser-0.1.0.tar.gz 159.2 kB Without provenance Details for statementsparser-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 199.6 kB

Release files / statementsparser-0.1.0.tar.gz

Download URL statementsparser-0.1.0.tar.gz
Size 159.2 kB
Tags Source
SHA-256 checksum
How to use checksums
447538bf6e44f9e5ff526bad0c371aa0a6a6bab362b06a8f03d1adba3af2ddee
BLAKE2b-256 checksum
How to use checksums
2ca3a8c45d96a856e4d5118dc30b4011afa3351426fd6cde6e1f2918040d33f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release files / statementsparser-0.1.0-py3-none-any.whl

Download URL statementsparser-0.1.0-py3-none-any.whl
Size 40.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68a6a692a8a36511fca7114e8eac8cd9b5f1e14e6c0ef22f487996bd695f4416
BLAKE2b-256 checksum
How to use checksums
b2f906d5103ce8689703ce951eea9a079566bcc88bd714fc1525728564eec1ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Security for statementsparser 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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