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
Chase
Citibank
DBS/POSB
HSBC
Maybank
OCBC
Standard Chartered
Trust
UOB
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

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.15.0rc1.tar.gz (236.1 kB 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.15.0rc1-py3-none-any.whl (251.4 kB view details)

Uploaded Python 3

File details

Details for the file monopoly_core-0.15.0rc1.tar.gz.

File metadata

  • Download URL: monopoly_core-0.15.0rc1.tar.gz
  • Upload date:
  • Size: 236.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.12 Linux/6.11.0-1012-azure

File hashes

Hashes for monopoly_core-0.15.0rc1.tar.gz
Algorithm Hash digest
SHA256 8e9f23dee0c6bad061d53c324d90741dd54dd4e67e4b3b8506ed8b4fe41e8c82
MD5 752dd7cad4a5f46a0011eae995588dfb
BLAKE2b-256 2a2bc7f598c3a8d249e2f115a8f33c231803ff465c31eeb3d8b357ca6d32dc0d

See more details on using hashes here.

File details

Details for the file monopoly_core-0.15.0rc1-py3-none-any.whl.

File metadata

  • Download URL: monopoly_core-0.15.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 251.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.12 Linux/6.11.0-1012-azure

File hashes

Hashes for monopoly_core-0.15.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3d3a6f15d00949c29ef419f46343420eb0d975d7b6bb9247e7a5eb9bb002130
MD5 6dd5b164f0f2a8563e67af906e392e9b
BLAKE2b-256 935a12f3a92bd32b8387558d87ee09d733c88a8282ee08042c4419f08e8760d9

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