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.2.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.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eziql-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d44501ec765684cb8e5d5a1af9c4aca4f2364c72e5688cae7fb5757fe72ea8d2
MD5 57867409ad2e8949f6f7b70d9d1f4105
BLAKE2b-256 5774fba806c06a378b224668a25f9d0ca753526d32657256c71f26da6d848bab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eziql-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7968f942f1f18cf0813a45db550c713f62d4e398c07394ea9e8f56951466eb47
MD5 dfa3424857579d004b054fab162f9264
BLAKE2b-256 530e4fcc329f58f943cab146f9a3d37f143157f01267c8ce6500f59a55f2bd7f

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