Skip to main content

PyCon DE - Writing Python modules in Rust

·
PyO3 Conference PyCon DE

Cheuk Ting Ho, a board member and community manager at OpenSSF, presented a workshop titled "PyO3 101 - Writing Python modules in Rust." The session focused on the basics of using PyO3, a toolset that provides Rust bindings for Python to create native Python extension modules. Attendees learned how to set up the project environment and write a Python library in Rust using PyO3. The workshop included hands-on exercises covering the API specifications for creating Python functions, modules, error handling, and type conversion. Rust's popularity in recent years has grown due to its robust compiler checks and memory safety features, making it an attractive choice for building Python libraries. The goal of the workshop was to introduce developers to PyO3 and explore leveraging Rust's memory safety and parallelism capabilities when developing Python libraries. The target audience included developers interested in using Rust to develop Python libraries, with attendees not required to have prior Rust knowledge. The workshop outline included an introduction to Rust and PyO3, setting up the environment, starting a new project, creating Python modules, and functions with hands-on exercises. Attendees were encouraged to have Python 3.8 or above installed and use a virtual environment for the workshop.