Skip to main content

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

Project description


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

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

monopoly_core-0.21.0.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

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

monopoly_core-0.21.0-py3-none-any.whl (271.8 kB view details)

Uploaded Python 3

File details

Details for the file monopoly_core-0.21.0.tar.gz.

File metadata

  • Download URL: monopoly_core-0.21.0.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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}

File hashes

Hashes for monopoly_core-0.21.0.tar.gz
Algorithm Hash digest
SHA256 bdba1ada1e200207192d2073ce0dbeacd31faf60779bd8fd9cd9b1af4ba0856b
MD5 25b0c4d3f773192dd290c4eb042ea1f5
BLAKE2b-256 50ea42d07cd5e11b34776e45e756392a091d07873551fe493e85183c2b413a11

See more details on using hashes here.

File details

Details for the file monopoly_core-0.21.0-py3-none-any.whl.

File metadata

  • Download URL: monopoly_core-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 271.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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}

File hashes

Hashes for monopoly_core-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e14fd3a449d563f8a16ff2bd373b999b25b2eef748f34a86b430d2bbf4d381bb
MD5 5a12dca4190d51f744bb8551ca5d5006
BLAKE2b-256 439a1dedb7f1b3dbbb4b1738ea0cac3d7974e3b5192fdf8b203863e826cda71b

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