Analysis updated 2026-06-24
Rewrite a slow Python function in Rust and call it from Python with a normal import, eliminating a performance bottleneck without changing the rest of your Python code.
Build and publish a high-performance native Python package using maturin so users can install it via pip.
Embed a Python interpreter inside a Rust application to call Python libraries like numpy from Rust code.
| pyo3/pyo3 | louis-e/arnis | iii-hq/iii | |
|---|---|---|---|
| Stars | 15,671 | 15,698 | 15,623 |
| Language | Rust | Rust | Rust |
| Setup difficulty | moderate | easy | moderate |
| Complexity | 3/5 | 2/5 | 4/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Rust toolchain and the maturin build tool installed, first compile can take several minutes.
PyO3 is a library that connects two programming languages, Rust and Python, letting you use them together in the same project. It works in two directions: you can write code in Rust and call it from Python (making Python faster for performance-critical parts), or you can run Python code from inside a Rust program (embedding the Python interpreter). Rust is a systems programming language known for being very fast and memory-safe, while Python is popular for its ease of use. PyO3 lets you get the best of both: write the fast or complex parts in Rust, and expose them as if they were ordinary Python functions that any Python user can call. This is how many high-performance Python libraries are built under the hood. The code example in the README shows how to write a Rust function, annotate it with a simple attribute (#[pyfunction]), and then call it from Python with a normal import statement, the compiled Rust code becomes a native Python module. Going the other direction, you can embed a Python interpreter inside a Rust application and call Python libraries from Rust code. The companion tool maturin handles building and publishing these mixed Rust-Python packages with minimal configuration, you run a few commands and get a Python package you can distribute via pip (Python's package manager). You would use PyO3 if you have a Python project with a performance bottleneck that you want to rewrite in Rust, or if you are building a Rust application that needs to use Python libraries. The full README is longer than what was provided.
PyO3 lets you write fast Rust code and call it from Python as if it were a normal Python library, or embed Python inside a Rust program, combining Python's ease of use with Rust's speed.
Mainly Rust. The stack also includes Rust, Python.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.