Files
init_dataParser/excel_helper.py
T
2025-05-26 09:11:22 +03:30

25 lines
678 B
Python

import pandas as pd
class ExcelHelper:
def __init__(self):
self.pd = null
self.data_dict = []
def load_data(self, file_path, sheet_name=0):
df = pd.read_excel(file_path, sheet_name=sheet_name)
return df
# def load_data(self, file_path, sheet_name):
# df = pd.read_excel(file_path, sheet_name=sheet_name)
# selected_columns = df[[self.fltxt_column_name]]
# self.data_dict = selected_columns.to_dict(orient='records')
# for record in self.data_dict:
# record['_id'] = " "
# print("✅ داده‌ها با موفقیت از فایل اکسل خوانده شدند.")