Monopoly is a Python library & CLI that converts bank statement PDFs to CSV
Project description
Monopoly is a Python library & CLI that converts bank statement PDFs to CSV.
Supported banks:
Bank | Credit Statement | Debit Statement |
---|---|---|
Citibank | ✅ | ❌ |
DBS/POSB | ✅ | ✅ |
HSBC | ✅ | ❌ |
Maybank | ✅ | ✅ |
OCBC | ✅ | ✅ |
Standard Chartered | ✅ | ❌ |
Install
Monopoly is a pip-installable Python package on PyPI under the name monopoly-core
.
Since Monopoly uses pdftotext
, you'll need to install additional dependencies:
apt-get install build-essential libpoppler-cpp-dev pkg-config ocrmypdf
or
brew install gcc@11 pkg-config poppler ocrmypdf
Then install with pipx:
pipx install monopoly-core
Usage
Monopoly runs in your terminal, allowing you to extract, transform and write bank statements to a CSV file.
To list commands and options:
monopoly --help
You can run it on a single statement
monopoly src/monopoly/examples/example_statement.pdf
or multiple statements
monopoly ./statements
If you need to run monopoly on a password protected file, ensure that passwords are set in the .env file:
cp .env.template .env
PDF_PASSWORDS=["password1","password2"]
Monopoly can also be run as a Python library:
python3 src/monopoly/examples/single_statement.py
Features
- Parses PDFs using predefined configuration classes per bank.
- Handles locked PDFs with credentials passed via environment variables.
- Supports adding OCR for image-based bank statements.
- Provides a generic parser that can be used without any predefined configuration (caveat emptor).
- Includes a safety check (enabled by default) that validates totals for debit or credit statements.
Development
Clone the repo
git clone https://github.com/benjamin-awd/monopoly.git
Install dependencies using Homebrew
brew install make
make setup
brew bundle
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for monopoly_core-0.12.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd58ceebf359de01a2f888f35ed04372fa2c8bded33c93f04c7bc4edcc59778 |
|
MD5 | d0804bf9cc7a6d9ca6ecdfba42accb3d |
|
BLAKE2b-256 | 5943838b9ae4394c9c4a932fcc3678d1b7aab7f3280ce8959d976516a08e9ec6 |