Marimo integration for Hotdata runtime
Project description
hotdata-marimo
Marimo UI helpers for Hotdata: run SQL from a notebook, browse catalog metadata, and render results as tables.
Features
- Workspace-aware setup — build a
HotdataClientfrom environment variables, or useworkspace_selector_from_env()to choose a workspace interactively when no workspace is pinned. - Connection health — show a compact status callout with API, workspace, and optional sandbox context.
- Catalog browsing — browse Hotdata connections, schemas, tables, and columns from Marimo UI controls.
- SQL editor widget — run SQL against Hotdata, cache the latest successful result, and render results in downstream reactive cells.
- Native
mo.sqlengine — registerHotdataMarimoEngineso Marimo SQL cells can execute through a liveHotdataClientwithengine=client. - Result display helpers — render query results, recent results, and run history as notebook-friendly UI.
- Marimo UI aliases — importing
hotdata_marimoattaches helpers such asmo.ui.hotdata_sql_editorandmo.ui.hotdata_table_browserfor discoverability.
Install
uv pip install hotdata-marimo
# or: pip install hotdata-marimo
Requires Python 3.10+, Marimo, and hotdata-runtime (Hotdata SDK + runtime/session semantics — pulled in automatically when you pip install hotdata-marimo).
Environment
| Variable | Required | Description |
|---|---|---|
HOTDATA_API_KEY |
Yes | API key for the Hotdata API |
HOTDATA_API_URL |
No | API base URL (default: https://api.hotdata.dev) |
HOTDATA_WORKSPACE |
No | Workspace id; if unset, the first active workspace is used |
HOTDATA_SANDBOX |
No | Sandbox session id, passed through to the SDK |
Minimal notebook
import marimo as mo
import hotdata_marimo as hm
client = hm.from_env()
editor = hm.sql_editor(client, default_sql="SELECT 1 AS ok")
return editor.ui
return hm.query_result(editor.result)
Importing hotdata_marimo registers discoverability aliases on Marimo’s UI namespace, so you can also use mo.ui.hotdata_sql_editor, mo.ui.hotdata_table_browser, mo.ui.hotdata_query_result, and mo.ui.hotdata_connection_status.
Use hm.connection_status(client) (or mo.ui.hotdata_connection_status(client)) for a small API/workspace health callout.
Marimo SQL Cells
Register the Hotdata SQL engine once during setup, then pass a HotdataClient to Marimo SQL cells:
import hotdata_marimo as hm
hm.register_hotdata_sql_engine()
client = hm.from_env()
_df = mo.sql(
"""
SELECT 1 AS example_value
""",
engine=client,
)
The engine also exposes Hotdata catalog metadata to Marimo's data-source UI. Hotdata connections are labeled Hotdata in the SQL connection picker.
Two-cell pattern
Keep the editor in one cell and consume editor.result in another. The editor caches the last successful run so downstream cells do not re-query the API on every refresh; click Run on Hotdata again after you change SQL. While a query is running, a Marimo status spinner is shown.
Marimo only shows what you return from a cell. Calling mo.vstack(...) or hm.query_result(...) without returning it produces no visible output.
See examples/demo.py for a full runnable notebook flow.
Examples
examples/demo.py— tabbed explorer with workspace selection, connection health, recent results (selectable table), run history, and a nativemo.sqlcell.
Run locally (single-user machine):
uv run marimo edit examples/demo.py --no-token
On a shared or networked host, omit --no-token and use the access token printed in the terminal URL. Without it, anyone who can reach the Marimo port can run queries against your Hotdata workspace.
Layout
This repo is intentionally thin: API client, env helpers, and result models live in hotdata-runtime; hotdata-marimo only adds Marimo widgets (sql_editor, table_browser, display for tables/status/history, workspace_selector). Import HotdataClient / QueryResult / from_env from hotdata_marimo or directly from hotdata_runtime.
Development
This package depends on hotdata-runtime (PyPI name hotdata-runtime). Development uses uv; keep a sibling checkout at ../hotdata-runtime so the lockfile resolves the runtime from disk (see [tool.uv.sources] in pyproject.toml).
uv sync --locked
uv run pytest
marimo edit examples/demo.py --no-token
To pin hotdata-runtime from Git instead of the sibling path, remove the [tool.uv.sources] block, set the dependency line as needed, and run uv lock again.
For a publishable uv.lock (CI that only clones this repo), remove [tool.uv.sources], point hotdata-runtime at PyPI or git+https://…, then uv lock.
The [project] name in hotdata-runtime pyproject.toml is hotdata-runtime and the import package is hotdata_runtime.
Use --no-token for local development so the editor does not redirect to /auth/login (session auth is easy to hit with a global Marimo config). For a public or shared machine, omit it and use the printed URL with an access token instead.
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_marimo-0.1.0.tar.gz.
File metadata
- Download URL: hotdata_marimo-0.1.0.tar.gz
- Upload date:
- Size: 107.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f71976cfa6feaa348e145b44beb9d5d1b5b142db29dd64341e8bcf90b57cb9a5
|
|
| MD5 |
9277c7046576841c60e64d371fc9d879
|
|
| BLAKE2b-256 |
0de2589065ee60cdaec23bdbef86153ff87dfbfbe2e522719a1e2616b2c1fb6e
|
Provenance
The following attestation bundles were made for hotdata_marimo-0.1.0.tar.gz:
Publisher:
publish.yml on hotdata-dev/hotdata-marimo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotdata_marimo-0.1.0.tar.gz -
Subject digest:
f71976cfa6feaa348e145b44beb9d5d1b5b142db29dd64341e8bcf90b57cb9a5 - Sigstore transparency entry: 1571966136
- Sigstore integration time:
-
Permalink:
hotdata-dev/hotdata-marimo@1c26e0602307eb80e9baf6b05e6fa0b27325f2e3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/hotdata-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c26e0602307eb80e9baf6b05e6fa0b27325f2e3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hotdata_marimo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hotdata_marimo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 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 |
442aa6f31df4f4ae906ad3387a5aa5d97d1078b376521d24ea7525bfbc6850e6
|
|
| MD5 |
0a94e91847bd7c9de90c21362db28139
|
|
| BLAKE2b-256 |
5e58e8c4a262c972c9c9e976f4fcfa632a9df600fb21b57d2870a3d8bd9e2a18
|
Provenance
The following attestation bundles were made for hotdata_marimo-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on hotdata-dev/hotdata-marimo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotdata_marimo-0.1.0-py3-none-any.whl -
Subject digest:
442aa6f31df4f4ae906ad3387a5aa5d97d1078b376521d24ea7525bfbc6850e6 - Sigstore transparency entry: 1571966166
- Sigstore integration time:
-
Permalink:
hotdata-dev/hotdata-marimo@1c26e0602307eb80e9baf6b05e6fa0b27325f2e3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/hotdata-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c26e0602307eb80e9baf6b05e6fa0b27325f2e3 -
Trigger Event:
push
-
Statement type: