Shoonya-Dev / ShoonyaApi-py

144 stars 133 forks source link

get_daily_price_series() Response Issue #53

Closed raju-nichit closed 5 months ago

raju-nichit commented 2 years ago

Getting Response with some extra characters due to that pandas data frame not generating properly

image

Code -> res = self.get_daily_price_series(exchange, token, startdate, enddate) daily_df = pd.DataFrame(res)

Dataframe output

image

trivalent commented 1 year ago

+1 As visible, the response is not JSON compatible. @Shoonya-Dev request you to please adjust the response so it can be processed easily.

trivalent commented 11 months ago

Though this can be fixed at our end using the below syntax: def fix(data): import json return json.loads(data)

        response = self.api.finvasiaAPI.get_daily_price_series('NSE', instrument, startdate=start_time,
                                                               enddate=end_time)
        response = [fix(x) for x in response]
Shoonya-Dev commented 5 months ago

Greetings from Shoonya!

The current outcome of your code can be modified as per your requirements.