LoginSignup
8
14

More than 3 years have passed since last update.

kabuステーション®API - REST API用のPythonラッパーをつくってみた

Last updated at Posted at 2020-09-10

概要

以下のkabuステーションAPI記事回では辞書形式からjson形式への変換、requestsの作成、レスポンスのjson形式から辞書型への再変換を毎度行っていたが、このあたりを簡略化するモジュールを作成した。

'20/10/07追記

token周りをアプデしてザックリな使い方を書きました

環境

  • Windows 10
  • Python 3.8.5 ( Microsoft Store からインストール )

使い方

requests のインストールが必要である。

pip install requests

以下よりダウンロードまたはcloneする。

kabusapi があるフォルダで起動した端末のインタプリタですぐに使うことができる。

PS C:\Users\Shirasu> python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import kabusapi
>>> api = kabusapi.Context('localhost', '18080', 'password') 
>>> api.wallet.cash()                                       
{'StockAccountWallet': 123456.7}
>>>

他の使い方は同 Git の sample フォルダ内 sample.py を参照のこと。

関連記事

8
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
14