Skip to main content

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.

Metadata

Release files for dbs-statement-downloader 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbs-statement-downloader 0.2.1
File Size Uploaded
dbs_statement_downloader-0.2.1.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbs-statement-downloader 0.2.1
File Interpreter ABI Platform
dbs_statement_downloader-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / dbs_statement_downloader-0.2.1.tar.gz

Download URL dbs_statement_downloader-0.2.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eca974832e2d502c22deebf19290c06e04cf7f8d62c505b3d7106fae1023218f
BLAKE2b-256 checksum
How to use checksums
5e27607d82c4adcb537a035443e7784c5afc0c8f788bacf49ac73a36f65fa318
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Linux/5.15.133.1-microsoft-standard-WSL2

Release files / dbs_statement_downloader-0.2.1-py3-none-any.whl

Download URL dbs_statement_downloader-0.2.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25d8efed787181240bb1748e298e0c81b51f9d732e06ed946acc3d6cd83f25bb
BLAKE2b-256 checksum
How to use checksums
ed24615e26c9946e2c07bf44c1acb899335d391b8b21366f4b65cc178c24a469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Linux/5.15.133.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page