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.

Examples: examples/

Credits

License

MIT

Release files for pycodecad 1.0.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 pycodecad 1.0.0
File Size Uploaded
pycodecad-1.0.0.tar.gz 522.4 kB Details

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / pycodecad-1.0.0.tar.gz

Download URL pycodecad-1.0.0.tar.gz
Size 522.4 kB
Tags Source
SHA-256 checksum
How to use checksums
733c3c7259773bde242eb0821e9992e66184009533e89265aef513da8d4d8aad
BLAKE2b-256 checksum
How to use checksums
5a9b02fa99603da905cc634f45e244c282456af31d36c0667b0ea71bcb65553a
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 26, 2026.

Transparency log

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

Download URL pycodecad-1.0.0-py3-none-any.whl
Size 505.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88a3a776ec47627eb5b757745fc0bddd0b30c3cf4c5d99b414111e56ad91b5f5
BLAKE2b-256 checksum
How to use checksums
477a52f2786132a7dc245f2f46315fa52fb7e3de6aa696ce0d1277fa3b086566
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 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

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