jugaad-py / jugaad-trader

Unofficial python client for Zerodha

Home Page:https://marketsetup.in/documentation/jugaad-trader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use console class

avlsi opened this issue · comments

commented

kite = Zerodha() # credentials are passed
kite.login()
Able to see holdings, profile from kite.

console = Console(z=kite)
console.dashboard()

Error message - kiteconnect.exceptions.TokenException: Invalid or expired session.

@avlsi it's because console class expects 'x-csrftoken' in header. so add below 2 lines in Console class

image

Thanks for the changes suggested. I am able to now get console till login
cons = Console(kite)
print("{}".format(cons.login()))
print("{}".format(cons.pnl_summary()))
However I am getting an error when accessing pnl_summary or anyother functions.
Error is as follows -
h['authorization'] = "enctoken {}".format(self.enc_token)
AttributeError: 'Console' object has no attribute 'enc_token'