Giter Site home page Giter Site logo

blacktiev2 / speed-up-your-python-with-rust Goto Github PK

View Code? Open in Web Editor NEW

This project forked from packtpublishing/speed-up-your-python-with-rust

0.0 0.0 0.0 89 KB

Speed up your Python with Rust, published by Packt

License: MIT License

Shell 0.84% Python 58.54% Rust 37.10% Mako 1.36% Dockerfile 2.16%

speed-up-your-python-with-rust's Introduction

Speed Up Your Python with Rust

Speed Up Your Python with Rust

This is the code repository for Speed Up Your Python with Rust , published by Packt.

Optimize Python performance by creating Python pip modules in Rust with PyO3

What is this book about?

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 covers the following exciting features:

  • 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

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

use std::error::Error;
use std::fs::File;
use csv;
use super::structs::FootPrint;
let code = "5 + 6";
let result = py.eval(code, None, Some(&locals)).unwrap();
let number = result.extract::<i32>().unwrap();

Following is what you need for this book: 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.

With the following software and hardware list you can run all code files present in the book (Chapter 1-11).

Software and Hardware List

Chapter Software required OS required
1 Python 3 Windows, Mac OS X, and Linux (Any)
1 Rust Windows, Mac OS X, and Linux (Any)
1 Docker Windows, Mac OS X, and Linux (Any)
1 PYO3 Windows, Mac OS X, and Linux (Any)
1 Redis Windows, Mac OS X, and Linux (Any)
1 PostgreSQL Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Related products

Get to Know the Author

Maxwell Flitton is a software engineer who works for the open source financial loss modeling foundation OasisLMF. In 2011, Maxwell achieved his Bachelor of Science degree in nursing from the University of Lincoln, UK. While working 12-hour shift s in the A&E departments of hospitals, Maxwell obtained another degree in physics from the Open University in the UK and then moved on to another milestone, with a postgraduate diploma in physics and engineering in medicine from UCL in London. He's worked on numerous projects such as medical simulation soft ware for the German government and supervising computational medicine students at Imperial College London. He also has experience in financial tech and Monolith AI.

Other books by the authors

Rust Web Programming

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.