From the course: Using Rust with Python
Unlock this course with a free trial
Join today to access over 23,200 courses taught by industry experts.
Diagram of a PyO3 project - Rust Tutorial
From the course: Using Rust with Python
Diagram of a PyO3 project
- [Instructor] Here we have the diagram of a Py03 Rust, Python CLI project. So this is more of a realistic style of a project that someone would implement the heavy logic in Rust. So this could be the computationally complex things like, you know, numerical operations or maybe some hardcore data frame type operations, or even using some ML lops capabilities. Whatever it is you're doing that is going to require the core features of Rust, which is extremely good performance, one of the best performing languages in the world. Now if we look at the Rust code here, you have to build up the logic, and then when you expose the logic, you can see here that it's only a few lines of code to actually create a Python module. So this is the key component in your Rust code, is you build a function. In this case, we have libpycalc_cli, and then what we do is we return back this pi result right here. Now, the case of each of these functions, it's pretty straightforward to understand what they're…
Contents
-
-
Introduction: Instructor45s
-
Introduction: Rust and Python5m
-
PyO3 installation4m 15s
-
(Locked)
Basic Rust library4m 46s
-
(Locked)
Rust to Python3m 33s
-
(Locked)
Rust ownership model4m 59s
-
(Locked)
Diagram of a PyO3 project3m 40s
-
(Locked)
Python calculator CLI3m 54s
-
(Locked)
PyO3 features2m 38s
-
(Locked)
PyO3 exceptions4m 21s
-
(Locked)
Call Python from Rust5m 53s
-
(Locked)
Run Python with embedded Rust4m 47s
-
(Locked)
Embedded Rust CLI diagram3m 34s
-
(Locked)
Embedded Rust CLI4m 31s
-
(Locked)
Embedded Rust CLI test4m 59s
-
(Locked)
Rust-built Python tools3m 52s
-
(Locked)
Using the Rust Ruff linter5m 15s
-
(Locked)
Using Polars in Python with Rust4m 9s
-
(Locked)
Polars CLI in Rust4m
-
(Locked)
Polars CLI test in Rust4m 21s
-
(Locked)
Polars CLI integration test3m 29s
-
(Locked)
Polars criterion benchmarking5m 39s
-