Skip to content

Repository files navigation

📊 DataPilot

Natural Language CSV/Spreadsheet Analysis — ask questions about your data in plain English and get instant answers, charts, and insights.

License: MIT Python 3.12+ FastAPI


✨ What is DataPilot?

DataPilot turns any CSV, Excel file, or SQL database into an AI-powered analytics workspace. No SQL. No Python. Just ask.

  1. Upload your data — CSV, TSV, Excel, or connect a live database
  2. Ask a question — "Top 10 products by revenue" or "Average churn by segment"
  3. Get instant answers — Tables, numbers, and auto-generated charts

Two Modes of Operation

Mode What happens Requirements
☁️ File Upload Drag-and-drop CSV/Excel, query with natural language Any device, free API key (~1 MB default upload limit)
🔌 Database Connect Connect PostgreSQL, MySQL, SQLite, or SQL Server and query live tables Database connection string

🚀 Quick Start

git clone https://github.com/YOUR_USERNAME/datapilot.git
cd datapilot
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8065

Then open http://localhost:8065, paste your free Groq API key into the Settings panel, and start asking questions.

See docs/SETUP.md for detailed installation and Docker instructions.


🖼️ Screenshots

Landing Page Workspace Auto-Generated Chart
Upload Workspace Chart

🏗️ Architecture

  • Backend: FastAPI (Python)
  • Frontend: Jinja2 templates + HTMX + Tailwind CSS
  • AI Engine: Groq Llama 3.3 70B (with Together AI & OpenRouter fallbacks)
  • Data Processing: Pandas + Plotly
  • Security: RestrictedPython sandbox for code execution
  • Database: SQLite by default, PostgreSQL via Docker Compose

Read the full Architecture Overview.


⚡ Features

Capability Description
Auto Pandas Code LLM generates Pandas code from your natural language question
Auto SQL For connected databases, generates safe SQL instead
Smart Charts Automatically recommends and renders bar, line, pie, scatter, and heatmap charts
Column Fuzzy Match Fixes typos and case mismatches in column names automatically
Error Recovery Detects common mistakes and retries with corrected prompts
Sandboxed Execution All generated code runs in a RestrictedPython sandbox
CSV Export Download any query result or the full dataset as CSV

🔑 API Keys

DataPilot uses a multi-provider LLM backend. You only need one free key.

Recommended: Groq — fast inference, generous free tier

Alternatives: Together AI, OpenRouter

See docs/API_KEYS.md for the full provider list and troubleshooting.


🧪 Running Tests

pytest

With coverage:

pytest --cov=app --cov-report=term-missing

🤝 Contributing

We welcome contributions! See docs/CONTRIBUTING.md for guidelines.

Priority areas:

  • Additional chart types and customization
  • Support for more database engines (BigQuery, Snowflake)
  • Query caching with Redis
  • UI/UX polish and accessibility

Please read our Code of Conduct and Security Policy before contributing.


📄 License

MIT License


🙏 Acknowledgments

  • FastAPI for the backend framework
  • Groq for blazing-fast LLM inference
  • Pandas for data manipulation
  • Plotly for interactive chart rendering

Note: File uploads are limited to ~1 MB by default (Starlette/FastAPI default). For larger files, connect a database or deploy behind a reverse proxy with chunked uploads. The UI loads Tailwind CSS, HTMX, Plotly, and Google Fonts from public CDNs, so an internet connection is required for the frontend to render correctly.

About

AI-powered natural language analytics for CSV, Excel, and SQL databases

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages