The primary source for everything in this course is the official Python documentation. When a unit and the docs disagree, the docs win. The docs are versioned, so make sure you are reading the version you run.
Where to go next
If you have worked through the units and built the capstone, you can write, test and package a Python program that reads files, calls web APIs, processes data and runs work concurrently. That is enough to be useful on a real project. Here are some recommendations for what to do next. Pick the ones that fit your goals.
- Build something of your own. A small tool you use every week teaches more than another course. Some ideas: a command line tool that tidies a downloads folder, a script that turns a bank export into a monthly report, or a client for a public API you like.
- Put your code under version control. This course does not teach Git. Learn its basics next (commit, branch, push, pull request), then run your tests automatically on every push, as described in Testing with pytest. The Git documentation includes a free book.
- Go deeper into the language. Good next topics are type hints in depth (generics,
TypedDict, checking a whole project with mypy or Pyright), the debugger (breakpoint()and thepdbmodule), profiling withcProfile, and the data model that Fluent Python covers. - Pick a direction. For web services, look at a web framework such as FastAPI, Flask or Django, and learn SQL. For data work, continue from Working with data with more pandas, plotting and Jupyter. For automation, explore the modules in A tour of the standard library further.
- Read other people's code. Much of the standard library is readable Python. Run
import json; print(json.__file__)to see where a module lives, then open it and see how it is put together. - Come back to the appendices. Idiomatic Python and Practice problems are good revision before an interview or after a break.
Official documentation
| Resource | What it is for |
|---|---|
| The Python Tutorial | The language, step by step, from the people who make it |
| The Python Standard Library | Reference for every built in function, type and stdlib module |
| The Python Language Reference | The exact rules: syntax, the data model, the import system |
| What's New in Python | What changed in each release. Read it when you upgrade |
| Python HOWTOs | Focused guides: Unicode, sorting, logging, regular expressions, descriptors, functional programming |
| Glossary | Precise definitions of iterable, hashable, context manager, and more |
| Python Packaging User Guide | Installing packages, virtual environments, pyproject.toml, publishing |
| Python Developer's Guide: versions | Which Python versions are supported, and until when |
Python Enhancement Proposals (PEPs) mentioned in this course
The table lists the PEPs that the units cite by number, and a few more that define features the units teach.
| PEP | Topic | Unit |
|---|---|---|
| 1 | What a PEP is and how the process works | Introduction to Python |
| 8 | Style guide for Python code | Throughout |
| 13 | How the Python project is governed | Introduction to Python |
| 20 | The Zen of Python | Introduction to Python |
| 257 | Docstring conventions | Functions |
| 263 · 3120 | Source file encodings; UTF-8 as the default | Text, bytes and Unicode |
| 420 | Namespace packages without __init__.py | Modules and packages |
| 427 | The wheel package format | Packaging and tooling |
| 465 | The @ operator for matrix multiplication | Operators and expressions, Working with data |
| 484 | Type hints | Functions, Classes and objects |
| 517 · 518 | Build back ends and the [build-system] table | Packaging and tooling |
| 572 | Assignment expressions (:=) | Operators and expressions |
| 597 | EncodingWarning for implicit encodings | Text, bytes and Unicode |
| 602 | Annual release cycle | Introduction to Python |
| 615 | zoneinfo: IANA time zones in the stdlib | A tour of the standard library |
| 621 | Project metadata in pyproject.toml | Packaging and tooling |
| 634 · 636 | Structural pattern matching (match) and its tutorial | Control flow |
| 639 | Licence expressions in package metadata | Packaging and tooling |
| 654 | Exception groups and except* | Errors and exceptions |
| 668 | Externally managed environments | Setting up Python, Packaging and tooling |
| 686 | UTF-8 mode on by default | Text, bytes and Unicode |
| 701 | The formal grammar of f-strings, including reuse of the same quotes inside one | Strings and text formatting |
| 703 · 779 | Free threaded CPython, and its supported status | Introduction to Python, Concurrency |
| 735 | Dependency groups in pyproject.toml | Packaging and tooling |
| 744 | The experimental JIT compiler | Introduction to Python |
| 750 | Template strings | Strings and text formatting |
| 751 | A standard lock file format (pylock.toml) | Packaging and tooling |
| 758 | except and except* without parentheses | Errors and exceptions |
| 765 | Control flow in finally blocks | Errors and exceptions |
| 773 | The Python install manager for Windows | Setting up Python |
| 810 | Explicit lazy imports | Introduction to Python, Values, names and types |
| 3131 | Non ASCII identifiers | Values, names and types |
Tools and libraries
| Project | Documentation |
|---|---|
| pip | pip.pypa.io |
| pytest | docs.pytest.org |
| Requests | requests.readthedocs.io |
| PyYAML | pyyaml.org |
| pandas | pandas.pydata.org/docs |
| NumPy | numpy.org/doc |
| Apache Arrow (pyarrow) | arrow.apache.org/docs/python |
| Ruff | docs.astral.sh/ruff |
| uv | docs.astral.sh/uv |
| mypy | mypy.readthedocs.io |
| defusedxml | pypi.org/project/defusedxml |
| pytest-cov | pytest-cov.readthedocs.io |
| pytest-xdist | pytest-xdist.readthedocs.io |
| HTTPX | www.python-httpx.org |
| Matplotlib | matplotlib.org |
| JupyterLab | jupyterlab.readthedocs.io |
| pipx | pipx.pypa.io |
| pre-commit | pre-commit.com |
| Pyright | microsoft.github.io/pyright |
| Poetry, PDM and Hatch | python-poetry.org, pdm-project.org, hatch.pypa.io |
| conda and conda-forge | docs.conda.io, conda-forge.org |
Books
- Fluent Python, Luciano Ramalho (O'Reilly). Once you are comfortable with this course, the best next step for writing Python that uses the language's full data model.
- Effective Python, Brett Slatkin (Addison-Wesley). Short, numbered items of advice, each with a worked example.
- Automate the Boring Stuff with Python, Al Sweigart (No Starch Press; free to read online). Practical scripts for files, spreadsheets, PDFs and the web.
- Think Python, Allen B. Downey (O'Reilly; free to read online). A gentle introduction to programming that uses Python.
Look for the latest edition of each book. The first editions were written for much older Python versions.
Credits
- Facts about the language and the standard library were checked against the official Python documentation, © Python Software Foundation. The explanations and examples were written for this course, and no documentation text is reproduced.
- The topic selection of the Python cheat sheet was inspired by Laurent Pointal's Python 3 Memento, licensed CC BY 4.0. The text and examples here are original.
- The crime data lab in Files and data formats and Working with data is modelled on the City of Chicago's public dataset of reported crimes from 2001 to the present (Chicago Data Portal). The small samples shown in the units are invented. If you download the real dataset, follow the portal's terms of use.