Skip to main content

library that scrapes the data from an account such as securities, bank

Project description

acctf

English | 日本語

This is a library that obtains deposit/withdrawal history, price and quantity of held stocks from bank and securities accounts.

Currently, it supports the following.

Securities

  • SBI Securities
    • Yen-denominated
      • Stocks
        • cash/specified deposit
      • Funds
        • specified deposit
        • NISA deposit(accumulated investment limit)
        • Old accumulated NISA deposit
    • Foreign-denominated
      • Stocks(Only US)
        • cash/specified deposit

Bank

  • Mizuho Bank(Only Yen)
    • Balance
    • Transaction history
  • SBI Net Bank
    • Balance(Include hybrid deposit)(Only Yen)
    • Transaction history(Include hybrid deposit)

Other

  • WealthNavi
    • Each valuation

How to use

Installation

pip install acctf

Example

Securities

from acctf.securities.sbi import SBI

sbi = SBI().login("<ユーザID>", "<パスワード>")
stocks = sbi.get_stock_specific()
print("銘柄, 数量, 取得単価, 現在値")
for s in stocks:
  print(f"{s.name}, {s.amount}, {s.acquisition_value}, {s.current_value}")

sbi.close()
銘柄, 数量, 取得単価, 現在値
0000 銘柄1, 1000, 1234, 2345
1111 銘柄2, 1500, 789, 987
2222 銘柄3, 2000, 3450, 3456

Bank

Balance

from acctf.bank.mizuho import Mizuho

mizuho = Mizuho().login("<ユーザID>", "<パスワード>")
b = mizuho.get_balance("7654321")
print(f"口座番号, 店舗, 残高, 口座タイプ")
print(f"{b[0].account_number}, {b[0].branch_name}, {b[0].value}, {b[0].deposit_type}")

mizuho.close()
口座番号, 店舗, 残高, 口座タイプ
7654321, 本店, 1234567.0, DepositType.ordinary

Transaction history

from acctf.bank.mizuho import Mizuho

mizuho = Mizuho().login("<ユーザID>", "<パスワード>")
hist = mizuho.get_transaction_history("7654321")
# You can also specify the start/end date.
# hist = mizuho.get_transaction_history("7654321", date(2023, 12, 1), date(2023, 12, 31))
print(f"日付, 取引内容, 金額")
for h in hist:
  print(f"{h.date}, {h.content}, {h.value}")

mizuho.close()
日付, 取引内容, 金額
2023-12-01, ATM引き出し, -10000.0
2024-12-20, 給与, 200000.0

Other

WealthNavi

from acctf.other.wealthnavi import WealthNavi

w = WealthNavi().login("<ユーザID>", "<パスワード>", "<ワンタイムパスワード>")
# If you don't set the One Time Password
# w = WealthNavi().login("<ユーザID>", "<パスワード>")
print("資産クラス, 現在価格, 損益")
for h in w.get_valuation():
  print(f"{h.name}, {h.value}, {h.pl_value}")

w.close()
資産クラス, 現在価格, 損益
米国株(VTI), 123456.0, 12345.0
日欧株(VEA), 123456.0, 12345.0
新興国株(VWO), 123456.0, 12345.0
債券(AGG), 123456.0, 12345.0
金(GLD), 123456.0, 12345.0
金(IAU), 123456.0, 12345.0
不動産(IYR), 123456.0, 12345.0
現金, 123456.0, 0.0

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

acctf-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

acctf-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file acctf-0.1.0.tar.gz.

File metadata

  • Download URL: acctf-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for acctf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0df198e995fe986fc037fbba157778fdd5251c90cf3d6315de371a3b942ad961
MD5 f2a932c235075396926d9bbd95d7875c
BLAKE2b-256 bd3312702cf8585c572218621841299ce8fae87b13e8afb0916ed8dc7f44f524

See more details on using hashes here.

File details

Details for the file acctf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: acctf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for acctf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0907cebd9204794a4aba0401b4a860d2fda2a809161de88a544fbd9bf40e9a6
MD5 0850bce54c1547ba916d0f692bbd57cc
BLAKE2b-256 f06bef927ab814ec63cedcd195ec56a8a7533268ce102afec9b3767b7e331b4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page