Monopoly is a Python library & CLI that converts bank statement PDFs to CSV
Project description
Monopoly is a Python library & CLI that converts bank statement PDFs to CSV.
Supported banks:
Bank | Credit Statement | Debit Statement |
---|---|---|
Chase | ✅ | ❌ |
Citibank | ✅ | ❌ |
Bank of America | ✅ | ❌ |
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
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
Built Distribution
File details
Details for the file monopoly_core-0.13.0.tar.gz
.
File metadata
- Download URL: monopoly_core-0.13.0.tar.gz
- Upload date:
- Size: 234.8 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc6f6911c4f0bf4c233fa6e37c986dadcaf8dea643c02e627579029267e0f80 |
|
MD5 | 1920d3b1ae78364ec8e3a658983b2e20 |
|
BLAKE2b-256 | 3e9a24e331d04a0c6aed24876340a2943e9a2621457f57251109fdfa90154454 |
File details
Details for the file monopoly_core-0.13.0-py3-none-any.whl
.
File metadata
- Download URL: monopoly_core-0.13.0-py3-none-any.whl
- Upload date:
- Size: 249.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b3a83c3049febe8877cb6d247e56cbb0168759adfb44e5dc8fc0d3b50d4ca08 |
|
MD5 | 513298fddf7cffc681d72023938ec4ac |
|
BLAKE2b-256 | 4419791678dd0bd39603f5fd5964e0f72a8003754d2a93bcbe0c24824d6b2467 |