Skip to main content

Typed, headless Python tooling for CAD/BIM models and artifacts

Project description

Python CAD Tools

Python CAD Tools is an installable, typed Python package for defining shared CAD/BIM models and producing STEP, IFC4, GLB, conceptual SVG/DXF/PDF drawings, quantity schedules, validation reports, and manifests in a headless workflow.

The canonical project identities are:

Licensed under AGPL-3.0-only. Published on PyPI.

Install for development

Python 3.12 or 3.13 is required.

python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'

An ordinary non-editable installation exposes the same package and command:

python3 -m pip install ./dist/python_cad_tools-*.whl
python-cad --version

Create a new project

python-cad init --destination my-cad-project
cd my-cad-project
python -m venv .venv
.venv/bin/pip install python-cad-tools
.venv/bin/python-cad build

The scaffold includes model.py, config.py, pyproject.toml, README.md, .gitignore, and generated/.gitkeep. Edit config.py for dimensions and materials; edit model.py for design elements.

Command line

python-cad --version reports the version from installed distribution metadata. Project operations use explicit subcommands:

python-cad init --destination my-project
python-cad validate --project-root .
python-cad build --project-root . --format step --format quantities
python-cad verify --project-root .
python-cad prepare-site --project-root . --destination _site --base-path /
python-cad serve --project-root . --port 0
python-cad clean --project-root .

The project root defaults to the current directory. Builds use project locks, unique staging, final-byte verification, and recoverable journaled promotion. validate writes no artifacts; verify independently reproduces the manifest inventory, sizes, SHA-256 values, schemas, and parser checks. prepare-site deploys the packaged model-free viewer without Node, and serve binds to loopback by default. See docs/viewer-delivery.md for ownership, caching, offline, and deployment details.

Python API

Public symbols are imported from their documented modules:

from pathlib import Path

from python_cad_tools.build import BuildOptions, build_project

result = build_project(BuildOptions(project_root=Path(".")))

Project code should preserve stable semantic IDs, keep geometry parametric, and create geometry and metadata together. Generated artifacts are outputs, never design inputs.

Project-owned drawing annotations use the typed, renderer-independent boundary documented in docs/drawing-extensions.md. One annotation set is validated and rendered consistently to SVG, DXF, and PDF before artifact hashes are recorded.

Verification

.venv/bin/ruff check .
.venv/bin/mypy
.venv/bin/pytest
.venv/bin/python -m build --wheel --sdist --outdir dist .
.venv/bin/python -m twine check dist/*

Packaging tests inspect wheel and sdist inventories, install the wheel non-editably into an isolated environment outside the checkout, prove the import resolves from that environment's site-packages, and run python-cad --version.

Viewer TypeScript is maintainer source in viewer/; only its verified, model-free production shell is included in the wheel. See docs/build-semantics.md, docs/manifests.md, docs/project-configuration.md, docs/public-api.md, and docs/viewer-delivery.md for detailed reference.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_cad_tools-0.1.2.dev2.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_cad_tools-0.1.2.dev2-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file python_cad_tools-0.1.2.dev2.tar.gz.

File metadata

  • Download URL: python_cad_tools-0.1.2.dev2.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for python_cad_tools-0.1.2.dev2.tar.gz
Algorithm Hash digest
SHA256 f8d81c36970b03a5de957358cdbf5d4a9a88ab85094cc50599d8f8ff41158246
MD5 e4bf7865910951e7897afebe72926083
BLAKE2b-256 ebdce8a97ecd7b4d2448274e7fcc5fde1dfc2e6b82e062f831c050db4209be9f

See more details on using hashes here.

File details

Details for the file python_cad_tools-0.1.2.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_cad_tools-0.1.2.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 609c292fc0cddefaa4c59b2f93f09b572a25868cb340f3837e3ad03fe8ce3603
MD5 5a1a022e7d2da0831bae06260f78e7c4
BLAKE2b-256 1c0d6fc0b9ff2de4e0163c8f5c84f7f8eef486b90ab64a57f0594743e41b0987

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page