Skip to main content

Streamlit Tests CI License: AGPL 3.0

Monopoly is a Python library & CLI that converts bank statement PDFs to CSV.

Supported banks:

Bank Credit Statement Debit Statement
Bank of America ✅ ✅
Bank of Montreal (BMO) ✅ ✅
Canadian Imperial Bank of Commerce (CIBC) ✅ ✅
Canadian Tire Bank ✅ ❌
Capital One Canada ✅ ❌
Chase ✅ ❌
Citibank ✅ ❌
DBS/POSB ✅ ✅
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 ❌ ✅

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

For additional OCR support:

pipx install 'monopoly-core[ocr]'

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

To keep the output filename the same as the input (with a .csv extension), pass:

monopoly path/to/file.pdf --output ./out --preserve-filename

By 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 json

Each 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

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

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.git

Install dependencies using Homebrew

brew install make
make setup
brew bundle

Metadata

Release files for monopoly-core 0.23.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 monopoly-core 0.23.0
File Size Uploaded
monopoly_core-0.23.0.tar.gz 339.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for monopoly-core 0.23.0
File Interpreter ABI Platform
monopoly_core-0.23.0-py3-none-any.whl Python 3 none any Details

Total release size: 632.2 kB

Release files / monopoly_core-0.23.0.tar.gz

Download URL monopoly_core-0.23.0.tar.gz
Size 339.5 kB
Tags Source
SHA-256 checksum
How to use checksums
415f3d52512aff4a7db7c289fd6aac70903fc8fa5ce385c342f66a44dc88a9b7
BLAKE2b-256 checksum
How to use checksums
c1b28dabdd2cb03e07429c8a9c109c59fb3da1261e10e55c11a064a717a8490f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / monopoly_core-0.23.0-py3-none-any.whl

Download URL monopoly_core-0.23.0-py3-none-any.whl
Size 292.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4173ef93a6553ccbb399ebe18b3c47cd0f84f76a9f7a25d034c1e737eaa19783
BLAKE2b-256 checksum
How to use checksums
8a8215218e6583a3a3bd2a4ea9d78a8e444546192a8059e4a4268778efa2a8f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.23.0 This release

2 release files

0.21.7

2 release files

0.21.6

2 release files

0.21.4

2 release files

0.21.3

2 release files

0.21.2

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.7

2 release files

0.19.5

2 release files

0.19.3

2 release files

0.18.4

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.6

2 release files

0.13.5

2 release files

0.13.4

2 release files

0.13.3

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.5

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.10.9

2 release files

0.10.8

2 release files

0.10.7

2 release files

0.10.6

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

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