Skip to main content

jupyqt

ci documentation pypi version

Embed JupyterLab in PySide6 applications — no ipykernel, no ZMQ, no qasync.

Features

  • Background-thread kernel — cell execution never blocks the Qt event loop
  • Top-level await — async/await works in notebook cells out of the box
  • Qt proxy — safely manipulate Qt widgets from notebook code
  • jupyverse server — full JupyterLab UI via QWebEngineView or external browser

Installation

pip install jupyqt

With uv:

uv add jupyqt

Quick start

from PySide6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget
from jupyqt import EmbeddedJupyter

app = QApplication([])
window = QMainWindow()

jupyter = EmbeddedJupyter()
jupyter.shell.push({"greeting": "Hello from jupyqt!"})
jupyter.start()

central = QWidget()
QVBoxLayout(central).addWidget(jupyter.widget())
window.setCentralWidget(central)
window.show()

app.exec()
jupyter.shutdown()

Exposing Qt objects to the notebook

Wrap Qt objects with wrap_qt() so notebook cells can safely call methods on the main thread:

jupyter.push({
    "window": jupyter.wrap_qt(main_window),
    "label": jupyter.wrap_qt(some_label),
    "do_stuff": my_function,
})

Then in a notebook cell:

window.setWindowTitle("Controlled from Jupyter!")
label.setText("Updated from a cell")

import asyncio
for i in range(5):
    await asyncio.sleep(0.5)
    do_stuff()

Opening a file in the embedded Lab

Open a file, relative to the server's root directory, with Lab's default viewer (notebooks as notebooks, images in the image viewer, ...):

jupyter.open_file("figures/plot.png")

When Lab is already running it opens the file without reloading the page. Otherwise it loads Lab straight on that file. It returns the same widget as widget().

Notebook save and open hooks

Run your own code when a notebook is saved or opened, for example to stamp metadata into every saved notebook:

def stamp(path: str, notebook: dict) -> dict:
    notebook["metadata"]["my_app"] = {"version": "1.2"}
    return notebook

jupyter.notebook_hooks.add_save_hook(stamp)
jupyter.notebook_hooks.add_open_hook(lambda path, notebook: print("opened", path))

Hooks run in the server thread, so keep them quick and marshal any Qt work to the main thread. A hook that raises is logged and skipped; the save still happens.

Examples

# Minimal smoke test
uv run python examples/minimal_app.py

# Full demo with exposed UI, counter widget, and demo notebook
uv run python examples/demo_app.py

Architecture

┌─────────────────────────────────────┐
│  JupyterLabWidget (QWebEngineView)  │  ← Qt main thread
└───────────────┬─────────────────────┘
                │ HTTP / WebSocket
┌───────────────┴─────────────────────┐
│  jupyverse (fps + anyio)            │  ← server thread
└───────────────┬─────────────────────┘
                │ anyio MemoryObjectStreams
┌───────────────┴─────────────────────┐
│  Wire Protocol + InteractiveShell   │  ← kernel thread (asyncio)
└───────────────┬─────────────────────┘
                │ QtProxy (blocking invoke)
┌───────────────┴─────────────────────┐
│  Host Qt Application                │  ← Qt main thread
└─────────────────────────────────────┘

Three threads, no shared event loop, no reentrancy.

Known limitations

  • Concurrent uploads to the same path aren't safe. The file-browser upload handler assembles chunked uploads by path, not by upload session — re-dragging the same file while an upload is still in flight, or retried/out-of-order chunks, can silently produce a corrupted file. Uploading distinct files concurrently is unaffected.
  • PDF / WebPDF notebook export need extra tooling nbconvert doesn't bundle. "Export Notebook As → PDF" requires a LaTeX toolchain (e.g. TeX Live with xelatex) on the host machine; "WebPDF" requires Playwright. Neither is installed by jupyqt — install them separately if you need those export formats. HTML, Markdown, and script export work out of the box.

Metadata

Release files for jupyqt 0.7.2

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

Source distribution (sdist)

Source distribution for jupyqt 0.7.2
File Size Uploaded Provenance Actions
jupyqt-0.7.2.tar.gz 94.8 kB With provenance Details for jupyqt-0.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyqt 0.7.2
File Interpreter ABI Platform Actions
jupyqt-0.7.2-py3-none-any.whl Python 3 none any Details for jupyqt-0.7.2-py3-none-any.whl

Total release size: 134.1 kB

Release files / jupyqt-0.7.2.tar.gz

Download URL jupyqt-0.7.2.tar.gz
Size 94.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca0f2407d6989ae17bf816658684e9e10e0fee07467b4ee3203fcd26e70f689d
BLAKE2b-256 checksum
How to use checksums
ff1fc166d54a9b8da345b587c7854de7484b016d47b6c1f9791df7cba2c2e1aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / jupyqt-0.7.2-py3-none-any.whl

Download URL jupyqt-0.7.2-py3-none-any.whl
Size 39.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee929db9843a0b5f0a1d09fa076fb6f4fc08ca902efe24b9f68fea27383d60ba
BLAKE2b-256 checksum
How to use checksums
3019b8f63fca15e61ce56d331f9315ebaa4a02bae753ca116b20fcbaf8d0cba3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for jupyqt 0.7.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jupyqt-0.7.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

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