Skip to main content

Python library that downloads e-statements from DBS

Project description

DBS Statement Downloader

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

Python library that logs into the DBS iBanking frontend and download estatements using Selenium.

Since logging into the frontend requires an OTP, text-forwarding (independent of this repository) is used to send the contents of the SMS to a Gmail service account. This OTP is then passed to the Selenium browser.

Requests are then made to the undocumented DBS backend API (https://internet-banking.dbs.com.sg/api/v3/channels/estatements) to retrieve the relevant bank statements.

Install

Clone the repo

git clone https://github.com/benjamin-awd/dbs-statement-downloader.git

Install dependencies using Homebrew and poetry

brew install poetry
poetry env use 3.11
poetry shell
poetry install

Create .env file and update values

cp .env.template .env

See Prerequsites for information on Google Cloud/Gmail setup

Usage

The downloader can be run directly:

python3 src/dbs/main.py

or with Docker compose:

docker-compose build && docker-compose up

Prerequisites

  • Text-forwarding from iPhone/Android to an email account. On iOS, one possible method is to use an automation to forward SMS messages from DBS to an email account.

  • Google Cloud account, with the Gmail API enabled (see Google Cloud docs)

  • Authorized Gmail account (see Gmail API docs)

  • Secret stored on Google Secret Manager, which is defined in the .env file as SECRET_ID. The secret should be the contents of the token.json file generated by running the quickstart.py script in this repository. This allows the OTP to be retrieved from Gmail.

    Note: quickstart.py requires a credentials.json file to generate the Gmail access token, which can be generated with these steps.

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

dbs_statement_downloader-0.2.1.tar.gz (11.7 kB view hashes)

Uploaded Source

Built Distribution

dbs_statement_downloader-0.2.1-py3-none-any.whl (13.2 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