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
- Stocks
- Foreign-denominated
- Stocks(Only US)
- cash/specified deposit
- Stocks(Only US)
- Yen-denominated
Bank
- Mizuho Bank
- Balance(Only Yen)
- Transaction history
- SBI Net Bank
- Balance(Include hybrid deposit)(Only Yen)
- Transaction history(Include hybrid deposit)(Only Yen)
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
Metadata
Release files for acctf 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| acctf-0.0.2.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| acctf-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.1 kB
Release files / acctf-0.0.2.tar.gz
| Download URL | acctf-0.0.2.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92224fcfce612ce26db8f15aeb4c868a3154bd691aa3559c8e94bbdec5e2dddf
|
|
BLAKE2b-256 checksum How to use checksums |
20b5c8c6c375c2f79da4dc395df221e318a5120e1e4c8da8cca692a679f8a8dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / acctf-0.0.2-py3-none-any.whl
| Download URL | acctf-0.0.2-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ea454a49eb2d8995e886e2add7bd5b9e21b1042d85f9ca51b5756d0e602895c
|
|
BLAKE2b-256 checksum How to use checksums |
b3a54a182317ee190fcf0198d7e2b2904829ad12f9db13d30414e0478e454251
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|