Skip to main content

Jupyter integration for Hotdata runtime

Project description

hotdata-jupyter

Jupyter helpers for Hotdata — rich query display, workspace selection, managed databases, and a %%hotdata cell magic for running SQL directly in cells.

Install

pip install hotdata-jupyter

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

import hotdata_jupyter as hj

client = hj.from_env()
result = client.execute_sql("SELECT 1 AS ok")
hj.display_query_result(result)

Workspace selection

When HOTDATA_WORKSPACE is set, the client connects to that workspace directly. If you have multiple workspaces, use the interactive picker — it renders a dropdown and updates ws.client when the selection changes:

ws = hj.workspace_selector_from_env()
display(ws.ui)
client = ws.client

Running SQL

result = client.execute_sql("SELECT * FROM orders LIMIT 10")
hj.display_query_result(result)

display_query_result renders the row count, column names, and a pandas DataFrame inline in the notebook.

Cell magic

Load the extension once per session, then use %%hotdata cells to write SQL without wrapping it in Python strings. The last active client is picked up automatically:

%load_ext hotdata_jupyter
%%hotdata
SELECT
  product,
  SUM(amount) AS total
FROM orders
GROUP BY product
ORDER BY total DESC

Managed databases

List the managed databases in your workspace:

hj.display_managed_databases_panel(client)

Create a database and load parquet files programmatically:

db = hj.create_managed_database(client, name="sales", tables=["orders"])

with open("orders.parquet", "rb") as f:
    loaded = hj.load_managed_table_from_bytes(client, "sales", "orders", f.read())

print(f"Loaded {loaded.row_count} rows into {loaded.full_name}")

Or use the interactive ipywidgets form:

writer = hj.managed_database_writer(client)
writer.display()

Open the demo notebook

jupyter lab examples/demo.ipynb

The demo covers workspace selection, connection listing, schema browsing, query history, and cell magics.

Development

uv sync --locked
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hotdata_jupyter-0.2.2.tar.gz (92.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hotdata_jupyter-0.2.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file hotdata_jupyter-0.2.2.tar.gz.

File metadata

  • Download URL: hotdata_jupyter-0.2.2.tar.gz
  • Upload date:
  • Size: 92.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hotdata_jupyter-0.2.2.tar.gz
Algorithm Hash digest
SHA256 12c1df064e1b73eb4ec58cc82b27af6745d65fe10c1ed231d5508bf439d5ad78
MD5 fe1eca473c037197ad764707f329c3ca
BLAKE2b-256 7dbab4ded3654ec5f3a5785c759a440411e45b510941b9db8a21feb7fd31eb59

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotdata_jupyter-0.2.2.tar.gz:

Publisher: publish.yml on hotdata-dev/hotdata-jupyter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hotdata_jupyter-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for hotdata_jupyter-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ffd44d0e81d60cd9eaccecc072ba278bfc994cd0f460c0fe1126973f99a76990
MD5 79df2909eaa6ec4e9f0bc2f8655ec332
BLAKE2b-256 cdf82d68b400611679b7120929dd402962deb478bc2434e7532154d5c2b6d7f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotdata_jupyter-0.2.2-py3-none-any.whl:

Publisher: publish.yml on hotdata-dev/hotdata-jupyter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page