printy3d (Python)
Official Python client for the Printy3D mesh-preparation API: upload a 3D
model, inspect it, repair it for printing, run tools (cut, measure, convert, structural
analysis, ...), download the verified outputs and export to other formats.
- Python 3.9 or newer, no runtime dependencies (standard library only).
- Fully typed (
py.typed); response models are dataclasses, request params are TypedDicts.
- Licence: Apache-2.0.
Install
pip install printy3d
You need an API key from the Printy3D console. The client talks to
https://api.printy3d.ai unless you pass base_url or set PRINTY3D_API_URL. Full guide:
printy3d.ai/docs/sdk/python.
Install from a local checkout (internal use)
pip install ./python # from the repository root
Use
from printy3d import Printy3D
client = Printy3D() # reads PRINTY3D_API_KEY and PRINTY3D_API_URL
job = client.inspect("model.stl") # upload, inspect, wait
print(job.analysis.dimensions_mm, job.analysis.is_watertight)
job = client.repair("model.stl", profile="character", params={"printer": "fdm"})
client.download_artifacts(job.id, "out/repair")
export = client.export(job.id, "glb") # converts on the fleet when needed
client.download(export.artifact, "out/")
Every /v1 operation is also available directly: client.org, client.formats,
client.profiles, client.api_keys, client.files, client.jobs, client.artifacts,
client.exports, client.balance.
Errors are one class, printy3d.Printy3DError, with status, code, title, detail,
request_id, retry_after and the problem body's extra fields (required, available,
required_scope, reason, ...).
Guides
The guides on the website show curl, Python and TypeScript side by side:
quickstart,
authentication and API keys,
uploads, jobs,
artifacts and exports,
errors, rate limits,
billing, Exact Check,
webhooks.
Examples (inspect, repair with a profile, cut with a plane, export to GLB, manage keys)
ship in the examples/ folder of the source distribution on PyPI, and every step has a worked
example in the Python SDK guide.
Development
python -m venv .venv
.venv/bin/pip install -e "python[dev]" # Windows: .venv\Scripts\pip
cd python
../.venv/bin/python -m pytest # mock-server tests, never the real API
../.venv/bin/python -m mypy # strict