Skip to main content

jupyterlab-cell-queue

A JupyterLab 4 extension that shows the cells waiting to run in the current notebook and lets you remove them before they start.

Today, when you press "Run All" or queue several cells with Shift+Enter, JupyterLab sends every cell to the kernel at once. A cell that is already in the kernel's queue cannot be withdrawn; the only way out is to interrupt, which drops everything. This extension holds waiting cells in the browser instead and sends them one at a time, so a waiting cell can still be removed.

Related requests: jupyterlab/jupyterlab#7825, jupyter/notebook#2340.

Features

  • Cell Queue side panel (right sidebar): the running cell and every waiting cell of the current notebook, with its position and first line of code.
  • Remove a single waiting cell. It goes back to idle and is never sent.
  • Stop after current cell: the running cell finishes, all waiting cells are removed. Also a command and a notebook context-menu entry.
  • Jump to a cell by clicking its entry.
  • Remove Cell From Queue for the active cell (command palette and cell context menu).

Behaviour that stays as in stock JupyterLab:

  • Waiting cells show the [*] prompt.
  • An error stops the queue. Cells tagged raises-exception do not stop it, matching the kernel's stop_on_error rule.
  • An interrupt (KeyboardInterrupt) stops the queue.
  • A kernel restart, kernel change or dead kernel clears the queue.
  • Deleting a waiting cell removes it from the queue. Moving a waiting cell keeps it in the queue.
  • Markdown cells render immediately.

Limits, please read

  1. The queue lives in the browser tab. If you close the tab, reload the page, close the notebook or your computer goes to sleep, waiting cells are not run. The cell that is already running keeps running in the kernel.
  2. Slower for many tiny cells. Each cell costs one extra round trip between browser and kernel. Measured locally (JupyterLab 4.4.4, ipykernel 6.29, same machine): "Run All" over 102 trivial cells took 5.3 s with the extension and 1.2 s without it, about 40 ms extra per cell. For cells that take seconds or minutes this does not matter; for hundreds of instant cells it does.
  3. Waiting cells run the code they have when they are sent, not when you pressed Shift+Enter. Entries edited since they were queued are marked "edited" in the panel.
  4. Removed cells keep their previous output and execution count. Stock JupyterLab clears a cell's output as soon as it is queued; this extension clears it only when the cell is actually sent.
  5. Only one cell executor can be active. The extension replaces the @jupyterlab/notebook-extension:cell-executor plugin. It does not work together with other extensions that replace it, such as server-side execution in jupyter-collaboration or jupyter-server-nbmodel.
  6. Only this tab's queue is shown. Requests sent by other clients connected to the same kernel are not visible.

Requirements and install

  • JupyterLab >= 4.4 (tested: 4.4.4 and 4.5.6). The cell-executor interface it relies on is unchanged in 4.6.6 and 4.7.0b2 (source compared, not run).
  • Jupyter Notebook 7: basic check passed on 7.4.4 (queue, remove).

Not published on PyPI yet. To build from source you need Node.js >= 20 and a jupyter with JupyterLab 4:

tools/build.sh /path/to/jupyter     # builds into ~/.cache/jupyterlab-cell-queue-build

Then either point JupyterLab at the built folder (--LabApp.extra_labextensions_path=<folder containing jupyterlab-cell-queue/>), or build a wheel with WHEEL_PYTHON=/path/to/python tools/build.sh (needs hatchling==1.27.0 and hatch-jupyter-builder==0.9.1) and pip install it.

To turn it off: jupyter labextension disable jupyterlab-cell-queue (add --level=user if you cannot write to the Python environment), then reload the browser tab. JupyterLab then uses its own executor again: checked on 4.4.4, where the core cell-executor plugin was active again after the reload and "Run All" behaved as stock. jupyter labextension enable jupyterlab-cell-queue turns it back on. To remove it completely: pip uninstall jupyterlab-cell-queue and reload.

Privacy and permissions

Frontend only. No server extension, no network requests of its own, no telemetry, no storage. Cell code is displayed as text only, never executed or rendered as HTML by the panel.

Development and tests

npm test                 # 42 unit tests, Node's built-in test runner, no install needed
node tools/mutate.mjs    # breaks the code 13 ways on purpose; every mutation must fail a test

The unit tests cover order, one-at-a-time sending, remove, stop after current, errors (incl. raises-exception), interrupt/restart/kernel change (the first kernel start of a notebook keeps the queue), notebook closed, cell deleted or moved while waiting, the same cell queued twice, two notebooks at once and listener failures.

tools/e2e_jupyterlab.py drives a real JupyterLab with a real IPython kernel through Playwright (27 checks: the scenarios above plus jump, panel contents, prompts and console errors). It needs a running server started with --LabApp.expose_app_in_browser=True.

Dependencies: only JupyterLab's own packages (provided by JupyterLab at runtime) and @jupyterlab/builder for the build. Exact versions and hashes are in package-lock.json. The bundled output contains only css-loader and style-loader runtime code (MIT).

Not verified

  • JupyterLab 4.6 and 4.7 in a running instance.
  • Kernels other than ipykernel (e.g. IRkernel, which handles aborted requests differently).
  • Real-time collaboration (several users in one notebook).
  • Behaviour with JupyterLab's "windowed" notebook mode on very large notebooks beyond the cell counts used in the tests.
  • pip uninstall jupyterlab-cell-queue restoring the core executor: follows from how jupyterlab_server reads disabledExtensions (only from installed extensions), but was not run. Disabling with jupyter labextension disable was run.
  • Turning the core cell-executor plugin back on in JupyterLab's Plugin Manager while this extension is active (two plugins would then provide the same executor). Disable this extension instead.
  • If the kernel is shutting down, JupyterLab shows its "Kernel Terminating" dialog; with several waiting cells you may see it once per cell.

License

BSD 3-Clause, see LICENSE.

Metadata

Release files for jupyterlab-cell-queue 0.1.0

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

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlab-cell-queue 0.1.0
File Interpreter ABI Platform Actions
jupyterlab_cell_queue-0.1.0-py3-none-any.whl Python 3 none any Details for jupyterlab_cell_queue-0.1.0-py3-none-any.whl

Release files / jupyterlab_cell_queue-0.1.0-py3-none-any.whl

Download URL jupyterlab_cell_queue-0.1.0-py3-none-any.whl
Size 32.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcd5143397cc6883f6647ae130b3d7a59da1c013daf4d94dc2fb6f23c79c6154
BLAKE2b-256 checksum
How to use checksums
5ddf14e5486e0a9409fced65e7208b2b0fdfea2bcfadf199b3418aa5f35a0788
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Security for jupyterlab-cell-queue 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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