Skip to content

Upload a CSV/EXCEL file and do data analysis using AI

Notifications You must be signed in to change notification settings

JoshiSneh/CSV-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

230 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSV Analyzer 📊

An intelligent CSV file analysis tool powered by OpenAI GPT models and Streamlit. Ask questions about your data in natural language and get instant insights, visualizations, and analysis.

Features 🌟

  • Natural Language Queries: Ask questions about your data in plain English
  • Automated Analysis: Get instant insights and visualizations
  • Interactive Visualizations: Dynamic charts and graphs using Plotly
  • Step-by-Step Analysis: Watch the analysis process unfold in real-time
  • Downloadable Results: Export processed data and analysis results
  • Smart Summaries: AI-generated insights and key findings

Installation 🚀

  1. Clone the repository:
git clone https://github.com/JoshiSneh/CSV-Analyzer.git
cd CSV-Analyzer
  1. Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install required packages:
pip install -r requirements.txt

Setup ⚙️

  1. Get an OpenAI API key from OpenAI Platform

  2. Run the application:

streamlit run app_streamlit_new.py

Usage 💡

  1. Launch the application
  2. Enter your OpenAI API key in the sidebar
  3. Upload a CSV file using the file uploader
  4. Enter your question about the data in natural language
  5. Click "Analyze Data" to start the analysis
  6. View the results in three phases:
    • Analysis Planning
    • Execution
    • Summary and Insights
    • Follow-up Questions

Application Structure 🏗️

csv-analyzer/
|-- config/settings.py
|-- services/analysis_service.py
|-- services/openai_service.py
|-- utils/data_loader.py
|-- utils/visualization.py
|-- app_streamlit_new.py # Main application file
|-- requirements.txt    # Project dependencies
└── README.md          # Documentation

Key Components 🔧

  1. Data Upload: Supports CSV/EXCEL file upload with preview functionality
  2. Query Processing: Natural language processing using OpenAI GPT models
  3. Analysis Pipeline:
    • Task Planning: Breaks down user query into actionable steps
    • Task Execution: Performs the analysis using pandas and plotly
    • Summary Generation: Creates human-readable insights
  4. Visualization: Interactive charts and graphs using Plotly

Environment Variables 🔐

Create a .env file with the following variables (optional):

OPENAI_API_KEY=your_api_key_here

Security Note 🔒

  • The application requires an OpenAI API key
  • API keys are stored only in session state and are not permanently saved

Limitations ⚠️

  • Currently, it cannot retry the Python code if the code failed to get executed.

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Upload a CSV/EXCEL file and do data analysis using AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages