Rust bindings for Python, enabling creation of native Python extension modules and embedding Python in Rust binaries.
PyO3 is a Rust library that provides bindings for the Python interpreter, enabling developers to write native Python extension modules in Rust or embed Python code within Rust applications. It bridges Rust's performance and safety guarantees with Python's extensive ecosystem, allowing for high-performance extensions and seamless interoperability between the two languages.
Rust developers who need to create high-performance Python extensions or integrate Python scripting into their Rust applications, and Python developers looking to accelerate critical code paths with Rust's speed and memory safety.
Developers choose PyO3 for its robust, type-safe interface that simplifies writing Python extensions in Rust, its support for multiple Python distributions (CPython, PyPy, GraalPy), and its integration with tools like maturin for easy building and distribution.
Rust bindings for the Python interpreter
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Maturin simplifies creating and distributing Rust-based Python packages with commands like `maturin init` and `maturin develop`, reducing setup overhead as shown in the step-by-step guide.
Supports CPython 3.8+, PyPy 7.3+, and GraalPy 25.0+, ensuring compatibility across multiple Python distributions, which is explicitly listed in the README.
Includes ecosystem tools like rust-numpy for NumPy integration and pyo3-async-runtimes for async support, enabling advanced use cases in data science and concurrency.
Offers stable and main versions of user guides and API docs, plus a detailed FAQ for troubleshooting common issues like linker errors.
Demands a solid understanding of Rust, which can be a barrier for Python-only developers, as all extension code must be written in Rust from scratch.
Common issues like linker errors when running `cargo test` or in workspaces are acknowledged in the FAQ, indicating non-trivial build configuration and debugging.
Requires minimum Rust 1.83 and specific Python versions, potentially limiting adoption in environments with older or locked-down toolchains.