Calling Rust from Python with PyO3 and Maturin
Rust lets us Python developers accelerate performance-critical code without giving up the language we love.
This hands-on workshop introduces participants to building native Python extensions in Rust using PyO3 and Maturin. Attendees will learn how to expose Rust functions and data structures directly to Python, package them as installable modules, and integrate them into existing Python projects.
The workshop covers:
Setting up a Rust-powered Python extension project
Writing and exposing Rust functions to Python
Handling Python types and memory safely in Rust
Building and distributing wheels with Maturin
Benchmarking Rust extensions against pure Python implementations
Practical patterns for incrementally optimizing Python applications with Rust
Integrating all this in your CI pipeline (using Docker).
By the end of the session, participants will have built and packaged a working Python extension module in Rust and gained a practical understanding of when and how to use Rust for Python interoperability.
Target Audience
Intermediate Python developers interested in performance optimization, systems programming, or native extensions. Prior Rust experience is helpful but not required.