Metadata-Version: 2.4
Name: neurosql
Version: 0.1.1
Summary: NeuroSQL: Neural-powered Text-to-SQL generator.
Author-email: "Vahe Babayan (0xV4h3)" <vahe.babayan.dev@gmail.com>
License: MIT License
        
        Copyright (c) 2026 0xV4h3
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/0xV4h3/neurosql
Project-URL: Repository, https://github.com/0xV4h3/neurosql
Project-URL: Issues, https://github.com/0xV4h3/neurosql/issues
Keywords: text-to-sql,nl2sql,sql,neural,transformer,T5,huggingface,ai
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.30.0
Requires-Dist: datasets>=2.10.0
Requires-Dist: tqdm
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.0.0
Provides-Extra: api
Requires-Dist: fastapi; extra == "api"
Requires-Dist: uvicorn; extra == "api"
Requires-Dist: pydantic; extra == "api"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: notebook; extra == "dev"
Requires-Dist: ipykernel; extra == "dev"
Requires-Dist: jupyterlab; extra == "dev"
Requires-Dist: numpy; extra == "dev"
Requires-Dist: pandas; extra == "dev"
Requires-Dist: matplotlib; extra == "dev"
Requires-Dist: scikit-learn; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# NeuroSQL

**NeuroSQL** is an advanced neural Text-to-SQL generator based on T5/Transformers.  
Convert natural language questions and database table schemas into accurate SQL queries.

---

## Installation

NeuroSQL is modular: you can install only the components you need.

#### Install for production/basic usage (core dependencies only):

```bash
pip install neurosql
```

#### Install with API support (FastAPI, uvicorn, pydantic):

```bash
pip install neurosql[api]
```

#### Install for development (includes notebooks, testing, plotting, ML utilities):

```bash
pip install neurosql[dev,api]
```

#### For exact environment reproduction (e.g., full research replication):

```bash
pip install -r requirements.txt
```

---

## Quick Start

**Python Example:**
```python
from neurosql import NeuroSQLModel

model = NeuroSQLModel.from_pretrained("0xV4h3/neurosql")
sql = model.generate(
    query="Show all sales in Armenia for 2020",
    context="CREATE TABLE sales(id INT, country VARCHAR(20), year INT, sales INT);"
)
print(sql)  # Example: SELECT * FROM sales WHERE country='Armenia' AND year=2020;
```

---

## Command-Line Interface (CLI)

Run SQL generation in the terminal:

```bash
neurosql --query "Show sales in Armenia for 2020" --context "CREATE TABLE sales(id INT, country VARCHAR(20), year INT, sales INT);"
```

---

## API

Integrate NeuroSQL into your service using the built-in FastAPI server.  
See usage examples in the [examples/](examples/) directory.

---

## Notebooks & Training

Find Jupyter notebooks for fine-tuning and experimenting with the model in the `notebooks/` directory.  
You can further customize NeuroSQL for your own datasets and domains.

---

## Model Card

The pretrained and fine-tuned model is available on Hugging Face:  
[Hugging Face Model Card](https://huggingface.co/0xV4h3/neurosql)

---

## Requirements

- Python 3.8+
- torch >= 2.0.0
- transformers >= 4.30.0
- datasets >= 2.10.0
- tqdm
- For API: fastapi, uvicorn, pydantic
- For development: notebook, pytest, matplotlib, scikit-learn, etc.
- See [requirements.txt](requirements.txt) for the complete development environment.

---

## License

MIT License
