Skip to main content

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 .env for 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 GroqSQL  
sql_generator = GroqSQL(api_key="your_groq_api_key")

🧪 Usage Example

from eziql import GroqSQL

sql_generator = GroqSQL()  # 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


Download files

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

Source Distribution

eziql-0.1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

eziql-0.1.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file eziql-0.1.1.tar.gz.

File metadata

  • Download URL: eziql-0.1.1.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

Hashes for eziql-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d4c4786f903641188f81f30967dd600cb4b955f5fb44a09eceaa7203290be402
MD5 eaaadb0fae3e5df785efc08303e79954
BLAKE2b-256 c7a3ffd8c895935e8a61c6a50cd5f7327b7b5bee9fb1019319d40b1d66758f63

See more details on using hashes here.

File details

Details for the file eziql-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: eziql-0.1.1-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

Hashes for eziql-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb9f1afda97cef8604ed1ebb36ad86c5c593c43b6413ab229965be50d888afe6
MD5 553021148caf9720b60a415ca3c40f66
BLAKE2b-256 1e8350285f04e24e9a5e0919ac13d967ca4b6a80e09445098ef5b9d669d86b38

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