acctf


Nameacctf JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/hirano00o/acctf
Summarylibrary that scrapes the data from an account such as securities, bank
upload_time2024-04-20 14:53:00
maintainerNone
docs_urlNone
authorhirano00o
requires_python>=3.11
licenseNone
keywords scrape account development
VCS
bugtrack_url
requirements beautifulsoup4 bs4 lxml pandas PySocks selenium pyotp html5lib
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # acctf

### English | [日本語](https://github.com/hirano00o/acctf/blob/main/README.ja.md)

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

```console
pip install acctf
```

## Example

### Securities

```python
from acctf.securities.sbi import SBI
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
driver = webdriver.Chrome(options=options)

sbi = SBI(driver=driver).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.logout()
sbi.close()
```

```console
銘柄, 数量, 取得単価, 現在値
0000 銘柄1, 1000, 1234, 2345
1111 銘柄2, 1500, 789, 987
2222 銘柄3, 2000, 3450, 3456
```

### Bank

#### Balance

```python
from acctf.bank.mizuho import Mizuho
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
driver = webdriver.Chrome(options=options)

mizuho = Mizuho(driver=driver).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.logout()
mizuho.close()
```

```console
口座番号, 店舗, 残高, 口座タイプ
7654321, 本店, 1234567.0, DepositType.ordinary
```

#### Transaction history

```python
from acctf.bank.mizuho import Mizuho
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
driver = webdriver.Chrome(options=options)

mizuho = Mizuho(driver=driver).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.logout()
mizuho.close()
```

```console
日付, 取引内容, 金額
2023-12-01, ATM引き出し, -10000.0
2024-12-20, 給与, 200000.0
```

### Other

#### WealthNavi

```python
from acctf.other.wealthnavi import WealthNavi
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
driver = webdriver.Chrome(options=options)

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

w.logout()
w.close()
```

