Metadata-Version: 2.4
Name: hibral
Version: 0.3.0
Summary: Official Python SDK for Hibral API
Home-page: https://hibral.in
Author: Hibral
Author-email: hello@hibral.in
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Requires-Dist: pydantic>=2.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Hibral Python SDK

The official Python SDK for the Hibral API. 
Hibral translates complex business questions into precise, executable SQL by adapting to any relational database schema, solving the core enterprise LLM failure of hallucinating non-existent tables and inventing joins.

## Installation

```bash
pip install hibral
```

## Usage

```python
from hibral import QueryClient
import json

client = QueryClient(api_key="sk_live_...", base_url="https://api.hibral.in/v1")

# Initialize a session with a schema containing Computed Metrics
with open("db_schema.json", "r") as f:
    schema_json = json.load(f)
with open("sample_queries.json", "r") as f:
    queries_json = json.load(f)

session = client.text_to_sql.initialize(schema=schema_json, examples=queries_json)

# Generate multi-dialect SQL using QuickThink engine
response = session.generate("Show me total spend by month", dialect="s4hana", policy_engine="qt")
print("SQL:", response["sql"])
print("Execution Time (ms):", response.get("execution_time_ms"))
print("Tokens Billed:", response.get("usage", {}).get("st_input_tokens"))
```
