8/23/2023 0 Comments Photosweeper quotupdateLogin_id = "XXXXX" password = "XXXXXXXX" Totp = 'XXXXXXXXXXXXXXXX' try : access_token = open ( 'access_token.txt', 'r' ). DEBUG ) Get an access tokenĪlways keep credentials in a separate file If more debug information is needed, enable logging using the following code. The whole library is equipped with python‘s logging module for debugging. The original REST API that this SDK is based on is available online.Īlice Blue API REST documentation Using the API Logging Ideally you only need to create an access_token once every day. With an access token, you can instantiate an AlphaTrade object again. See the examples folder with config.py file to see how to store your credentials. When the AlphaTrade object is created an access token from the SAS Online alpha trade server is stored in text file access_token.txt in the same directory. There is only one class in the whole library: AlphaTrade. Please clone this repository and check the examples folder to get started.Ĭheck here Getting started with API Overview The modules can also be installed using pip Examples - Start Here - Important Pip -no-cache-dir install -upgrade alphatrade To force upgrade existing installations: pip uninstall alphatrade It can also be installed from pypi pip install alphatrade This module is installed via pip: pip install git+ This work is completely based on Python SDK / APIs for AliceBlueOnline. Websocket connections are handled automatically within the library. The HTTP calls have been converted to methods and JSON responses are wrapped into Python-compatible objects. The Python APIs for communicating with the SAS Online Alpha Trade Web Platform.Īlpha Trade Python library provides an easy to use python wrapper over the HTTPS APIs. NOTE:: This is Unofficial python module, don't ask SAS support team for help, use it AS-IS Expecting issues with the streaming data !!! :P.Try the examples python zlogin_example.py, python zexample_sas_login.py, python zhistorical_data.py and python zstreaming_data.py.Create the config.py file in root of cloned repo with login_id, password and TOTP SECRET, you can add the access_token.txt if you want to use existing access_token.Install requirement.txt - python -m pip install -r requirement.txt.There is a bug with protlib, target is to get reed of protlib in future Install dev-requirement.txt - python -m pip install -r dev-requirements.txt - this is to ensure setuptools=57.5.0 is installed.Create a virtualenv - python -m pip install virtualenv and then python -m virtualenv venv and activate the venv environment.The examples folder is removed and examples are renamed and kept in root directory for ease of development.Check whether streaming websocket is working or not.Added new search function to search scrips which will return json for found scrips, you need to process it further.TOTP SECRET or TOTP both can be given as argument while creating AlphaTrade object (if it is 6 digits it will conside TOTP else TOTP SECRET).Removed check for enabled exchanges, you can now download or search symbols from MCX as well if it is not enabled.Python APIs for SAS Online Alpha Trade Web Platform MAJOR CHANGES : NEW VERSION 1.0.0 API endpoints are changed to match the new ones, bugs expected
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |