TradeViaPython / Kite_Zerodha

156 stars 108 forks source link

1.Profile 2.holdings #1

Open RAJURAM123 opened 1 year ago

RAJURAM123 commented 1 year ago

If possible kindly add profile attribute in kiteapp

Anirudh-12 commented 1 year ago

add this method to kite_trade.py

def profile(self):
        profile = self.session.get(f"{self.root_url}/user/profile", headers=self.headers).json()["data"]
        return profile

it will retrive profile information in this format

{'user_id': '**', 'user_type': 'individual', 'email': 'urname@gmail.com', 'user_name': 'Firstname Lastname', 'user_shortname': 'urname', 'broker': 'ZERODHA', 'exchanges': ['MF', 'NFO', 'BSE', 'NSE'], 'products': ['CNC', 'NRML', 'MIS', 'BO', 'CO'], 'order_types': ['MARKET', 'LIMIT', 'SL', 'SL-M'], 'avatar_url': None, 'meta': {'demat_consent': 'consent'}}