import streamlit as st import pandas as pd from excel_parser import parse_excel from query_agent import ask_question from utils import export_to_csv, export_to_pdf st.set_page_config(page_title="SheetMate ๐Ÿ“Š", layout="wide") st.title("๐Ÿค– SheetMate โ€” Chat with your Excel") uploaded_file = st.file_uploader("๐Ÿ“‚ Upload an Excel file", type=["xlsx", "xls"]) if uploaded_file: dfs = parse_excel(uploaded_file) sheet = st.selectbox("๐Ÿ—‚๏ธ Select a sheet", list(dfs.keys())) df = dfs[sheet] st.dataframe(df, use_container_width=True) col1, col2 = st.columns(2) with col1: if st.button("โฌ‡๏ธ Export to CSV"): csv = export_to_csv(df) st.download_button("Download CSV", csv, "sheetmate_data.csv", "text/csv") with col2: if st.button("๐Ÿงพ Export to PDF"): pdf_bytes = export_to_pdf(df) st.download_button("Download PDF", pdf_bytes, "sheetmate_data.pdf", "application/pdf") user_query = st.text_input("๐Ÿ’ฌ Ask a question about your data") if user_query: with st.spinner("๐Ÿค” Thinking..."): answer = ask_question(user_query, df) st.success(answer) st.markdown("---") st.markdown("๐Ÿ› ๏ธ Developed by **Akash Shahade**", unsafe_allow_html=True)