Skip to main content

hedron-notebook

PyPI Python CI License: MIT

Server-side notebook preview helper for Hedron.

Run a normal Hedron ASGI app from an authoring notebook with inline iframe and external-link modes. Distinct from the browser-Python / JupyterLite sandbox in hedron-extras. Install as hedron-notebook or via hedron[notebook].

Package maturity: Beta tooling-grade (0.1.x) · pin >=0.1.0,<0.2 (localhost preview only)

Default guidance is localhost-only development. Hosted or publicly reachable hosts raise an explicit warning. Preview URLs include an unguessable session token (hedron_preview_token query parameter). The first successful request seeds an HttpOnly cookie so iframe follow-up requests (assets, HTMX, WebSockets) stay authorized; X-Hedron-Preview-Token is also accepted. Requests without a matching token are rejected. This package is not a Supported production server.

Install

pip install "hedron-notebook>=0.2.3,<0.3"  # requires Hedron and core >=1.0.0,<2.0
# or
uv add "hedron-notebook>=0.1.0,<0.2"
# via flagship extra:
pip install "hedron[notebook]>=1.0.0"

Requires Python 3.11–3.14.

Optional server extra (uvicorn):

pip install "hedron-notebook[server]>=0.2.3,<0.3"

Quick start

from hedron import Hedron, Page, Text
from hedron_notebook import start_preview

app = Hedron(
    title="Notebook demo",
    security="standard",
    session_secret="dev-only",
    explorer="off",
)


@app.page("/")
def home() -> Page:
    return Page(Text("Hello from a notebook preview"), title="Demo")


preview = start_preview(app)
print(preview.url)
# In a Jupyter cell:
# display HTML with preview.iframe_html()
preview.shutdown()

Public API

Symbol Role
start_preview(app) Start a local preview server for an ASGI app (token-gated)
NotebookPreview Handle with .url, .iframe_html(), .shutdown()
wrap_preview_app(app, token) ASGI wrapper requiring the preview session token
PreviewTokenGate Pure-ASGI middleware used by start_preview

License

MIT. See the repository license.

Metadata

Release files for hedron-notebook 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hedron-notebook 0.2.6
File Size Uploaded Provenance Actions
hedron_notebook-0.2.6.tar.gz 13.7 kB Without provenance Details for hedron_notebook-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hedron-notebook 0.2.6
File Interpreter ABI Platform Actions
hedron_notebook-0.2.6-py3-none-any.whl Python 3 none any Details for hedron_notebook-0.2.6-py3-none-any.whl

Total release size: 29.5 kB

Release files / hedron_notebook-0.2.6.tar.gz

Download URL hedron_notebook-0.2.6.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
77a5744c469f0886153f1c504604bce47f8b8613114d5ca94e8e720c0b7a8c83
BLAKE2b-256 checksum
How to use checksums
634eef9a90a98f88a6b88c1984c5350dac4fa7b83a5dd88761103c6f5b95cf40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hedron_notebook-0.2.6-py3-none-any.whl

Download URL hedron_notebook-0.2.6-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3118004fd6bfd1c6899f674c69576db2acc75e5e066e45478407bf4b78ae8f7c
BLAKE2b-256 checksum
How to use checksums
da6e53103356c9f722421045b622d4e06c4fac9327383b2f78670dd629b7fb51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hedron-notebook 0.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page