Python for APIs, Services and Tools
Call web APIs safely, validate data with Pydantic, build a FastAPI service, use databases, write command-line tools, automate work and ship it in a container.
Most real Python work is not a single script. It talks to other programs over the network, reads secrets from its environment, checks the data it receives, stores results in a database, and runs as a service or a command-line tool. This phase teaches those everyday jobs, one at a time.
A thread runs through it. Every large language model API is an ordinary web API that takes JSON and returns JSON. The timeouts, retries, rate-limit handling, API-key hygiene and Pydantic models you learn here are exactly what Phase 16 uses to call models.
Your browser has no real network, so the live examples here use a fake server that is a plain Python function (httpx.MockTransport). You still see real request and response objects, status codes, headers and errors. Code that needs a real network, a web server or a subprocess is shown as a normal code block, with output from a real run.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.