cadlib for Python
Python bindings for the SimScale cadlib library: load a CAD model input
to a workflow method and run geometry queries on it (volume, bounding box,
tessellation, …), with typed Pydantic models for every parameter and result.
You need CPython 3.12 or newer.
Install
pip install simscale-cadlib
The package is simscale-cadlib; in code it is cadlib. The wheel is
self-contained, its only dependency is pydantic>=2. It bundles the native
library, so there is no install script: locally, in CI and in Docker,
pip install is the whole setup, and the library always matches the package.
Pin the version as usual, e.g. simscale-cadlib==<version> in
requirements.txt, or poetry add simscale-cadlib@<version>.
import cadlib
print(cadlib.__version__)
Usage
from cadlib import Cad, VolumeParameters
# Load the CAD model from the CAD data map entry of the method's input parameters.
cad = Cad.load(request.data_map.cad)
# Query methods are async.
result = await cad.volume(VolumeParameters(entity_ids=["B1_TE5"]))
- Load once, reuse. Each
Cad.loadrebuilds the model, which is expensive, so load once and run every query on the sameCad. - Errors are either a
cadlib.CadExpectedError, a known domain error with anerror_code, or acadlib.CadUnexpectedError. The codes are listed in ERRORS.md. - Parameters and results are Pydantic models. Attributes are snake_case;
model_dump(by_alias=True)gives the camelCase field names.
Docker
Use a glibc base image (see Supported platforms). The
wheel bundles the native library: pip install is the only setup step.
FROM python:3.12-slim-bookworm
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENTRYPOINT ["python", "-m", "myservice"]
On Alpine, pip finds no matching wheel and fails with
No matching distribution found for simscale-cadlib.
Supported platforms
| OS | Architecture | Wheel | Requires |
|---|---|---|---|
| Linux | x86_64, aarch64 | manylinux_2_28 |
glibc 2.28 or newer (Debian 10+, Ubuntu 20.04+, RHEL 8+) |
| macOS | aarch64 (Apple silicon) | macosx_11_0_arm64 |
macOS 11 or newer |
| Windows | x86_64 | win_amd64 |
Windows 10 or newer |
One wheel per platform covers CPython 3.12 and every newer version.
Alpine and other musl-based distributions are not supported: the library is built for glibc and cannot load on musl. Intel Macs and Windows on Arm are not supported either.
License
MIT, see LICENSE.
Metadata
Release files for simscale-cadlib 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| simscale_cadlib-1.0.0-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details for simscale_cadlib-1.0.0-cp312-abi3-win_amd64.whl |
| simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details for simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_x86_64.whl |
| simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ ARM64 | Details for simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_aarch64.whl |
| simscale_cadlib-1.0.0-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details for simscale_cadlib-1.0.0-cp312-abi3-macosx_11_0_arm64.whl |
Total release size: 16.9 MB
Release files / simscale_cadlib-1.0.0-cp312-abi3-win_amd64.whl
| Download URL | simscale_cadlib-1.0.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9328b3800c9711562089eee60c25d5605b7ff239f2034c0989f0bfad890e5405
|
|
BLAKE2b-256 checksum How to use checksums |
92c7b001ec7b4d882d333a8dc81208d4a895e53e3309c3ffd933e9a5619f4a75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ddc9b993baf4547bc897503a1257c92e61a269ad2773900820592835baa9e9f2
|
|
BLAKE2b-256 checksum How to use checksums |
1de05e59c89ad363e45b61844ece15ef9e3a079ecb7f8b2539b8861fd7181d86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | simscale_cadlib-1.0.0-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c15906f051e81db79849b633ba71fcb3a12cfe943bbc297b102f76f36d3bead0
|
|
BLAKE2b-256 checksum How to use checksums |
d3f0eb0dcc83fddd693b5e4d4c285a528641110a96b6d4c70fe717debefa8d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / simscale_cadlib-1.0.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | simscale_cadlib-1.0.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7a413ef4fb345e73013a98d339d1d9b92952b708845867d6801203658003c4a0
|
|
BLAKE2b-256 checksum How to use checksums |
3419a37c88583e526bc0b84306db4eeed1e656d8b21ef1436f81ec90361c890d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logSecurity for simscale-cadlib 1.0.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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for simscale_cadlib-1.0.0-cp312-abi3-win_amd64.whl
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 Nov 6, 2026.
Transparency logA 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.