#python #pyo3 #ffi


Utilities for creating a Python wrapper for a Rust library

12 releases

new 0.1.0 May 25, 2023
0.1.0-rc.8 May 17, 2023
0.1.0-rc.6 Feb 23, 2023
0.1.0-rc.1 Jan 27, 2023
0.0.1 Dec 20, 2022

#139 in FFI

Download history 101/week @ 2023-02-04 41/week @ 2023-02-11 56/week @ 2023-02-18 9/week @ 2023-02-25 187/week @ 2023-03-04 125/week @ 2023-03-11 215/week @ 2023-03-18 91/week @ 2023-03-25 43/week @ 2023-04-01 59/week @ 2023-04-08 41/week @ 2023-04-15 61/week @ 2023-04-22 82/week @ 2023-04-29 59/week @ 2023-05-06 38/week @ 2023-05-13 110/week @ 2023-05-20

323 downloads per month

Custom license


Rigetti PyO3

This crate defines a set of macros for creating PyO3 bindings to an existing Rust crate.

That is, given Rust library crate foo, these macros can be used inside a crate foo-python to create Python bindings. This is not intended for creating a standalone Python library using Rust.

See the docs for more.

Note: The above link will be broken until the crate is published on crates.io. For now, clone locally and use cargo doc --open to read the docs instead.

Rigetti PyO3 is licensed under the Apache License 2.0.


Helpful macros and traits for creating a Python wrapper of a Rust library.

See Macros and Traits for the main items in this crate.


See the examples directory in the source for example usage of a majority of the crate.

Alternatively, check the examples on the macros in this documentation.


~156K SLoC