Metadata-Version: 2.5
Name: printy3d
Version: 0.4.0
Summary: Official Python client for the Printy3D mesh-preparation API
Project-URL: Homepage, https://printy3d.ai
Project-URL: Documentation, https://printy3d.ai/docs/sdk/python
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: 3d-printing,api,mesh,printy3d,repair,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Classifier: Typing :: Typed
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

# printy3d (Python)

Official Python client for the [Printy3D](https://printy3d.ai) 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 `TypedDict`s.
- Licence: Apache-2.0.

## Install

```bash
pip install printy3d
```

You need an API key from the [Printy3D console](https://printy3d.ai/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](https://printy3d.ai/docs/sdk/python).

### Install from a local checkout (internal use)

```bash
pip install ./python          # from the repository root
```

## Use

```python
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": "mimaki"})
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](https://printy3d.ai/docs/quickstart),
[authentication and API keys](https://printy3d.ai/docs/authentication),
[uploads](https://printy3d.ai/docs/uploads), [jobs](https://printy3d.ai/docs/jobs),
[artifacts and exports](https://printy3d.ai/docs/artifacts),
[errors](https://printy3d.ai/docs/errors), [rate limits](https://printy3d.ai/docs/limits),
[billing](https://printy3d.ai/docs/billing), [Exact Check](https://printy3d.ai/docs/exact-check),
[webhooks](https://printy3d.ai/docs/webhooks).

Examples: [`examples/`](examples) (inspect, repair with a profile, cut with a plane,
export to GLB, manage keys).

## Development

```bash
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
```
