In the following kabu station API article, I converted from dictionary format to json format, created requests, and reconverted response from json format to dictionary type every time, but I created a module to simplify this.
-Use kabu Station® API from Python
-Receive Websocket of kabu station ® API in Python
You need to install requests.
pip install requests
Download or clone from the following.
It can be used immediately with the interpreter of the terminal started in the folder where kabusapi is located.
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}
>>>
For other usage, refer to sample.py in the sample folder of the same Git.
Recommended Posts