LangGraph integration for Hotdata runtime
Project description
hotdata-langgraph
LangGraph nodes for Hotdata — run SQL and manage databases as first-class graph nodes that read from and write to your state dict.
Install
pip install hotdata-langgraph
Authentication
Set HOTDATA_API_KEY in your environment. Optionally set HOTDATA_WORKSPACE to pin a specific workspace (the first available workspace is used if unset).
Quickstart
from langgraph.graph import StateGraph
import hotdata_langgraph as hlg
client = hlg.from_env()
builder = StateGraph(dict)
builder.add_node("run_sql", hlg.make_execute_sql_node(client=client))
builder.set_entry_point("run_sql")
builder.set_finish_point("run_sql")
graph = builder.compile()
result = graph.invoke({"sql": "SELECT * FROM orders LIMIT 10"})
print(result["result"]) # list of row dicts
SQL node
The SQL node reads a query from state, executes it on Hotdata, and writes the rows back to state.
# Factory: create a reusable node function
execute_sql = hlg.make_execute_sql_node(client=client)
builder.add_node("run_sql", execute_sql)
# State in: {"sql": "SELECT ..."}
# State out: {"result": [{"col": val, ...}, ...]}
Managed database nodes
# Create a managed database
create_db = hlg.make_create_managed_database_node(client=client)
# State in: {"database_name": "sales", "schema": "public", "tables": "orders,customers"}
# State out: {"database": {"id": "...", "description": "sales"}}
# Load a parquet file into a table
load_table = hlg.make_load_managed_table_node(client=client)
# State in: {"database": "sales", "table": "orders", "file": "/path/to/orders.parquet"}
# State out: {"load_result": {"full_name": "sales.public.orders", "row_count": 1500, ...}}
Scoping queries to a managed database
Pass database= so all SQL the node runs resolves against a specific managed database:
execute_sql = hlg.make_execute_sql_node(client=client, database="sales")
Custom state keys
Override the default key names to fit your graph's state schema:
execute_sql = hlg.make_execute_sql_node(
client=client,
sql_key="query", # reads from state["query"] instead of state["sql"]
output_key="rows", # writes to state["rows"] instead of state["result"]
)
The same *_key pattern applies to all nodes.
Run the example
uv run python examples/langgraph_basic.py
Development
uv sync --locked
uv run pytest
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 hotdata_langgraph-0.2.2.tar.gz.
File metadata
- Download URL: hotdata_langgraph-0.2.2.tar.gz
- Upload date:
- Size: 149.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e93545b70a9860e831d2d269cb0b4039cc199708a14d977539df56362400b1
|
|
| MD5 |
5cfdbc9f51955d406e4341c8d50711d6
|
|
| BLAKE2b-256 |
3920728ef6188ee04be8b8f25d5631b3faf3de286f8133df851c348d840d541a
|
Provenance
The following attestation bundles were made for hotdata_langgraph-0.2.2.tar.gz:
Publisher:
publish.yml on hotdata-dev/hotdata-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotdata_langgraph-0.2.2.tar.gz -
Subject digest:
a0e93545b70a9860e831d2d269cb0b4039cc199708a14d977539df56362400b1 - Sigstore transparency entry: 1985044248
- Sigstore integration time:
-
Permalink:
hotdata-dev/hotdata-langgraph@d916d3ea3a14b65d93a6f048ceadb2c1f2bf5167 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/hotdata-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d916d3ea3a14b65d93a6f048ceadb2c1f2bf5167 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hotdata_langgraph-0.2.2-py3-none-any.whl.
File metadata
- Download URL: hotdata_langgraph-0.2.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f582bcf268bc81ee8744b3edd059bd095963fdfc212bb99e6976fc69904b165
|
|
| MD5 |
5f39aaefd442d91a2e698206180d6be7
|
|
| BLAKE2b-256 |
31bf84ab33c7b1bcf6394d876e2aebfa88ba35984706c0c9745c7f4ac01371b6
|
Provenance
The following attestation bundles were made for hotdata_langgraph-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on hotdata-dev/hotdata-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotdata_langgraph-0.2.2-py3-none-any.whl -
Subject digest:
6f582bcf268bc81ee8744b3edd059bd095963fdfc212bb99e6976fc69904b165 - Sigstore transparency entry: 1985044373
- Sigstore integration time:
-
Permalink:
hotdata-dev/hotdata-langgraph@d916d3ea3a14b65d93a6f048ceadb2c1f2bf5167 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/hotdata-dev
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d916d3ea3a14b65d93a6f048ceadb2c1f2bf5167 -
Trigger Event:
push
-
Statement type: