Skip to main content

PDF parsing for Singaporean banks

Project description


Tests CI Code style: black Linting: pylint License: MIT

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monopoly_sg-0.2.0.tar.gz (15.0 kB view hashes)

Uploaded Source

Built Distribution

monopoly_sg-0.2.0-py3-none-any.whl (21.1 kB view hashes)

Uploaded Python 3

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