I'd also recommend PyO3 and Maturin. The amount of help these crates give is mind boggling (automatic type marshaling and even github CI jobs for creating cross platform precompiled wheels).
I've created a library using this crate (https://github.com/wiktor-k/pysequoia/) and most of the time I could just focus on the problem domain instead of technical details of the bindings.
There are just a couple of smaller issues (eg. Python to Rust async is not built in) but overall it's really nice.
Re:Calling Rust from Python
by guitarbill on Sunday October 08, 2023 @05:40PM
(#37814655)
Agreed. It's also instructive to look at how C extensions are written for the CPython.
I wouldn't necessarily expect a demo; but not mentioning it at all seems like it could lead readers down a path where they choose the "most performant" option presented (FFI + ctypes). The post has a "To go further:" link section where even a quick link to PyO3 would go a long way. So I thought I'd mention the downsides and an alternative on HN.
https://www.nhatcher.com/post/rust-in-anger/