```console
資産クラス, 現在価格, 損益
米国株(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
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hirano00o/acctf",
    "name": "acctf",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "scrape, account, development",
    "author": "hirano00o",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# acctf\n\n### English | [\u65e5\u672c\u8a9e](https://github.com/hirano00o/acctf/blob/main/README.ja.md)\n\nThis is a library that obtains deposit/withdrawal history, price and quantity of held stocks from bank and securities accounts.\n\nCurrently, it supports the following.\n### Securities\n* SBI Securities\n  * Yen-denominated\n    * Stocks\n      * cash/specified deposit\n    * Funds\n      * specified deposit\n      * NISA deposit(accumulated investment limit)\n      * Old accumulated NISA deposit\n  * Foreign-denominated\n    * Stocks(Only US)\n      * cash/specified deposit\n\n### Bank\n* Mizuho Bank(Only Yen)\n  * Balance\n  * Transaction history\n* SBI Net Bank\n  * Balance(Include hybrid deposit)(Only Yen)\n  * Transaction history(Include hybrid deposit)\n\n### Other\n* WealthNavi\n  * Each valuation\n\n# How to use\n\n## Installation\n\n```console\npip install acctf\n```\n\n## Example\n\n### Securities\n\n```python\nfrom acctf.securities.sbi import SBI\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\noptions = Options()\noptions.add_argument('--headless')\noptions.add_argument('--no-sandbox')\ndriver = webdriver.Chrome(options=options)\n\nsbi = SBI(driver=driver).login(\"<\u30e6\u30fc\u30b6ID>\", \"<\u30d1\u30b9\u30ef\u30fc\u30c9>\")\nstocks = sbi.get_stock_specific()\nprint(\"\u9298\u67c4, \u6570\u91cf, \u53d6\u5f97\u5358\u4fa1, \u73fe\u5728\u5024\")\nfor s in stocks:\n  print(f\"{s.name}, {s.amount}, {s.acquisition_value}, {s.current_value}\")\n\nsbi.logout()\nsbi.close()\n```\n\n```console\n\u9298\u67c4, \u6570\u91cf, \u53d6\u5f97\u5358\u4fa1, \u73fe\u5728\u5024\n0000 \u9298\u67c41, 1000, 1234, 2345\n1111 \u9298\u67c42, 1500, 789, 987\n2222 \u9298\u67c43, 2000, 3450, 3456\n```\n\n### Bank\n\n#### Balance\n\n```python\nfrom acctf.bank.mizuho import Mizuho\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\noptions = Options()\noptions.add_argument('--headless')\noptions.add_argument('--no-sandbox')\ndriver = webdriver.Chrome(options=options)\n\nmizuho = Mizuho(driver=driver).login(\"<\u30e6\u30fc\u30b6ID>\", \"<\u30d1\u30b9\u30ef\u30fc\u30c9>\")\nb = mizuho.get_balance(\"7654321\")\nprint(f\"\u53e3\u5ea7\u756a\u53f7, \u5e97\u8217, \u6b8b\u9ad8, \u53e3\u5ea7\u30bf\u30a4\u30d7\")\nprint(f\"{b[0].account_number}, {b[0].branch_name}, {b[0].value}, {b[0].deposit_type}\")\n\nmizuho.logout()\nmizuho.close()\n```\n\n```console\n\u53e3\u5ea7\u756a\u53f7, \u5e97\u8217, \u6b8b\u9ad8, \u53e3\u5ea7\u30bf\u30a4\u30d7\n7654321, \u672c\u5e97, 1234567.0, DepositType.ordinary\n```\n\n#### Transaction history\n\n```python\nfrom acctf.bank.mizuho import Mizuho\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\noptions = Options()\noptions.add_argument('--headless')\noptions.add_argument('--no-sandbox')\ndriver = webdriver.Chrome(options=options)\n\nmizuho = Mizuho(driver=driver).login(\"<\u30e6\u30fc\u30b6ID>\", \"<\u30d1\u30b9\u30ef\u30fc\u30c9>\")\nhist = mizuho.get_transaction_history(\"7654321\")\n# You can also specify the start/end date.\n# hist = mizuho.get_transaction_history(\"7654321\", date(2023, 12, 1), date(2023, 12, 31))\nprint(f\"\u65e5\u4ed8, \u53d6\u5f15\u5185\u5bb9, \u91d1\u984d\")\nfor h in hist:\n  print(f\"{h.date}, {h.content}, {h.value}\")\n\nmizuho.logout()\nmizuho.close()\n```\n\n```console\n\u65e5\u4ed8, \u53d6\u5f15\u5185\u5bb9, \u91d1\u984d\n2023-12-01, \uff21\uff34\uff2d\u5f15\u304d\u51fa\u3057, -10000.0\n2024-12-20, \u7d66\u4e0e, 200000.0\n```\n\n### Other\n\n#### WealthNavi\n\n```python\nfrom acctf.other.wealthnavi import WealthNavi\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\noptions = Options()\noptions.add_argument('--headless')\noptions.add_argument('--no-sandbox')\ndriver = webdriver.Chrome(options=options)\n\nw = WealthNavi(driver=driver).login(\"<\u30e6\u30fc\u30b6ID>\", \"<\u30d1\u30b9\u30ef\u30fc\u30c9>\", \"<TOTP>\")\n# If you don't set the Time-based One Time Password\n# w = WealthNavi().login(\"<\u30e6\u30fc\u30b6ID>\", \"<\u30d1\u30b9\u30ef\u30fc\u30c9>\")\nprint(\"\u8cc7\u7523\u30af\u30e9\u30b9, \u73fe\u5728\u4fa1\u683c, \u640d\u76ca\")\nfor h in w.get_valuation():\n  print(f\"{h.name}, {h.value}, {h.pl_value}\")\n\nw.logout()\nw.close()\n```\n\n```console\n\u8cc7\u7523\u30af\u30e9\u30b9, \u73fe\u5728\u4fa1\u683c, \u640d\u76ca\n\u7c73\u56fd\u682a(VTI), 123456.0, 12345.0\n\u65e5\u6b27\u682a(VEA), 123456.0, 12345.0\n\u65b0\u8208\u56fd\u682a(VWO), 123456.0, 12345.0\n\u50b5\u5238(AGG), 123456.0, 12345.0\n\u91d1(GLD), 123456.0, 12345.0\n\u91d1(IAU), 123456.0, 12345.0\n\u4e0d\u52d5\u7523(IYR), 123456.0, 12345.0\n\u73fe\u91d1, 123456.0, 0.0\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "library that scrapes the data from an account such as securities, bank",
    "version": "0.4.1",
    "project_urls": {
        "Homepage": "https://github.com/hirano00o/acctf"
    },
    "split_keywords": [
        "scrape",
        " account",
        " development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c80cdfb946a8a35ef2bfddad7e0fdaf55a0de69e1e59508df6792097bb564da9",
                "md5": "64f7d5413170129241d393de151aa7b9",
                "sha256": "48feb2c7b297fd2182835c8909465418658fdc2a5207d0b30f566da69f1477e6"
            },
            "downloads": -1,
            "filename": "acctf-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64f7d5413170129241d393de151aa7b9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 14837,
            "upload_time": "2024-04-20T14:53:00",
            "upload_time_iso_8601": "2024-04-20T14:53:00.946477Z",
            "url": "https://files.pythonhosted.org/packages/c8/0c/dfb946a8a35ef2bfddad7e0fdaf55a0de69e1e59508df6792097bb564da9/acctf-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-20 14:53:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hirano00o",
    "github_project": "acctf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    ">=",
                    "4.12.2"
                ]
            ]
        },
        {
            "name": "bs4",
            "specs": [
                [
                    ">=",
                    "0.0.1"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    ">=",
                    "5.0.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "2.1.4"
                ]
            ]
        },
        {
            "name": "PySocks",
            "specs": [
                [
                    ">=",
                    "1.7.1"
                ]
            ]
        },
        {
            "name": "selenium",
            "specs": [
                [
                    ">=",
                    "4.16.0"
                ]
            ]
        },
        {
            "name": "pyotp",
            "specs": [
                [
                    "==",
                    "2.9.0"
                ]
            ]
        },
        {
            "name": "html5lib",
            "specs": [
                [
                    ">=",
                    "1.1"
                ]
            ]
        }
    ],
    "lcname": "acctf"
}
        
Elapsed time: 0.25800s