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 details)

Uploaded Source

Built Distribution

dbs_statement_downloader-0.2.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file dbs_statement_downloader-0.2.1.tar.gz.

File metadata

  • Download URL: dbs_statement_downloader-0.2.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for dbs_statement_downloader-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eca974832e2d502c22deebf19290c06e04cf7f8d62c505b3d7106fae1023218f
MD5 af7df8055f178980ac87a6d94172a860
BLAKE2b-256 5e27607d82c4adcb537a035443e7784c5afc0c8f788bacf49ac73a36f65fa318

See more details on using hashes here.

File details

Details for the file dbs_statement_downloader-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dbs_statement_downloader-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25d8efed787181240bb1748e298e0c81b51f9d732e06ed946acc3d6cd83f25bb
MD5 1d1a0f969450f471a159b4a7c8ee28e9
BLAKE2b-256 ed24615e26c9946e2c07bf44c1acb899335d391b8b21366f4b65cc178c24a469

See more details on using hashes here.

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