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.1.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.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hotdata_jupyter-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b6bbe05446c02b8fb52ed0c6790d78249a39affccc8643ba05a8283bb90d4467
MD5 513d9ad39415bffd1e9a0d684d106ca7
BLAKE2b-256 1385f64e255794a72e544cca46f150d7aab28a0cf7803e525b3b4785366cb0d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotdata_jupyter-0.2.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hotdata_jupyter-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aafe3c4faf310176e0cc97f0b71d8c784377e9b910a117023796f47b7c2a895c
MD5 06d79fab547d52d96f3b92292642f6f5
BLAKE2b-256 9c7ffefc0c79713d2a84cdddf18f49bc5c029a3e7d10a804a804f893afc3123e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotdata_jupyter-0.2.1-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