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.1

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.1
File Size Uploaded Provenance Actions
jupyqt-0.7.1.tar.gz 92.2 kB With provenance Details for jupyqt-0.7.1.tar.gz

Built distribution (wheel)

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

Total release size: 130.6 kB

Release files / jupyqt-0.7.1.tar.gz

Download URL jupyqt-0.7.1.tar.gz
Size 92.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e06513fcacc01fa3f578d6670e909f438fac622d557861ea291b2783a46b2a3d
BLAKE2b-256 checksum
How to use checksums
65a2d39c2fc94e59c9818d6d457cd9c83022f8cd2dd00f512a74ca834857a31c
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.1-py3-none-any.whl

Download URL jupyqt-0.7.1-py3-none-any.whl
Size 38.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a10537c515b3b0e409ac701f9db58bdd61e8465df3b5557909355b0a04c3ca2e
BLAKE2b-256 checksum
How to use checksums
30a369426442c3dd628937ee0267e64d8ca6354870fc6ab44cc61826ae619973
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.1

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.1.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