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.1.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.1.0
File Size Uploaded
pycodecad-1.1.0.tar.gz 524.1 kB Details

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / pycodecad-1.1.0.tar.gz

Download URL pycodecad-1.1.0.tar.gz
Size 524.1 kB
Tags Source
SHA-256 checksum
How to use checksums
84996596071661716019b0c2bc67b546fe3d97cb716f702009fc7065b167e0a5
BLAKE2b-256 checksum
How to use checksums
3c15d48b5306797e020a696af79c01ba4a14a9de79aeac515cf24368b5e913e6
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 27, 2026.

Transparency log

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

Download URL pycodecad-1.1.0-py3-none-any.whl
Size 506.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d27b2e5d77ffb8d61f67fa56c4315ab0674ec1866318c51bd3b53177a1a84285
BLAKE2b-256 checksum
How to use checksums
f75c7018eb6546b52e2ef1fce31deb2001765985992c1b12ca3fe93ad841e973
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 27, 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

This release

1.1.0 This release

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