Monopoly is a Python library & CLI that converts bank statement PDFs to CSV.
Supported banks:
| Bank | Credit Statement | Debit Statement |
|---|---|---|
| American Express (Singapore Platinum, US) | β | β |
| Bank of America | β | β |
| Bank of Montreal (BMO) | β | β |
| Canadian Imperial Bank of Commerce (CIBC) | β | β |
| Canadian Tire Bank | β | β |
| Capital One Canada | β | β |
| Capital One 360 (US) | β | β |
| Chase | β | β |
| Citibank | β | β |
| DBS/POSB | β | β |
| HDFC Bank (India) | β | β |
| HSBC | β | β |
| Maybank | β | β |
| OCBC | β | β |
| Royal Bank of Canada (RBC) | β | β |
| Schwab Bank | N/A | β |
| Scotiabank | β | β |
| Standard Chartered | β | β |
| TD Canada Trust | β | β |
| Trust | β | β |
| UOB | β | β |
| US Bank | β | β |
| ZΓΌrcher Kantonalbank | β | β |
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 ocrmypdfor
brew install gcc@11 poppler ocrmypdfThen install with pipx:
pipx install monopoly-coreFor additional OCR support:
pipx install 'monopoly-core[ocr]'Monopoly runs in your terminal, allowing you to extract, transform and write bank statements to a CSV file.
To list commands and options:
monopoly --helpYou can run it on a single statement
monopoly src/monopoly/examples/example_statement.pdfor multiple statements
monopoly ./statementsTo keep the output filename the same as the input (with a .csv extension), pass:
monopoly path/to/file.pdf --output ./out --preserve-filenameBy default Monopoly writes a 4-column CSV. Pass --format json for a richer,
versioned schema (schema_version, statement metadata, payment summary, and a
stable per-transaction id):
monopoly path/to/file.pdf --output ./out --format jsonEach transaction also carries currency (the statement's settlement currency),
posting_date, a normalized direction ("credit"/"debit"), and a nullable
account slot. Per-transaction FX/original-currency and account last-4 extraction
are a planned follow-up (currently null).
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- 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.
Want to add a bank but can't share a real statement? See
CONTRIBUTING.md for the redacted text-fixture path
(monopoly-fixture dump / build).
Clone the repo
git clone https://github.com/benjamin-awd/monopoly.gitInstall system dependencies and the Python environment
make setupOn Linux this uses apt (build-essential, libpoppler-cpp-dev); elsewhere it uses Homebrew (brew bundle). Python itself is provisioned by uv (pinned in .python-version), not Homebrew.
