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

Metadata

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

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / pycodecad-1.0.1.tar.gz

Download URL pycodecad-1.0.1.tar.gz
Size 522.7 kB
Tags Source
SHA-256 checksum
How to use checksums
50ff6ccb11fbbdf022f9fff8c815c8a66d77d700a46447a51aa78b73cc30673e
BLAKE2b-256 checksum
How to use checksums
cce7f9846263e36c54ae2f8adf79420db062cc22d33f9e7eb4f1a45781eb7551
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.1-py3-none-any.whl

Download URL pycodecad-1.0.1-py3-none-any.whl
Size 505.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fc8a69720a1636bade819f7c492447da4b2d6c269aed7dbcfc5e55e20ecb0da
BLAKE2b-256 checksum
How to use checksums
bc314d319841e1b77f2c709a332981ad22d4d9d0503348881a39586673018648
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

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.1 This release

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