Skip to main content

Jupyter for CadQuery / build123d

The Python package provides a Jupyterlab extension and a JupyterServer extension to view CadQuery, build123d, and OCP objects in JupyterLab

Current version: v5.3.0 (xx.xx.xx)

The full documentation lives at bernhard-42.github.io/ocp_viewer_docs — the Jupyter CadQuery chapter covers this viewer's specifics; this README gets you installed and running, and links into the rest.

Overview

Click on the "launch binder" icon to start Jupyter-CadQuery on binder:

Binder: Latest development version (Due to security restrictions, the measurement feature does not work on binder)

Installation

Note: JupyterLab 4.6.3 currently does not work with tornado 6.5.9, see here. Ensure to use tornado 6.5.8 for JupyterLab 4.6.3, e.g. pip install "tornado==6.5.8".

  • CadQuery

    1. Create and activate a virtual conda environment

      mamba create -n jcq python=3.12
      mamba activate jcq
      
    2. Install latest cadquery master

      mamba install -c conda-forge -c cadquery cadquery=master
      
    3. Install Jupyter CadQuery

      pip install jupyter-cadquery
      
  • build123d

    1. Create and activate a virtual environment (conda, pyenv-virtualenv, uv, ...)

    2. Install build123d

      pip install build123d
      
    3. Install Jupyter CadQuery

      pip install jupyter-cadquery
      

Jupyter CadQuery requires JupyterLab 4 (jupyterlab>=4.6.2,<5) and installs it if it is missing. The JupyterLab extension is prebuilt and ships inside the cad-viewer-widget dependency: no jupyter labextension step, no Node.js.

Known issue: ipykernel 7.x can stall a running notebook (a cell stays at [*] with an idle kernel). Until the ipykernel release that carries the fix, install pip install "ipykernel<7" — details and the workaround in Troubleshooting.

Verify the installation

jupyter lab extension list        # must list:  jupyter_cadquery 5.3.0 OK   (the viewer frontend)
jupyter server extension list     # must list:  jupyter_cadquery 5.3.0 OK   (the measurement backend)

A line "Extension package jupyter_cadquery took N s to import" is OCP and VTK loading, not an error. On a Mac the very first run can take minutes for the same reason.

Changed behavior from 4.x

  • The complete sidecar space will now be used for the viewer. For the old behaviour set cad_width and height
  • The default for show is reset_camera=Camera.KEEP now (unless set in ~/.jcq_config differently).
    • The viewer warns if the new object is too large or too small. To disable the warnings, use ignore_camera_warnings()
    • The old behavior can be achieved with set_defaults(reset_camera=Camera.RESET)
  • from jupyter_cadquery import * still works. For portable code with other viewers from the ocp viewer ecosystem use from ocp_viewer_core.viewer import *
  • mate_scale does not work any more, use helper_scale
  • The viewer now remembers paths in the tree that are shown/hidden and will show/hide the same paths for the newly shown CAD object

For all new features and fixes see CHANGELOG

First run

jupyter lab

and in a notebook:

from build123d import *
from jupyter_cadquery import *

open_viewer("CAD")
show(Box(1, 2, 3))

open_viewer puts the viewer into a sidecar panel next to the notebook; without it, show draws into the cell. From here on, everything is in the documentation.

Documentation

The full documentation lives at bernhard-42.github.io/ocp_viewer_docs — the Jupyter CadQuery chapter covers this viewer's specifics; everything below is a deep link into it.

Getting started

Working in the notebook

Working with the viewer

Python show* commands

Python API reference

Help

Demo Notebooks

Standard examples

Animated examples (requires pip install cadquery-massembly matplotlib):

Changes

see CHANGELOG.md

Licence

Apache-2.0.

Metadata

Release files for jupyter-cadquery 5.3.0

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

Source distribution (sdist)

Source distribution for jupyter-cadquery 5.3.0
File Size Uploaded Provenance Actions
jupyter_cadquery-5.3.0.tar.gz 980.2 kB Without provenance Details for jupyter_cadquery-5.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-cadquery 5.3.0
File Interpreter ABI Platform Actions
jupyter_cadquery-5.3.0-py3-none-any.whl Python 3 none any Details for jupyter_cadquery-5.3.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / jupyter_cadquery-5.3.0.tar.gz

Download URL jupyter_cadquery-5.3.0.tar.gz
Size 980.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3aef9384062f9d94550557c8e21762c3b86f13ea2769367306951575395712d2
BLAKE2b-256 checksum
How to use checksums
9a0899a7796b9cc36b7d35eaa0f699584a20d48b95c550447e432280e26d5e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / jupyter_cadquery-5.3.0-py3-none-any.whl

Download URL jupyter_cadquery-5.3.0-py3-none-any.whl
Size 81.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15e9fda408435006435b2121aee03e2155549a019229b21a9ae9b783941bf2d6
BLAKE2b-256 checksum
How to use checksums
93250d05884f65976f135a21bf1b1a48da6baf8a25562a06855ce764ef40ef54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for jupyter-cadquery 5.3.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

5.3.0 This release

2 release files 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