#python-bindings #pyo3 #python

rigetti-pyo3

Utilities for creating a Python wrapper for a Rust library

33 releases

0.4.1 Jul 12, 2024
0.3.6 Jun 13, 2024
0.3.1 Nov 22, 2023
0.1.0 May 25, 2023
0.0.1 Dec 20, 2022

#86 in FFI

Download history 632/week @ 2024-07-12 265/week @ 2024-07-19 806/week @ 2024-07-26 361/week @ 2024-08-02 500/week @ 2024-08-09 261/week @ 2024-08-16 656/week @ 2024-08-23 675/week @ 2024-08-30 438/week @ 2024-09-06 1064/week @ 2024-09-13 655/week @ 2024-09-20 502/week @ 2024-09-27 1889/week @ 2024-10-04 1027/week @ 2024-10-11 303/week @ 2024-10-18 255/week @ 2024-10-25

3,549 downloads per month
Used in 2 crates

Apache-2.0

120KB
2.5K SLoC

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.

A note on feature compatibility

If you want to use PyO3's abi3 feature, you must disable this library's time feature (which is enabled by default). This library provides an abi3 feature you can enable in order to explicitly request pyo3/abi3, which will give a clearer error message in that case.


Rigetti PyO3 is licensed under the Apache License 2.0.


lib.rs:

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

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

Usage

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.

Dependencies

~5–10MB
~121K SLoC