Skip to main content

pycodecad

PyPI Python Platform License: MIT

Code-CAD with build123d: write a Python script, see the part, export it for 3D printing.

The pycodecad window: the files of the folder, parameters and code on the left, a gear in the 3D view on the right

from build123d import Box, Cylinder
from pycodecad import show

plate = Box(40, 30, 8) - Cylinder(5, 8)
show(plate, name="plate", color="#F4B02A")

Install

pip install pycodecad        # Python 3.12+, OpenGL 3.3

Quick start

pycodecad examples                    # copy the examples to ./pycodecad-examples and open them
pycodecad part.py                     # a window on part.py (created from an example if missing)
pycodecad parts/gear/                 # a window on a folder: a part in several files
pycodecad check part.py               # run it without a window, print the result as JSON
pycodecad export part.py part.stl     # also .3mf .step .glb .brep

What you get

  • A window on a part: its files, the code and the part side by side. It runs the part once when it opens, then only when you press Run, and writes only when you press Save.
  • Parameters: expose(fn) turns the arguments of a function into sliders, number boxes and checkboxes.
  • Animations: frame() saves the scene as a frame; the window plays them. Parts built once and moved with Pos are not computed again, so mechanisms play in real time.
  • A command line: check, render and export run the same script without a window.
  • An AI workflow: an assistant edits the file and checks its own work with check and render.
  • Parts for your own app (experimental): the window's code, parameters and 3D view as Dear ImGui components, in pycodecad.embed.
The Parameters panel: sliders, a number box and a checkbox made by expose() A failed run: the line marked in the editor and the traceback under it pycodecad render: a gear in iso, front, top and right views
Parameters from expose() Errors point at the line pycodecad render: what an AI sees

pycodecad is small on purpose, readable in an afternoon: see Design.

Documentation

  • Getting started: install, a first part, run, export.
  • The window: layout, Run and Save, Reload, read-only mode, shortcuts.
  • Parameters: expose(), its controls and --set.
  • Scripts: show, clear, frame (animations), import_mesh, colors, paths, errors.
  • Command line: check, render, export, context, exit codes.
  • Working with an AI assistant: the AI context and how an assistant checks its work.
  • Files: everything pycodecad writes, and where.
  • Embedding: the window's parts in your own app (experimental).
  • Design: principles, platforms and plans.
  • Development: tests, type checks and releases.
  • Benchmarks: measuring a Run and the window's drawing, and the latest review.

Examples: examples/

Credits

License

MIT

Metadata

Release files for pycodecad 1.2.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 pycodecad 1.2.1
File Size Uploaded
pycodecad-1.2.1.tar.gz 524.5 kB Details

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / pycodecad-1.2.1.tar.gz

Download URL pycodecad-1.2.1.tar.gz
Size 524.5 kB
Tags Source
SHA-256 checksum
How to use checksums
640e9daf7479dcbe5a9c599e711f463f484adbe740c06690b4728dfbab36630c
BLAKE2b-256 checksum
How to use checksums
11a985288c97c1c1dffa7fbafbc2f9ee0866d8baab3e8cbe66e90d95a86e64ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 29, 2026.

Transparency log

Release files / pycodecad-1.2.1-py3-none-any.whl

Download URL pycodecad-1.2.1-py3-none-any.whl
Size 506.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85ee52ba002d417850c248b46a85aa43718b203d0d87eb6776f9bbab8630d4af
BLAKE2b-256 checksum
How to use checksums
6446c58b2c0ed6284e9e0e0d8056350e781b44d76c043245f0271dbff7f9b032
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.3

2 release files

1.2.2

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

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