Fyres websocket live data to OHLC data conversion

Can any help me sample pythoon code

I am using the below to get ohlc data ,

I am coverting it into dataframe then

def get_history(self, ticker, interval, start_date, end_date):

#data = {“symbol”:“NSE:SBIN-EQ”,“resolution”:“D”,“date_format”:“1”,“range_from”:“2022-09-03”,“range_to”:“2022-10-03”,“cont_flag”:“1”}

data = {}

data[‘date_format’] = “1”

data[“symbol”] = ticker

data[“resolution”] = interval

data[“range_from”] = start_date

data[“range_to”] = end_date

return self.fyers_obj.history(data)