Skip to main content

A natural language interface for querying datasets using LLMs

Project description

QueryBot

A powerful web application that enables users to upload various data formats, execute SQL queries, and download results through an intuitive interface.

Table of Contents

Overview

QueryBot is built with FastAPI for the backend and a responsive HTML/Bootstrap frontend. It provides a seamless experience for data analysis by allowing users to query multiple data sources through a unified SQL interface.

Features

  • Multi-format Support: Query CSV, Parquet, SQLite, Excel files, and MySQL databases with a single interface.
    • Example: Users can upload a CSV file and query it directly.
  • Interactive SQL Editor: Writes and executes SQL queries with syntax highlighting. The application automatically generates DuckDB queries and runs on datasets. It supports multiple files if the paths are provided separated by commas.
  • Real-time Results: View query results instantly in a paginated table format
  • Export Functionality: Download query results in CSV format for further analysis. Note: Currently, only CSV format is supported for export.
  • Responsive Design: Works seamlessly across desktop and mobile devices

Getting Started

Installation

Note: Installation is optional as uvx will handle the necessary setup.

pip install querybot

Running the Application

  1. Start the application with a single command using uv:
    uvx querybot
    
  2. Open your web browser and navigate to http://localhost:8001 to access the QueryBot interface.

Usage

  1. Upload Data: Use the interface to specify data sources by:

    • Entering file paths (multiple paths can be separated by commas, without quotes)
    • Uploading files directly through the browser
  2. Supported Data Formats:

    • CSV files (.csv)
    • Parquet files (.parquet)
    • SQLite databases (.db)
    • Excel spreadsheets (.xlsx)
    • External MySQL databases (from relational-data.org)
  3. Execute Queries: Write SQL queries in the editor and click "Run Query" to see results.

  4. Export Results: Download query results as CSV files for further analysis or reporting.

Project Structure

/querybot
│
├── querybot              # Main package directory
│   ├── app.py            # FastAPI application entry point
│   ├── __init__.py       # Package initialization
│   ├── static            # Static assets
│   │   ├── index.html    # Main frontend interface
│   │   └── js            # JavaScript resources
│   │       └── script.js # Frontend functionality
├── pyproject.toml        # Project metadata and dependencies
├── .gitignore            # Git ignore configuration
├── uv.lock               # Dependency lock file
├── README.md             # Project documentation

Development

Prerequisites

  • Python 3.8+

Setting Up Development Environment

  1. Clone the repository:

    git clone https://github.com/gramener/querybot.git
    cd querybot
    
  2. Install dependencies:

    pip install -e ".[dev]"
    

License

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

Additional Resources

Query Result

Query Result

Contribution Guidelines

We welcome contributions! Please see our CONTRIBUTING.md for more details.

FAQ

Q: What data formats are supported? A: The application supports CSV, Parquet, SQLite, Excel, and MySQL formats.

Q: How do I report an issue? A: Please use the Issue Tracker to report any issues you encounter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

querybot-0.2.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

querybot-0.2.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file querybot-0.2.0.tar.gz.

File metadata

  • Download URL: querybot-0.2.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.29

File hashes

Hashes for querybot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 00daf3a775ed0601707f74ec5bb985f2575e1b07c264a45222659de519a7b126
MD5 277ef138bb2807eea45eea0a4488d1ec
BLAKE2b-256 f02e73d70c72ac9073a671d1593b4c15cfd05ed3261fe48d897749663a90325e

See more details on using hashes here.

File details

Details for the file querybot-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: querybot-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.29

File hashes

Hashes for querybot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e2157cce7099459356f9d46bafa33d0ca7e6ad65f033068bac6b41f7f4dfcbd
MD5 b3c7bdb292c1371aaf89d62b640be04a
BLAKE2b-256 0f3929052a29e5facdf1e45fbae94bbd13cccb482e5fdf8b77e4021892ac7651

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page