pyo3/examples
David Hewitt e55e1721a5
Merge pull request #3222 from krpatter-intc/getitem_example
simple getitem example
2023-06-16 06:58:49 +00:00
..
decorator examples: bump edition to 2021 2023-06-15 22:25:48 +01:00
getitem simple getitem example 2023-06-15 16:39:25 -05:00
maturin-starter examples: bump edition to 2021 2023-06-15 22:25:48 +01:00
plugin bump maturin version in example files 2023-06-14 08:45:32 +01:00
setuptools-rust-starter examples: bump edition to 2021 2023-06-15 22:25:48 +01:00
word-count examples: bump edition to 2021 2023-06-15 22:25:48 +01:00
Cargo.toml rename examples package to fix dependabot 2023-06-12 21:18:12 +01:00
README.md added a plugin example that shows how to integrate a Python plugin into a Rust app while having option to test API without the main app 2023-01-27 08:34:09 +00:00

README.md

PyO3 Examples

These example crates are a collection of toy extension modules built with PyO3. They are all tested using nox in PyO3's CI.

Below is a brief description of each of these:

Example Description
decorator A project showcasing the example from the Emulating callable objects chapter of the guide.
maturin-starter A template project which is configured to use maturin for development.
setuptools-rust-starter A template project which is configured to use setuptools_rust for development.
word-count A quick performance comparison between word counter implementations written in each of Rust and Python.
plugin Illustrates how to use Python as a scripting language within a Rust application

Creating new projects from these examples

To copy an example, use cargo-generate. Follow the commands below, replacing <example> with the example to start from:

$ cargo install cargo-generate
$ cargo generate --git https://github.com/PyO3/pyo3 examples/<example>

(cargo generate will take a little while to clone the PyO3 repo first; be patient when waiting for the command to run.)