Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Speed Up Your Python with Rust
Speed Up Your Python with Rust

Speed Up Your Python with Rust: Optimize Python performance by creating Python pip modules in Rust with PyO3

Arrow left icon
Profile Icon Maxwell Flitton
Arrow right icon
Can$39.99 Can$44.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (14 Ratings)
eBook Jan 2022 384 pages 1st Edition
eBook
Can$39.99 Can$44.99
Paperback
Can$55.99
Subscription
Free Trial
Arrow left icon
Profile Icon Maxwell Flitton
Arrow right icon
Can$39.99 Can$44.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (14 Ratings)
eBook Jan 2022 384 pages 1st Edition
eBook
Can$39.99 Can$44.99
Paperback
Can$55.99
Subscription
Free Trial
eBook
Can$39.99 Can$44.99
Paperback
Can$55.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Speed Up Your Python with Rust

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn to implement Rust in a Python system without altering the entire system
  • Write safe and efficient Rust code as a Python developer by understanding the essential features of Rust
  • Build Python extensions in Rust by using Python NumPy modules in your Rust code

Description

Python has made software development easier, but it falls short in several areas including memory management that lead to poor performance and security. Rust, on the other hand, provides memory safety without using a garbage collector, which means that with its low memory footprint, you can build high-performant and secure apps relatively easily. However, rewriting everything in Rust can be expensive and risky as there might not be package support in Rust for the problem being solved. This is where Python bindings and pip come in. This book will help you, as a Python developer, to start using Rust in your Python projects without having to manage a separate Rust server or application. Seeing as you'll already understand concepts like functions and loops, this book covers the quirks of Rust such as memory management to code Rust in a productive and structured manner. You'll explore the PyO3 crate to fuse Rust code with Python, learn how to package your fused Rust code in a pip package, and then deploy a Python Flask application in Docker that uses a private Rust pip module. Finally, you'll get to grips with advanced Rust binding topics such as inspecting Python objects and modules in Rust. By the end of this Rust book, you'll be able to develop safe and high-performant applications with better concurrency support.

Who is this book for?

This book is for Python developers who want to speed up their Python code with Rust and implement Rust in a Python system without altering the entire system. You'll be able to learn about all topics relating to Rust programming. Basic knowledge of Python is required to get the most out of this book.

What you will learn

  • Explore the quirks of the Rust programming language that a Python developer needs to understand to code in Rust
  • Understand the trade-offs for multiprocessing and thread safety to write concurrent code
  • Build and manage a software project with cargo and crates
  • Fuse Rust code with Python so that Python can import and run Rust code
  • Deploy a Python Flask application in Docker that utilizes a private Rust pip module
  • Inspect and create your own Python objects in Rust

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 21, 2022
Length: 384 pages
Edition : 1st
Language : English
ISBN-13 : 9781801812320
Category :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jan 21, 2022
Length: 384 pages
Edition : 1st
Language : English
ISBN-13 : 9781801812320
Category :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 177.97
Speed Up Your Python with Rust
Can$55.99
Game Development with Rust and WebAssembly
Can$55.99
Practical WebAssembly
Can$65.99
Total Can$ 177.97 Stars icon

Table of Contents

15 Chapters
Section 1: Getting to Understand Rust Chevron down icon Chevron up icon
Chapter 1: An Introduction to Rust from a Python Perspective Chevron down icon Chevron up icon
Chapter 2: Structuring Code in Rust Chevron down icon Chevron up icon
Chapter 3: Understanding Concurrency Chevron down icon Chevron up icon
Section 2: Fusing Rust with Python Chevron down icon Chevron up icon
Chapter 4: Building pip Modules in Python Chevron down icon Chevron up icon
Chapter 5: Creating a Rust Interface for Our pip Module Chevron down icon Chevron up icon
Chapter 6: Working with Python Objects in Rust Chevron down icon Chevron up icon
Chapter 7: Using Python Modules with Rust Chevron down icon Chevron up icon
Chapter 8: Structuring an End-to-End Python Package in Rust Chevron down icon Chevron up icon
Section 3: Infusing Rust into a Web Application Chevron down icon Chevron up icon
Chapter 9: Structuring a Python Flask App for Rust Chevron down icon Chevron up icon
Chapter 10: Injecting Rust into a Python Flask App Chevron down icon Chevron up icon
Chapter 11: Best Practices for Integrating Rust Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9
(14 Ratings)
5 star 92.9%
4 star 7.1%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Wei Ji Leong Jan 25, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book has been really good for picking up Rust from a Pythonista perspective. It does a comprehensive job at walking through setups for those that might not have done Python package management before, but it may be good still to come with some experience to pick things up quicker. Overall, would recommend!
Feefo Verified review Feefo
Imre Beke Feb 06, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Szeretném a Python környezetben nagy adatállományok feldolgozását gyorsítani, minden olyan eszköz lehetőség ami ebben lehetőséget rejt az érdekel és ki szeretném próbálni.
Feefo Verified review Feefo
Priya R Shastri Feb 28, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
In 11 chapters, the author Maxwell an experienced software engineer goes from Introduction to RUST to using them in advance.The first chapter introduces RUST as a programming language and how it can be easily used when used with Python and can be installed using pip.All the examples in the book work with a Python interpreter and Rust interpreter.In chapter 2 the author discusses structuring the code in RUST. The file can be listed as hello_world.rs . Using cargo one can compile the RUST file. The author highlughts the benefilts of documentation while coding.In chapter 3 Understanding concurrency, basics of concurrent programming are discussed. In chapter 4 Building pip modules in python are discussed. In chapter 5 creating a rust interface for the pip module details of the rust interface are discussed. Use of a python adapter to test rust binary file is discussed. In chapter 6 working with python objects are discussed. In the chapters , 8, 9 the creation of a flask application for RUST are discussed. In chapter 11 best practices for integrating RUST in python are stated.Overall good book for using RUST with python adapter. Useful for data applications using PYthon and RUST.
Amazon Verified review Amazon
Dmitry Mar 19, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book starts by giving you an introduction to Rust. You will like this introduction if you already have some experience with programming languages(I assume you know Python), as it skips the boring basics like for instance the loops. Can’t promise you’ll become a Rust guru after reading the first chapter. I, for instance, am still blurry on the concept of borrowed variables, but I can read the code and even managed to write a few programs in Rust after reading this book.The rest of the book will tell you how to put Rust code into your Python project, how to structure the project, how to pass objects and call methods between these two languages. A lot of examples in the book are simple algorithms that you will speed up by simply using Rust instead of Python. The book also warns against the cases where you won’t get any speed improvement from the rewrite. Some examples in the book go beyond simple algorithmic challenges and cover how you can make Rust code part of your Flask API.
Amazon Verified review Amazon
Eduard Stefanescu Feb 06, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is really beneficial to a Python developer who wishes to create apps or services with Rust. There is a straightforward transition that keeps Python and pip packages in mind while developing apps with Rust.In addition to the transition examples and applications, Maxwell Flitton explains the advantages of utilizing Rust rather than Python in certain scenarios.It was my first book and my first opportunity to learn Rust, and I can now see much more clearly where there is a rationale for Python and when there is a case for Rust.This book is a gem for a Python developer who wants to learn Rust. It will help you not only learn how to develop apps with Rust but also offer insights into Rust's capabilities.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.