Skip to main content

Crawling Korea bank transactions

Project description

Simple Bank Korea PyPI version Build Status codecov.io

Simplest Transaction Crawler for Korea Banks

Requirements:

  • bs4 (BeautifulSoup4)
  • requests
  • python-dateutil
  • selenium
  • pillow (PIL)
  • PhantomJS Binary (Automatically Download, but libfontconfig is dependency on Linux)

Install

Install package with pip:

pip install -U simple_bank_korea

KB (Kookmin Bank)

Currently supports KB국민은행(Kookmin Bank) only.

Before Use

You must activate '빠른조회' service for each banks.

check this: https://obank.kbstar.com/quics?page=C025255&cc=b028364:b028702&QSL=F#

You can only use service('빠른조회')-registered bank accounts.

Usage

Import functions from each bank:

from simple_bank_korea.kb import get_transactions

# get_transactions returns list of dicts
# like this:
# [{'transaction_by': '', 'date': datetime.datetime(2017, 9, 11, 12, 39, 42), 'amount': 50, 'balance': 394}]

# example
transaction_list = get_transactions(
        bank_num='47380204123456',
        birthday='941021',
        password='5432',
        # days=30, # Optional, default is 30
        # PHANTOM_PATH='/Users/beomi/bin/phantomjs', # Optional, default is 'phantomjs' only.
        # LOG_PATH='/Users/beomi/phantom.log' # Optional, default is os.path.devnull (no log)
    )

for trs in transaction_list:
    print(trs['date'], trs['amount'], trs['transaction_by'])

get_transactions() needs bank_num, birthday and password. and optionally you can use days arg for specific days from today.(default is 30days(1month))

Require Args

  • bank_num: Your account number. (String)
  • birthday: Your birthday with birth year(if 1994/10/21, do '941021'), 6 digits. (String)
  • password: Your bank account password. (String)

Optional Args

  • days: Days you want to get datas. Default is 30 days. (Integer)
  • PHANTOM_PATH: Your PhantomJS Binary file Location. Default is 'phantomjs', expecting registered in PATH. (If phantomjs is not in PATH, automatically download)
  • LOG_PATH: Path for phantomjs log file. Default is no logging.

Return types

get_transactions() returns list of dicts, and each dict has date, amount, balance and transaction_by.

  • get_transactions(): returns list of transaction dicts.

  • date: datetime

  • amount: int

  • balance: int

  • transaction_by: str

Update Log

0.2.15 (2020-06-04)

  • HotFix bugs on setup.py

0.2.14 (2020-06-04)

  • Fix bugs #4: (downloaded) phantomJS permission error

0.2.13 (2020-06-04)

  • Fix bugs when downloading phantomjs.
    • Fix affects on Linux and macOS only.
  • Add Guide(OS, Progress) when dowloading phantomjs.

0.2.10 (2017-11-11)

  • Hot-fix: implicitly import to explicit relevant import to prevent ImportError

0.2.9 (2017-11-11)

  • Download PhantomJS Binary if phantomjs is not in PATH

0.2.8 (2017-09-18)

  • Add caching strategy (using temp folder with saving touch-keys)
  • Fix typo in v0.2.7

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

simple_bank_korea-0.2.15.tar.gz (17.3 kB view details)

Uploaded Source

File details

Details for the file simple_bank_korea-0.2.15.tar.gz.

File metadata

  • Download URL: simple_bank_korea-0.2.15.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for simple_bank_korea-0.2.15.tar.gz
Algorithm Hash digest
SHA256 3dc68a33e3733fe041f603175f16e19a655ba5280285e3efc39eb6ffa6cffaa9
MD5 fe215c8e6415832cb58a17f4d755de6e
BLAKE2b-256 5e5a3e5fa7856d643428283367ae9b241d2725cea83d7522d309ac0f889a8b5d

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