PDF parsing for Singaporean banks
Project description
Monopoly is a Python library that converts Singapore bank statement PDFs to CSV using pdftotext
Supported banks:
- Citibank
- DBS
- HSBC
- OCBC
- Standard Chartered
Only credit card statements are supported (for now)
Install
Install dependencies using Homebrew
brew bundle
Clone the repo
git clone https://github.com/benjamin-awd/monopoly.git
Create a virtual environment and install Python dependencies
pyenv virtualenv 3.11.4 monopoly
pyenv shell monopoly
poetry install
Usage
Monopoly can be run as a Python package, allowing you to extract, transform and write bank statements to a CSV file.
To see how Monopoly works, you can run this example
python3 monopoly/examples/single_statement.py
If your PDF is encrypted, you'll have to add the password to a .env file in the root directory, which is automatically read by monopoly
You can use the .env.template and then update values in the .env file
cp .env.template .env
Features
- Support for encrypted PDFs -- passwords can be passed in via a .env file, or passed directly via a bank class
- PDFs can also be unlocked with a static string, and a masking pattern like ?d?d?d for banks like HSBC that use a common password prefix (DOB), but different passwords for each card
- Cashback transactions from Citibank and OCBC are also supported, and appear as "negative" transactions
- Monopoly can be run on Google Cloud as a scheduled Cloud Run job, which opens up more sophisticated use-cases like historical analysis and personal finance visualization
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_sg-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d28be226a1c558fd62b12a0b6428a64ecaf6a505aeb689d91b1328a57afae28 |
|
MD5 | 2ff2c4c15f48fe42e168480358c5e782 |
|
BLAKE2b-256 | 826571dfe7e5697624bcba169002c5699e5a9cd7a4025fc3c5e12796c204aabe |