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 |
---|---|---|
Citibank | ✅ | ❌ |
DBS/POSB | ✅ | ✅ |
HSBC | ✅ | ❌ |
Maybank | ✅ | ✅ |
OCBC | ✅ | ✅ |
Standard Chartered | ✅ | ❌ |
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
Then intall 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
If you have multiple statements from the same bank with different passwords, make sure to set both passwords in an array format:
HSBC_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 a variety of date/number formats and determines if a transaction is debit or credit.
- 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 --file Brewfile.dev
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
Hashes for monopoly_core-0.9.5rc2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62fb1fab70139603a02a4909da84d4ba87ee3ebfe496d70228d2a2c4cf787900 |
|
MD5 | cce6094e991f2015eec1d1d9ccdc5aae |
|
BLAKE2b-256 | f9ccda014def809a676777363512f86fb4ca48278f61c646cb63e5f58cfc61a0 |