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.
Wrong.
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.
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.
Download Sample Chapter"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
This book offers shortcuts:
Here's what it includes:
Starting your project
Versions of Python
Laying Out Your Project
Version Numbering
Coding Style & Automated Checks
Modules, Libraries and Frameworks
The Import System
Useful Standard libraries
External libraries
Package Installation: Getting More From pip
Using and Choosing Frameworks
Documentation and Good API Practice
Documenting with Sphinx
Getting started with Sphinx and reST
Sphinx modules
Automating the Table of Contents with autosummary
Automating Testing with doctest
Writing a Sphinx Extension
Managing Changes to Your API
Handling Timestamps and Time Zones
The Problem of Missing Time Zones
Building Default datetime Objects
Time Zone-Aware Timestamps with dateutil
Serializing datetime Objects
Solving Ambiguous Times
Distributing Your Software
A Bit of History
Packaging with setup.cfg
The Wheel Format Distribution Standard
Sharing Your Work with the World
Entry points
Unit Testing
The Basics of Testing
Virtual Environments
Using virtualenv with tox
Methods and Decorators
Decorators and When to Use Them
How Methods Work in Python
Static methods
Class method
Abstract methods
Mixing Static, Class, and Abstract Methods
The Truth About super
Functional Programming
Creating Pure Functions
Generators
List comprehensions
Functional Functions Functioning
Using itertools Functions
The Abstract Syntax Tree, Hy, And Lisp-Like Attributes
Looking at the AST
Writing a Program Using the AST
Extending flake8 with AST checks
A Quick Introduction to Hy
Performances and Optimizations
Data Structures
Understanding Behavior Through Profiling
Definiting Functions Efficiently
Ordered Lists and Bisect
Namedtuple and Slots
Memoization
Faster Python with PyPy
Achieving Zero Copy with the Buffer Protocol
Scaling and Architecture
Multithreading in Python and Its Limitations
Multiprocessing vs. Multithreading
Event-Driven Architecture
Other Options and asyncio
Service-Oriented Architecture
Interprocess Communication with ZeroMQ
Managing Relational Databases
RDBMS, ORMs, and When to Use Them
Database Backends
Streaming data with Flask and PostgreSQL
Write Less, Code More
Using Six for Python 2 and 3 Support
Using Python Like Lisp to Make a Single Dispatcher
Context Managers
Less Boilerplate with attr
Learn Straight From the Experts
Serious 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. For more than 12
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).
Today, I work at Datadog and runs my own company
Mergify — where I write Python
code everyday.
Julien Danjou
Staff Engineer at Datadog / Founder at MergifyThis book really encourages me to evolve my self-perceived python script-kiddie level to bulletproof developer skills. Thank you, @juldanjou @nostarch pic.twitter.com/0UEkWO5aK3
— David Lassig (@d_lassig) May 7, 2019
Just finished «Serious Python» by @juldanjou & enjoyed it very much. Especially the chapters about Documentation And Good API Practice, Unit Testing and Functional Programming were full of insights and practical advice. And I love how almost every chapter ends with an interview! pic.twitter.com/eO6BeqxFCN
— Martin Michel (@applescripter) May 8, 2019
My print copy of _Serious Python_ arrived. Instantly one of the most valuable books in my Python library! Very readable style. Explains many intermediate-advanced Python features & covers important meta info on project maintenance and scaling. Thanks @juldanjou @nostarch pic.twitter.com/nGAhCcpzPM
— Boreal Coder (@BorealCoder) January 26, 2019
I just finished to reading The hacker guide to Python by @juldanjou and this is really interesting book! I've learn a lot of tips and tricks despite the fact that I use python since 6 years ago! A must have!https://t.co/UphJT1rR03
— Hervé Beraud (@4383hberaud) November 24, 2017
If you're into Python, I highly recommend getting this book from @juldanjou https://t.co/1nPwqMmf6z
— Andy Nicholas (@andy_nicholas) June 10, 2018
Lots of production proven juicy details on doing Python the "correct" way. Superb.
@juldanjou Hackers guide to python has been helpful from page 1. Many things I wondered about, but hadn't time/need to chase down. Thank you.
— Jeffrey DeLeo (@Jeff_DeLeo) December 6, 2017
If you program in Python you MUST read @juldanjou book the hacker guide to python ! http://t.co/TfgGv8D2sP
— ExaBGP (@exabgp) March 27, 2014
I had fun reading https://t.co/uTeiC0xINQ, great book @juldanjou, there is an entire python world to know.
— Jorge Galvis (@jorlugaqui) November 5, 2015
@juldanjou almost done with #THGTP 3rd edition, best python book ever! Thanks and I want a signature on it now :D
— aRkadeFR (@aRkadeFR) June 14, 2016
Reading THE #python book from @juldanjou. There's a large python codebase at @lengow, tips from the book are useful! pic.twitter.com/0E0ueBg3DT
— Mickael Le Baillif (@demikl) July 8, 2016
Reading through mine right now. So far learning more than I knew before. Also the pages feel super luxurious and thick, amazing smell also. A+ Will suggest to others.
— Integgroll (@integgroll) January 18, 2019
Ready to master Python?
Money back guaranteed!
Standard
$49- The ebook in PDF, HTML, MOBI and EPUB formats
- 8 experts interviews
- Future editions of the ebook
- A ready-to-run Docker image with a Python environment, exercises, and samples to run as notebooks
Enterprise
$199- The ebook in PDF, HTML, MOBI and EPUB formats
- 8 experts interviews
- Future editions of the ebook
- A ready-to-run Docker image with a Python environment, exercises, and samples to run as notebooks
- One hour of consulting time where I will review your project and advise you
- License to share with 20 members of your team
Frequently Asked Questions
Can I get a printed version?
My editor No Starch Press distributes a printed version that you can find on their Web site, on Amazon or in your favorite local book store (ISBN-13 978-1-59327-878-6).
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 20 users.
Let's discuss this over email.
Can I upgrade to another package?
Yes. Just forward me your purchase receipt and tell me which package you'd like to upgrade to.
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.