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

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


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.13.4.tar.gz (234.9 kB view details)

Uploaded Source

Built Distribution

monopoly_core-0.13.4-py3-none-any.whl (249.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: monopoly_core-0.13.4.tar.gz
  • Upload date:
  • Size: 234.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Linux/6.5.0-1025-azure

File hashes

Hashes for monopoly_core-0.13.4.tar.gz
Algorithm Hash digest
SHA256 2537d1a00d1b75ac38702d7787a020142db3ba83f87cd6debb28fda597892b63
MD5 52c14f164cec3728d55b93aa59811630
BLAKE2b-256 53661f6725aaeef1691ae33a4e6fae4e90bb499edb0f4eff9e346b0613083d7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: monopoly_core-0.13.4-py3-none-any.whl
  • Upload date:
  • Size: 249.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Linux/6.5.0-1025-azure

File hashes

Hashes for monopoly_core-0.13.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5f22369b4e97b2bd8facbeb601b77a0229e26ee0ca79e38b099c31903d08131
MD5 661afad01c7e5b2c9e0b2381a70e7b5e
BLAKE2b-256 2a109d229404b4dc63ef6f3291a8308db719f6ece0f4a32fdaac40961a51d1df

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page