Skip to main content

pyrucast

A finite element library in Rust, inspired by cast3m, exposed to Python — and usable as is in pure Rust (pyo3 is an optional dependency: a default build pulls in neither pyo3 nor libpython).

  • Full documentation: the mdbook in book/ (architecture, memory model, meshing, fields, physics…) — mdbook build book for the HTML.
  • Rust API reference: cargo doc --no-deps --lib --open.

Prerequisites

Tool Version Installation
Rust ≥ 1.89 (the crate's rust-version), edition 2024 rustup
Python ≥ 3.11 Python API only — not needed in pure Rust
Python headers — Python API only — Linux: python3-dev (Debian/Ubuntu) or python3-devel (Fedora/RHEL). Windows: included in the official installer.

Use in pure Rust (without Python)

[dependencies]
pyrucast = { git = "…", default-features = false }   # no pyo3, no libpython
use pyrucast::atoms::ElementType;
let mesh = pyrucast::ops::mesh::triangulate_surface(&contour, ElementType::TRI3, Some(1.0))?;

cargo build / cargo test (without any feature) compile the core in pure Rust — neither Python nor a venv required. The Python API (#[pyclass]) lives behind the python-api feature, enabled automatically by maturin.

Building in a venv (Python API)

For builds with the Python API (maturin, or cargo --features python-api), pyo3 locates the interpreter through VIRTUAL_ENV: always activate the venv before cargo or maturin, otherwise the build fails with error: failed to run the Python interpreter at .... (A plain cargo build does not have this constraint.)

Linux / macOS

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip maturin
maturin develop --release

Windows (PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade pip maturin
maturin develop --release

maturin develop compiles the module and installs it into the venv. Check:

python -c "import pyrucast; c = pyrucast.Coords(2); print(c)"

After any change to the Rust, simply re-run maturin develop --release.

Development

pip install pytest ruff     # on top of maturin, in the venv
cargo build                 # pure Rust core (without pyo3; no venv needed)
cargo test                  # unit + integration tests + doctests (pure Rust)
maturin develop && python -m pytest   # Python tests
cargo fmt && ruff format .  # standard formatting (Rust + Python)
bash script/check_all.sh    # chains all the checks (formatting included)
bash script/check_doc.sh    # or a single block: format / rust / python / examples / doc

The book's chapter Building and testing details the Cargo features (viz, viz-interactive, stub-gen…), the generation of the python/pyrucast/_pyrucast/__init__.pyi stub and the common troubleshooting.

License

Distributed under the Mozilla Public License 2.0 (MPL-2.0).

It is a per-file copyleft: any modification of a pyrucast source file must be republished under the MPL, but one can freely build proprietary code on top of the library and combine it with it. The MPL is moreover GPL/CeCILL compatible ("Secondary Licenses", §3.3).

Metadata

Release files for pyrucast 0.13.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrucast 0.13.1
File Size Uploaded Provenance Actions
pyrucast-0.13.1.tar.gz 1.8 MB With provenance Details for pyrucast-0.13.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyrucast 0.13.1
File Interpreter ABI Platform Actions
pyrucast-0.13.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for pyrucast-0.13.1-cp311-abi3-win_amd64.whl
pyrucast-0.13.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for pyrucast-0.13.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyrucast-0.13.1-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.11 abi3 macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) Details for pyrucast-0.13.1-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Total release size: 23.1 MB

Release files / pyrucast-0.13.1.tar.gz

Download URL pyrucast-0.13.1.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
06965b17f0be68ec2d48ac402ffc3115a551077acf1b1eef89d98dac5d844a1d
BLAKE2b-256 checksum
How to use checksums
b5431e26878f9d9a3a698310b8d88fd91083a17efaaf4d14d8a5f30faff682c3
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 12, 2026.

Transparency log

Release files / pyrucast-0.13.1-cp311-abi3-win_amd64.whl

Download URL pyrucast-0.13.1-cp311-abi3-win_amd64.whl
Size 4.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8243a9c306bfc1844cc598e6e92b49e583b8a7c7ffd1dd1b8560c2c11cddcebf
BLAKE2b-256 checksum
How to use checksums
87f88e4a2b6dbfb99d6f6f58e83607bc80130b0fa82b7aaeb8399a630eb598d0
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 12, 2026.

Transparency log

Release files / pyrucast-0.13.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyrucast-0.13.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f891b0d334992c942a7514af3705db281a30cbc9985af82b8d25e57de1c616f3
BLAKE2b-256 checksum
How to use checksums
8cf5a873105a09a7458dfe386fd7b5ca91db2d8e31516e32ae5189b4c3a08bd9
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 12, 2026.

Transparency log

Release files / pyrucast-0.13.1-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL pyrucast-0.13.1-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 9.2 MB
Tags CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
975e36bbbdfa977dd8ab73c651fbf244b4d2234a339a015bee174d9c27a2a5c9
BLAKE2b-256 checksum
How to use checksums
d159eaf789bfdd5917a690999008e0b1179f2030d56a7eeeae8a4ae4b034f8b5
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 12, 2026.

Transparency log

Security for pyrucast 0.13.1

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.

Select from 4 files

Attestation for pyrucast-0.13.1.tar.gz

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 12, 2026.

Transparency log

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.

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