A Python application for parsing and processing bank statements from PDF files.
- PDF text extraction and parsing
- Support for multiple bank statement formats
- Parallel processing of multiple PDFs
- Transaction categorization
- Multiple export formats (CSV, Excel, JSON)
- Comprehensive logging
- Input validation and error handling
- Clone the repository:
git clone https://github.com/yourusername/estatement-parse.git
cd estatement-parse- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt-
Place your bank statement PDFs in the
data/statementsdirectory. -
Configure bank-specific regex patterns in
conf/bank_data_regex.yaml:
banks:
BankName:
pattern: "regex pattern"
transaction_date_group: 1
description_group: 2
amount_group: 3
cr_group: 4
invert_amount_if_cr: true
plus_means_negative: false
parse_date_format: "%d %b"- Configure transaction categories in
conf/category_mapping.yaml:
categories:
Shopping:
- AMAZON
- WALMART
Food:
- RESTAURANT
- GROCERYRun the application:
python -m src.mainThe processed transactions will be exported to:
data/csv/transactions_YYYYMMDD.csvdata/csv/transactions_YYYYMMDD.xlsxdata/csv/transactions_YYYYMMDD.json
estatement-parse/
├── src/
│ ├── processors/ # Bank statement processors
│ ├── models/ # Data models
│ ├── utils/ # Utility functions
│ └── main.py # Application entry point
├── tests/ # Test files
├── conf/ # Configuration files
├── data/ # Data directories
│ ├── csv/ # Exported transactions
│ ├── statements/ # Input PDF files
│ └── logs/ # Application logs
└── requirements.txt # Dependencies
Logs are written to:
- Console (INFO level)
data/logs/app.log(DEBUG level)
The application includes comprehensive error handling for:
- PDF parsing errors
- Transaction parsing errors
- Configuration errors
- Input validation errors
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.