Commit 63ea265c by ajil.k

updateded

parent 1540973e
......@@ -4,3 +4,6 @@ mongo_uri = mongodb://localhost:27017/
[FastAPI]
port = 5000
[Excel_file]
xlsx_path = temp/mongodb_data.xlsx
\ No newline at end of file
......@@ -10,3 +10,6 @@ uri = config.get("MongoDB", "mongo_uri")
# FastAPI Port
port_no = config.get("FastAPI", "port")
# Excel file path
xlsx_path = config.get("Excel_file", "xlsx_path")
import pandas as pd
from scripts.constants.application_config import xlsx_path
def read_excel_file():
excel_data = pd.read_excel("temp/mongodb_data.xlsx")
# Read data from Excel file
excel_data = pd.read_excel(xlsx_path)
print("Data Stored on excel file:\n", excel_data)
......@@ -124,7 +124,6 @@ class operations_on_api:
ws.cell(row=i + 2, column=j + 1, value=record[key])
# Save the Excel Workbook
wb.save("temp/mongodb_data.xlsx")
except Exception as e:
print("Generating Excel file error-", e)
# Importing Libraries
from fastapi import FastAPI, UploadFile
from scripts.constants.endpoints import APIEndpoints
from scripts.constants.read_file import read_excel_file
from scripts.core.handlers.api_functions import operations_on_api
......
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