Home

Awesome

<!--TOC--> <!--TOC-->

About this list

Items:

The goal of this documentation is to help you become a productive Python developer.

It assumes that those skills will be used in a professional environment. It includes concrete exercises, because the best way to learn is by doing. It focuses on real-world, applied documentation that will help your programming on a day-to-day basis.

This doc assumes programming knowledge and experience.

If you're also interested in generic programming best practices, I've compiled a list of professional programming resources.

Learning the language

Why learn Python?

Beginner

Here are some free books:

The Python Guide has some other good resources.

If you're coming from another language, read this article about the ten myths of enterprise Python.

If you want to review algorithms at the same time, you can use Problem Solving with Algorithms and Data Structures using Python by Bradley N. Miller, David L. Ranum.

Other resources include (prefer the one listed above):

Intermediate

I wrote some introductory material to advanced Python:

Some other resources:

Articles, videos and presentations

Books

Lists of books:

Podcasts

Writing idiomatic Python

First things first, let's get code style out of the way. Make sure you've read and memorized PEP8 (code style, more readable version here) and PEP257 (docstring style). Those two code styles are applied by almost all major Python applications and libraries. Use flake8, pydocstyle and black to ensure they are applied (check other linters and autofixers below).

What is called "idiomatic Python" might feel magical at first, especially if you don't know Python. I'd recommend getting your hands dirty with some real world Python code. Try to wander around the code, opening random files. Run the tutorial with a debugger to follow the flow and understand what's going on.

You can find other ideas on this hacker news thread.

I feel it's more important to understand the vision behind Python's design, than to know specific Python idioms. The Zen of Python will help you understand the fundamental reasoning behind each idiom.

>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Learning idiomatic Python:

List of books:

Exercises

The best way to learn is to do.

Code practice websites

Small exercises

Larger projects

Reddit's dailyprogrammer subreddit has some good exercises as well.

Another great way to learn Python is by contributing to one of the numerous open source libraries. Coding is not something that is to be learn in isolation, and you'll learn great valuable insights from the code review you'll get from those communities. You can look for tickets (e.g. Github issues) for Python libraries you're using, or find some in the list below, or pick one of the libraries listed in Awesome Python.

Make sure you pick a library where the tickets are not too involved, and where the community is still alive (i.e. there's recent merged pull requests).

My exercises

Topics

Algorithms

Best Practices

Beyond Python (other programming languages)

Boilerplate

Celery

Celery is a distributed async tasks runner.

CLI

Building command line interfaces.

Code Architecture

Concurrency

Configuration

Debugging

Deployment

See also the more generic Docker section in charlax/professional-programming.

Design patterns

I maintain a list of antipatterns on this repo.

Documentation

Example, inspiration and template packages

By topics:

Exception

File organisation (monorepo, folders, etc.)

Functional programming

Consider checking out the same section on my charlax/professional-programming repo.

Internals

Python behind the scenes series:

Magic methods

Open source Python apps

It's often a good idea to read the Python source code of well-written applications:

Packages (finding and using them)

How to use:

Lists:

Packages (opinionated list)

Here's a short list of great packages:

Some other cool packages:

Packaging (creating your own package)

Parsing

Performance

Stories:

Tools:

Preparing for interviews

Quirks and gotchas

Regular expressions (regex)

Security

SQLAlchemy

SQLAlchemy is the de facto standard ORM for Python. It has a unique approach: contrary to most ORM, it tries very hard not to hide the SQL implementation details from you. This is great because it forces you to really understand the underlying DB.

Here is some slightly outdated content that is super useful to fully leverage the library:

Standard library modules

Some little known standard library modules:

Static analysis of code

Tests

Half of coding time is usually spent writing tests. Yet how to write tests efficiently is very rarely taught at school - even though it came make a huge difference in engineering productivity and quality.

First, make sure you're familiar with the different kind of testing strategies laid out in Testing Strategies in a Microservices Architecture (Martin Fowler).

Then, read some of those articles:

Tools built with Python

Types

Unicode

Reference and other lists

Staying up to date

There are two main newsletters for Python, which mostly cover the same things:

You can also checkout the Python subreddit.

Non-Python professional coding education

Read this up on my professional programming doc.

If you want to get in touch, checkout my website.

My other lists