From 533f87039d9d5f7de4dfe01a4fdf7c34032c4434 Mon Sep 17 00:00:00 2001 From: Dustin Alise Date: Mon, 8 Dec 2025 12:57:12 -0600 Subject: [PATCH] Add functions to read Excel and load data from path --- app24.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app24.py b/app24.py index ed0f500..0e52fa8 100644 --- a/app24.py +++ b/app24.py @@ -9,10 +9,12 @@ st.set_page_config(page_title="EA_24_data Viewer", layout="wide") st.title(f"Data Viewer for {FILE_NAME}") + def read_excel_bytes(file_bytes) -> pd.DataFrame: """Read an Excel file from bytes into a DataFrame.""" return pd.read_excel(io.BytesIO(file_bytes), engine="openpyxl") + def load_data_from_path(path: Path) -> pd.DataFrame | None: if not path.exists(): return None @@ -22,6 +24,7 @@ def load_data_from_path(path: Path) -> pd.DataFrame | None: st.error(f"Error reading '{path}': {e}") return None + # Try loading the default file first data_path = Path.cwd() / FILE_NAME df = load_data_from_path(data_path)