MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / ExcelReader

Class ExcelReader

KVCOMM/tools/reader/readers.py:169–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167 return "Error reading PowerPoint file."
168
169class ExcelReader(Reader):
170 def parse(self, file_path: Path) -> str:
171 logger.info(f"Reading Excel file from {file_path}.")
172 try:
173 excel_data = pd.read_excel(file_path, sheet_name=None)
174
175 all_sheets_text = []
176 for sheet_name, data in excel_data.items():
177 all_sheets_text.append(f"Sheet Name: {sheet_name}\n{data.to_string()}\n")
178
179 return "\n".join(all_sheets_text)
180 except Exception as e:
181 logger.info(f"Error reading Excel file: {e}")
182 return "Error reading Excel file."
183
184class XLSXReader(Reader):
185 def parse(self, file_path: Path) -> str:

Callers 1

readers.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected