Commit 4abc3014 authored by mamatha.bk's avatar mamatha.bk

Add new file

parent a3fdaca0
import pandas as pd
from fastapi import HTTPException
class ReadHandler:
@staticmethod
def excel_to_json():
df = pd.read_excel(r'C:\Users\mamatha\data11.xlsx')
json_data = df.to_dict('records')
if bool(json_data) is True:
final_json = {"Persons": json_data}
return final_json
else:
raise HTTPException(status_code=404, detail="No data found")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment