hotdata-runtime is the framework-agnostic runtime contract for Hotdata integrations.
This package provides shared primitives for:
- Environment and workspace resolution
- Query execution and polling
- Normalized tabular result handling
- Basic workspace health checks
The supported import surface is:
HotdataClientQueryResultfrom_envworkspace_health_linesdefault_api_keydefault_hostdefault_session_idexplicit_workspace_idlist_workspacesnormalize_hostpick_workspaceresolve_workspace_selectionResultSummaryRunHistoryItemWorkspaceSelection
Adapters should import from hotdata_runtime and treat this surface as the stable API.
- Represents runtime context: API key, host, workspace, optional session.
from_env()resolves runtime context from env vars and selected workspace.execute_sql(sql)returnsQueryResultor raisesRuntimeError/TimeoutError.get_result(result_id)returns a readyQueryResultand waits for readiness when needed.connections()returns the connections API wrapper for adapter UI/status features.query_runs()returns the query-runs API wrapper for adapter history views.results()returns the results API wrapper for adapter result pickers.list_recent_results(...)returns normalizedResultSummaryentries.list_run_history(limit=...)returns normalizedRunHistoryItementries.list_qualified_table_names(...)returns sorted fully qualified table names.columns_for_qualified(qualified, connection_id=...)resolves table columns, and adapters should passconnection_idwhen known.
- Canonical tabular result model with
columns,rows, androw_count. - Carries server identifiers and execution metadata when available.
to_pandas()converts to a DataFrame with stable column ordering.to_records(max_rows=...)returns row dicts keyed by column names.metadata_dict()returns normalized result metadata for adapter rendering.
default_api_key()readsHOTDATA_API_KEY.default_host()readsHOTDATA_API_URL(default:https://api.hotdata.dev) and normalizes it.default_session_id()readsHOTDATA_SANDBOX.explicit_workspace_id()readsHOTDATA_WORKSPACE(workspace public id).pick_workspace()prefers explicit env workspace, then active workspace, then first workspace.resolve_workspace_selection()is the canonical workspace selection algorithm. It returnsWorkspaceSelectionwith selected workspace id, selection source, and discovered workspaces when auto-selected.
Framework packages (Jupyter, Marimo, LangChain, LangGraph, LlamaIndex, Streamlit) own:
- Framework-native lifecycle and state management
- Rendering/UI concerns
- Tool/agent wrappers and callback integration
They should not duplicate runtime env/workspace/query semantics.
hotdata-runtime does not define framework UI primitives and does not require framework dependencies.
- Backward-incompatible contract changes require a major version bump.
- Additive contract changes are minor versions.
- Bug fixes that preserve contract semantics are patch versions.
Contract stability is enforced by tests that verify the public export surface and key behavioral invariants.