CSV/Sheet Analyzer with LLM is a powerful, interactive web application that leverages Large Language Models (LLMs) to analyze, visualize, and extract insights from your CSV or Excel (XLSX) files. With a user-friendly Streamlit interface, you can upload your data, ask natural language questions, and receive instant Python code, visualizations, and AI-generated insights—all without writing a single line of code yourself!
- Upload CSV/XLSX Files: Supports both CSV and Excel files for maximum flexibility.
- Natural Language Queries: Ask questions or request visualizations in plain English.
- Automatic Code Generation: The app uses an LLM (Gemini 2.0 Flash) to generate Python code for your query, using pandas, numpy, matplotlib, and seaborn.
- Safe Code Execution: All generated code is executed in a sandboxed environment for security.
- Instant Data Preview: View the first 100 rows of your uploaded data.
- Visualizations & Tables: Get plots, tables, or text results based on your query.
- AI-Powered Insights: For visualizations, the LLM provides concise, context-aware insights about your data and the generated plot.
- Upload your data: Choose a CSV or XLSX file to analyze.
- Preview: Instantly see the first 100 rows of your data.
- Ask a question: Type a question or request (e.g., "Show the distribution of sales by region" or "What is the correlation between age and income?").
- LLM generates code: The app sends your query and data context to the LLM, which returns Python code.
- Sandboxed execution: The code is safely executed. Results (plots, tables, or text) are displayed.
- Get insights: For plots, the LLM provides additional insights and observations about the visualization.
git clone https://github.com/harshm2601/SheetMinds.git
cd SheetMindsNavigate to the app directory and install the required Python packages:
pip install -r requirements.txtstreamlit run main.pyThe app will open in your browser at http://localhost:8501.
app/
main.py # Streamlit app entry point
llm.py # Handles LLM API calls and code extraction
sandbox.py # Securely executes generated code
utils.py # Utility functions for file handling and data overview
requirements.txt # Python dependencies
- Python 3.8+
- See
app/requirements.txtfor Python package dependencies
- Code Execution: All code is executed in a restricted environment, but always review generated code for safety.
- API Key: The LLM API key is hardcoded for demonstration. For production, use environment variables or a secure vault.
- File Size: Large files may impact performance.
- Built with Streamlit, Pandas, Matplotlib, Seaborn, and Gemini LLM.
This project is for educational and demonstration purposes only.