Skip to main content

Propermesh Python SDK

A client for the Propermesh API: check 3D models for thin walls, overhangs and broken geometry before you print them, and slice them to G-code. Get free API keys at propermesh.com/account.

pip install propermesh
import os
from propermesh import ProperMeshClient, SliceSettings, Units

client = ProperMeshClient(os.environ["PROPERMESH_ACCESS_KEY"], os.environ["PROPERMESH_SECRET_KEY"])

part_id = client.upload_part_file("bracket.stl", Units.mm)

# Flag anything thinner than 2 mm
job = client.start_thickness_analysis_job(part_id, threshold=2).json()
result = client.wait_for_thickness_analysis_job_to_complete(job["id"]).json()
print(result["status"], result["is_thin"], result["thin_surface_area"])

Waiting for a job

Every job type has a run_<job> helper that starts the job, waits for it and returns the finished job. If the job fails or is cancelled it raises ProperMeshJobFailedError (.job_type, .job_id, .status, .failure_reason), so you don't check status yourself:

from propermesh import ProperMeshJobFailedError

try:
    job = client.run_thickness_analysis(part_id, threshold=2)
    print(job["is_thin"])
except ProperMeshJobFailedError as e:
    print(e.status, e.failure_reason)

The helpers are run_geometry_analysis, run_thickness_analysis, run_overhang_analysis, run_orientation, run_repair, run_transform, run_slice and run_quote, with the arguments of their start_*_job methods. ProperMeshAPIError still covers 4xx and 5xx responses.

A plan runs a few jobs at once (one on Free). Start more and the start_*_job calls wait for a free slot instead of raising: they retry the "too many jobs running" 429 for up to 10 minutes. Change that with ProperMeshClient(..., wait_for_job_slot=120) (seconds), or turn it off with wait_for_job_slot=None and the 429 raises ProperMeshAPIError (.retry_after says how long to wait). A limit on parts or jobs per month always raises right away.

Slice with a built-in PrusaSlicer printer (Prusa, Creality, Elegoo), optionally overriding a few settings for this slice:

presets = client.list_presets("prusaslicer")  # printers (with brand), processes, filaments
profile = client.create_profile_from_preset("prusa-mk4s-0.4")
settings: SliceSettings = {"infill_percentage": 20, "wall_count": 3}  # also layer_height_mm, supports
job = client.start_slice_job(part_id, profile["id"], settings=settings).json()
result = client.wait_for_slice_job_to_complete(job["id"]).json()
print(result["print_time_seconds"], result["filament_weight_g"])  # PrusaSlicer's estimate
gcode = client.download_gcode(job["id"])

Or slice with your own printer profile: a PrusaSlicer config export (.ini) or a PrusaSlicer .3mf project:

profile_id = client.upload_printer_profile("my_printer.ini", "My printer")
job = client.start_slice_job(part_id, profile_id).json()

Bambu Studio and OrcaSlicer profiles are coming soon. A quote formula takes the same overrides as slice_settings, so slice-based quotes can use them too.

Quotes with options

Each quote item can pick its own printer profile and slice settings. A formula lists the other profiles items may use in profile_rates, each with its own rates, so a mixed order is one quote with one base fee and one minimum:

formula = client.create_quote_formula({
    "name": "Mixed order", "currency": "USD", "base_fee": "5", "minimum_price": "15",
    "printer_profile_id": pla_profile_id,
    "terms": [{"field": "filament_weight_g", "rate": "0.05"}],
    "profile_rates": [{"printer_profile_id": petg_profile_id,
                       "rates": [{"field": "filament_weight_g", "rate": "0.08"}]}],
}).json()
quote = client.create_quote(formula["id"], [
    {"part_id": part_id, "quantity": 2, "label": "PLA"},
    {"part_id": part_id, "quantity": 2, "label": "PETG strong",
     "printer_profile_id": petg_profile_id, "slice_settings": {"infill_percentage": 40}},
]).json()
quote = client.wait_for_quote_to_complete(quote["id"]).json()
print(quote["total"])  # one base fee for the whole order

To compare variants of one part, make them items of one quote with a label. Each line's unit_price and line_total are exact; total isn't any one variant's price. For one variant's order price, make a one-item quote, which reuses its slice:

quote = client.create_quote(formula["id"], [
    {"part_id": part_id, "quantity": 1, "label": "15%", "slice_settings": {"infill_percentage": 15}},
    {"part_id": part_id, "quantity": 1, "label": "40%", "slice_settings": {"infill_percentage": 40}},
]).json()
quote = client.wait_for_quote_to_complete(quote["id"]).json()
for item in quote["items"]:
    print(item["label"], item["unit_price"])

Slices past your running-job limit wait for a slot (items[].slice_waiting) instead of failing. preview_quote never slices: items_needing_slice lists the items without a slice yet, and create_quote with the same items slices them.

Every analysis follows the same pattern: start_* returns the job, and wait_for_* polls until it's finished. Errors raise ProperMeshAPIError with status_code, detail and, for usage limits, retry_after. The full API is documented at propermesh.com/docs.

Metadata

Release files for propermesh 0.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 propermesh 0.1.0
File Size Uploaded Provenance Actions
propermesh-0.1.0.tar.gz 14.0 kB Without provenance Details for propermesh-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.8 kB

Release files / propermesh-0.1.0.tar.gz

Download URL propermesh-0.1.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
790d58822ef92b40e4fc584b74de3916cf9fcddfb27062cbe7e3ae3ee73e6e15
BLAKE2b-256 checksum
How to use checksums
664abed359efe772ce8440c00059259607308ceec81303a931bf0c021adcad39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / propermesh-0.1.0-py3-none-any.whl

Download URL propermesh-0.1.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbf0205f309daff8d14de21380bbee3cce5be109367c9eefe9b6fd5bd6e2b315
BLAKE2b-256 checksum
How to use checksums
122f8679428a61a89c5c2b1489ee8e52500b6ec6d8c5ed22c1ddd867ecd07c87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for propermesh 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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