Skip to content

kishorekumarganta/How-to-setup-Finvasia-Shoonya-Api-Login-and-Generate-Session

Repository files navigation

How to setup Finvasia Shoonya Api Login and Generate Session

I am single, Unable to fetch Time Here, So Taking too Much Time for every release.

First Download Official Finvasia Shoonya API Code From Their

github Link: https://github.com/Shoonya-Dev/ShoonyaApi-py


Install Python and one Text Editor Like Sublime in Your System.

To Install any Python packages First Press " Windows+R" > Enter "CMD" > "pip install pandas"


Now create a config.py file to store passwords. Save Below Details in config.py file

#credentials
user    = <uid>
pwd     = <password>
factor2 = <2nd factor>
vc      = <vendor code>
app_key = <secret key>
imei    = <imei>

Will Get Above Details From Finvasia Prism Login or contact them at support


Once Done

to build this package and install it on your server

go to shoonya API Extracted folder where requirements.txt is there,

Right Click > Open Terminal and Type

pip install -r requirements.txt


Copy api_helper.py file to working folder from shoonya Api.


Create test.py file to working folder.

Install NorenRestAPI.whl from Dist Folder of Shoonya API Code

pip install NorenRestApiPy-0.0.20-py2.py3-none-any.whl

pip install requests

pip install websocket_client

pip install pandas

pip install pyyaml

pip install requests

import config
from api_helper import ShoonyaApiPy
import logging

#enable dbug to see request and responses
logging.basicConfig(level=logging.DEBUG)

#start of our program
api = ShoonyaApiPy()  #Create an Object to use


ret = api.login(userid=config.user, password=config.pwd, twoFA=config.factor2, vendor_code=config.vc, api_secret=config.app_key, imei=config.imei)
print(ret)

##Go to Documentation at https://github.com/Shoonya-Dev/ShoonyaApi-py#md-login

You will Find Many Functions Prewritten There, Lets Try Limits Function

https://github.com/Shoonya-Dev/ShoonyaApi-py#md-get_limits

Lets Practice this on test2.py file

import config
import logging


from api_helper import ShoonyaApiPy

api = ShoonyaApiPy()  #Create an Object to use
ret = api.login(userid=config.user, password=config.pwd, twoFA=config.factor2, vendor_code=config.vc, api_secret=config.app_key, imei=config.imei)

print(api.get_limits())
#will show my all Limits

print( "  \n ** My Cash Account Limit is ==> ",api.get_limits()['cash']," \n")
#To get my Cash Limit
#for line break in print use  \n

Author

Ganta Kishore Kumar


License

Copyright (C) of API belong to API Owners.


About

How to setup Finvasia Shoonya Api Login and Generate Session

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages