My easy button to master Python

“I will recommend this to fellow devs who wish to take their Python skills to next level. Thanks a lot Julien.” — Smital Desai

Buy Now Get the sample chapter

You have to put in the sweat, blood, and tears to become a jedi of Python. Maybe you think: If you skip the mistakes that others have made means you’re not good enough to write efficient code. It means you’re not worthy.


It just means everyone else knows a secret you don’t.

When they write code, they’re following specific battle-tested strategies and methods to leapfrog over mistakes. They get faster code with fewer errors.

You can, too.

“First advanced book on architecture about Python project that is clear, clever, and easy to read :)”
Amazon review

After I spent years working every day in Python, I compiled my best lessons into an ebook.

Get the sample chapter

Get the table of contents and a free chapter of the book. I promise that you’ll get an instantly actionable tip. Or I’ll make up for it by giving you a free 15-min “pick my brain” consult.


"How can this book help me?"

Best Practice

Methods & advice you should follow when writing your code and designing applications. These will help you get the most out of Python, and build future-proof programs. If you're already working on something, you'll be able to apply the techniques discussed right away to improve your current code.

Deep Down Diving

You will get introduced to some of the Python internals to get a better understanding of how to write efficient code. You will gain a greater insight into the inner workings of the language. You will be unbeatable about how Python works deep down.

Solving Problems

Battle-tested solutions to tackle problems such as testing, porting, or scaling Python code, applications and libraries. You will avoid making the mistakes that others have made, saving you time. You'll discover strategies that will help you maintain your software in the long run.

When you develop a Python application, there are hundreds of problems to solve

Code style
Database management
Dynamic code plug-in

This book offers shortcuts:

Here's what it includes:

Starting your project

Python versions
Project layout
Version numbering
Coding style & automated checks

Modules and libraries

The import system
Standard libraries
External libraries

Managing API changes

The trap of timezones


Getting started with Sphinx and reST
Sphinx modules
Extending Sphinx


A bit of history
Packaging with pbr
The Wheel format
Package installation
Sharing your work with the world
Entry points
Visualising entry points
Using console scripts
Using plugins and drivers

Virtual environments

Unit testing

The basics
Test streaming and parallelism
Using virtualenv with tox
Testing policy

Methods and decorators

Creating decorators
How methods work in Python
Static methods
Class method
Abstract methods
Mixing static, class, and abstract methods
The truth about super

Functional programming

List comprehensions
Functional functions functioning


Extending flake8 with AST checks

Performances and optimizations

Data structures
Ordered list and bisect
Namedtuple and slots
Achieving zero copy with the buffer protocol

Scaling and architecture

A note on multi-threading
Multiprocessing vs multithreading
Asynchronous and event-driven architecture
Service-oriented architecture


Streaming data with Flask and PostgreSQL

Python 3 support strategies

Language and standard library
External libraries
Using six

Write less, code more

Single dispatcher
Context managers

Learn Straight From the Experts

The Hacker's Guide to Python includes eight interviews from experienced Python developers. They share their know-how and wisdom on the various themes covered in the book.

Doug Hellmann

Doug is an open source programmer, working as a Senior Principal Software Engineer at Red Hat. He contributes to OpenStack, the largest open-source project using Python and wrote several Python books himself.

Nick Coghlan

Nick is a developer of the Python programming language; he's responsible for various feature that you'll use when programming with Python!

Christophe de Vienne

Christophe is a Python developer, responsible for various Python libraries and framework. He wrote a lot of very large Python application and maintained them during several years.

Robert Collins

Robert is a software engineer that worked on many Python libraries, especially in the unit and functional testing domain.

Victor Stinner

Victor is a long time CPython developer. He is well known in the community for working on making CPython faster and leads several performance-oriented projects. He likes to talk about optimizations, profiling, and performance when using Python, and how to make the right decisions.

Joshua Harlow

Joshua is a highly experienced engineer in distributed systems, working at GoDaddy. Josh is very knowledgeable on principles that make Python application resilient and faults tolerant as he wrote and maintained several of those over the years.

Dimitri Fontaine

Dimitri is a senior PostgreSQL contributor. He had the chance to work with a lots of Python developers and has a few opinions about how you should handle your database.

Paul Tagliamonte

Paul is a open source hacker and the creator of the Hy programming language, a Lisp inspired dialect of Python. Paul has a great understanding of the Python interpreter and its abstract syntax tree.


Who's the Author?

Hi, I'm Julien, a Free Software hacker for close to twenty years now. These last ten years, I've been developing software using Python. I spent those last years as a Project Team Leader in OpenStack, a distributed cloud platform. It's the largest existing open-source Python code base (2.5 millions of lines of Python).

Julien Danjou
Principal Software Engineer at Red Hat

"A Must Read"

The readers of The Hacker's Guide to Python talk about it better than anyone else.

Ready to master Python?

  •   The ebook in PDF, HTML, MOBI and EPUB formats
  •   8 experts interviews
  •   Future editions of the ebook
  •   The code source of the application used to distribute the sample of this book by mail as an illustration
  •   The ebook in PDF, HTML, MOBI and EPUB formats
  •   8 experts interviews
  •   Future editions of the ebook
  •   The code source of the application used to distribute the sample of this book by mail as an illustration
  •   The book printed in paperback format, delivered to your door
  •   The ebook in PDF, HTML, MOBI and EPUB formats
  •   8 experts interviews
  •   Future editions of the ebook
  •   The code source of the application used to distribute the sample of this book by mail as an illustration
  •   One hour of consulting time where I will review your project and give you some advice
  •   License to share with 50 members of your team

Frequently Asked Questions

I bought the paperback version. How do I get the electronic version?

Lulu is not able to distribute the electronic version along the paperback version. Therefore once you purchased your paperback copy, forward me your receipt and I'll get you the electronic version.

What if the book is not for me?

If you think the book has no value to you, then I don't want your money. Ask me for a refund.

I need a license for more than 50 users.

Let's discuss this over email.

I probably need more than a book. Are you available for consulting?

Let's talk about that over email.

I have another question!

Send me an email.