Metadata-Version: 2.4
Name: querymind
Version: 0.1.0
Summary: Ask natural language questions about your CSV data using AI
Home-page: https://github.com/rais/QueryMind
Author: Your Name
Author-email: your.email@example.com
Project-URL: Bug Reports, https://github.com/rais/QueryMind/issues
Project-URL: Source, https://github.com/rais/QueryMind
Keywords: pandas,ai,llm,openai,anthropic,data-analysis,natural-language
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.3.0
Requires-Dist: openai>=1.0.0
Requires-Dist: anthropic>=0.5.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# QueryMind

Ask natural language questions about your CSV data using AI. This package intelligently translates your questions into pandas code using Large Language Models (LLMs) and provides clear, concise answers.

## Features

- 🤖 Natural language to pandas code translation
- 🔒 Safe code execution in a controlled environment
- 📊 Optional result summarization in natural language
- 🔌 Support for multiple LLM providers (OpenAI and Anthropic)
- 🛠️ Clean, maintainable, and extensible design

## Installation

```bash
pip install querymind
```

## Quick Start

```python
from querymind import AIQuery

# Initialize with your CSV file and preferred LLM provider
ai = AIQuery(
    csv_path="your_data.csv",
    llm_provider="openai",  # or "anthropic"
    api_key="your-api-key"
)

# Ask questions in natural language
result = ai.ask("What is the average age of customers who made purchases over $100?")
print(result)

# Get raw results without summarization
raw_result = ai.ask("Show me the top 5 products by sales", summarize=False)
print(raw_result)
```

## Supported LLM Providers

### OpenAI

- Uses GPT-4 for code generation and summarization
- Requires an OpenAI API key

### Anthropic

- Uses Claude 3 Opus for code generation and summarization
- Requires an Anthropic API key

## Example Questions

Here are some example questions you can ask:

- "What is the average salary by department?"
- "Show me the top 10 customers by total purchase amount"
- "How many products are out of stock?"
- "What is the correlation between age and purchase amount?"
- "List all transactions from last month"

## Security

The package executes generated code in a controlled environment with limited access to:

- The pandas DataFrame (`df`)
- The pandas library (`pd`)
- No access to other Python built-ins or system resources

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

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