Generate SQL queries from natural language using Groq's LLaMA model.
Project description
eziql
🚀 eziql is a simple Python library that uses Groq's LLaMA model to convert natural language queries into SQL statements.
Whether you're a developer, data analyst, or a beginner working with databases, this package helps you quickly generate SQL queries just by describing what you want in plain English.
✨ Features
- ✅ Convert plain English to valid SQL queries
- 🧠 Powered by Groq's LLaMA-3 model
- 📝 Optional schema input for more accurate query generation
- 🔐 Uses
.envfor API key management or accepts it directly in code
📦 Installation
pip install eziql
🔧 Setup
You must provide your Groq API key to use this package. There are two ways:
1. Using Environment Variable (.env file)
Create a .env file in your project root and add:
eziql_key=your_groq_api_key
2. Pass Key Directly in Code
from eziql import GrokSQL
sql_generator = GrokSQL(api_key="your_groq_api_key")
🧪 Usage Example
from eziql import GrokSQL
sql_generator = GrokSQL() # Loads key from .env
user_query = "write a query for showing all columns from table empTab"
table_schema = """
Tables:
Car(id, name, color, type, sellDate)
"""
# Generate SQL
sql_query = sql_generator.generate_sql(user_query, table_schema)
print(sql_query)
You can also run it without schema:
sql_query = sql_generator.generate_sql("Get all records from users table")
print(sql_query)
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributions
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
📬 Contact
Created by Aman Prajapat — feel free to connect on LinkedIn or raise issues for support.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eziql-0.1.0.tar.gz.
File metadata
- Download URL: eziql-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7281def4fa1008d1d0b3647754bfbcf7f594ac5bd28e33403997c00c7b7e3ed4
|
|
| MD5 |
1795e25d64d8057ce4cd1375bef23352
|
|
| BLAKE2b-256 |
6e9306204c1a62995370342a8505a0f5397e28b9c2ebfa7818519c416ad4a5b6
|
File details
Details for the file eziql-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eziql-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbcea4b9838553a5b2d4a8cc8abdf88db57da467df3a87e152602701e721a2f3
|
|
| MD5 |
368ae2377466c1c3410f70b95a6ca175
|
|
| BLAKE2b-256 |
4f678ca7d0097693660b6f9c80d073990d467a33bba48b7d893cb64021b747db
|