Skip to main content

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

Project description

🏦 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 toolbankparse 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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

statementsparser-0.1.0.tar.gz (159.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statementsparser-0.1.0-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

Details for the file statementsparser-0.1.0.tar.gz.

File metadata

  • Download URL: statementsparser-0.1.0.tar.gz
  • Upload date:
  • Size: 159.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for statementsparser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 447538bf6e44f9e5ff526bad0c371aa0a6a6bab362b06a8f03d1adba3af2ddee
MD5 03c2ab39de5cbe200043da298782ee3f
BLAKE2b-256 2ca3a8c45d96a856e4d5118dc30b4011afa3351426fd6cde6e1f2918040d33f0

See more details on using hashes here.

File details

Details for the file statementsparser-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for statementsparser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68a6a692a8a36511fca7114e8eac8cd9b5f1e14e6c0ef22f487996bd695f4416
MD5 3e52cc61327f3f3afa5294980076584d
BLAKE2b-256 b2f906d5103ce8689703ce951eea9a079566bcc88bd714fc1525728564eec1ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page