Skip to main content

querybuilder-llm

A simple pip package that lets you generate SQL or MongoDB queries from natural language using your deployed LLM API.
Schema is passed in, and the LLM figures out the correct query.
All responses are wrapped with a success flag for safety.


Installation

pip install querybuilder-llm

Usage

from querybuilder_llm.client import build_query

# Example schema
schema = {
    "users": ["id", "name", "email", "age"]
}

result = build_query(schema, "Find all gmail users", "postgresql")

if result["success"]:
    print("SQL Query:", result["response"])
else:
    print("Error:", result["error"])

# --- Mongo Example ---
result = build_query(schema, "Find users older than 30", "mongodb")

if result["success"]:
    print("Mongo Query:", result["response"])
else:
    print("Error:", result["error"])

Response Format

{
  "success": True/False,
  "response": str | dict | None,
  "db_type": postgress|mongodb
  "error": str | None
}

success: Whether query generation was successful

response: SQL string or MongoDB JSON dict (if success)

error: Error details if failed

Metadata

Release files for querybuilder-llm 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for querybuilder-llm 0.2.0
File Size Uploaded Provenance Actions
querybuilder_llm-0.2.0.tar.gz 2.4 kB Without provenance Details for querybuilder_llm-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for querybuilder-llm 0.2.0
File Interpreter ABI Platform Actions
querybuilder_llm-0.2.0-py3-none-any.whl Python 3 none any Details for querybuilder_llm-0.2.0-py3-none-any.whl

Total release size: 5.1 kB

Release files / querybuilder_llm-0.2.0.tar.gz

Download URL querybuilder_llm-0.2.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5fbcb5a9fc06dc42be103b339c485f7202576e6b33b559006a58234be12b4f31
BLAKE2b-256 checksum
How to use checksums
4e15ffb7b8f2b328dd06f4345d17eac0ca4967241069d658518ced28f84a2a7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / querybuilder_llm-0.2.0-py3-none-any.whl

Download URL querybuilder_llm-0.2.0-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
836584623bcce47dd3def015aff95bc10102fb4712a32d89b71b155368a5da41
BLAKE2b-256 checksum
How to use checksums
1e95eddf5d43da829d5cbb4af1d1d63ee589e14bc77475592ce0f59b98674080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for querybuilder-llm 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page