jugaad-py / jugaad-trader

Unofficial python client for Zerodha
https://marketsetup.in/documentation/jugaad-trader/
152 stars 107 forks source link

Unable to use console class #42

Open avlsi opened 2 years ago

avlsi commented 2 years ago

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.

ssheikh098 commented 1 year ago

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

image

avlsi commented 1 month ago

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'