Hands-on course · 16 days
Python hands-on
Modern Python for platform engineers – build a small, useful tool every day, from a word counter to an AI agent with MCP.
- Free · no subscription
- 16 days · 45–150 min each
- 143 drills · with expected output
$ uv run wc --top 3 lab/runbook.txt
$ uv run wc gibt-es-nicht.txt; echo "exit=$?"
$ uv run wc -x; echo "exit=$?"
$ uv run wc -h
Expected
5 31 209 lab/runbook.txt --- Top 3 --- zertifikat 3 prüfe 3 dienst 2 wc: gibt-es-nicht.txt: No such file or directory exit=1 usage: wc [-h] [-l] [-w] [-m] [--top N] [files ...] wc: error: unrecognized arguments: -x …
As a book
The whole course to take with you, for reading away from the screen. Reading online stays free.
With Pro: as your book of the month
Pro launches soon. With a free account you can join the Pro waitlist.
Leanpub · soon
Amazon · soon
What you'll be able to do
- Build CLI tools with typer, pathlib and subprocess and test them with pytest, fixtures and mocks
- Ship a tool as a versioned package that installs via uv tool install
- Check hundreds of URLs in parallel with asyncio and build a URL shortener with FastAPI and SQLite
- Talk to a local LLM from Python, query notes via RAG and offer tools as an MCP server
What you need
LabA Mac or Linux machine with a terminal; Docker is not required.
Day 0You set up uv, Python 3.14, ruff and pytest yourself.
Part C · Days 10–13Ollama running locally with the model ministral-3:3b (3.0 GB).
Training plan
One day = one sitting. Every day ends with a checkpoint and a challenge. About 35 hours in total.
Read first: Foreword
Part A · Foundation
uv, Python 3.14, ruff, pytest- Day 0 The Training Groundset up uv, Python 3.14, ruff and pytest and build the first tool hallo as a uv project 45 min
- Day 1 Syntax in Brief – wcpractice strings, lists, dicts, loops and comprehensions with a wc of your own that counts lines, words, characters and the most frequent words 90 min
- Day 2 Functions, Types, Modules – logsumuse functions, type hints, dataclasses and several modules to build a tool logsum that analyzes access logs: status codes, top errors, time windows 120 min
- Day 3 CLI Tools with typer – tidybuild a CLI tidy with typer, pathlib and subprocess that cleans up a download folder by rules – as a dry run by default, with clean exit codes 120 min
- Day 4 Errors, Logging, Tests – checkcertbuild a tool checkcert that checks TLS certificates and reports the remaining validity in days – with a custom exception, logging and a pytest suite of fixtures, parametrize, tmp_path and mocks 150 min
Part B · Toolmaking
- Day 5 Packaging and Quality – checkcert as a Packageturn checkcert from Day 4 into a versioned, checked package that can be installed via uv tool install 90 min
- Day 6 HTTP and APIs – ghrelbuild a CLI ghrel that robustly queries the latest GitHub releases 120 min
- Day 7 Concurrency – urlcheckbuild a CLI urlcheck that checks hundreds of URLs in parallel with asyncio 120 min
- Day 8 Data – costreportbuild a CLI costreport that analyzes a cloud cost CSV and reports as Markdown 120 min
- Day 9 Web Service – shorturlBuild a tested mini URL shortener shorturl with FastAPI, SQLite and a Dockerfile 120 min
Part C · Python for AI
+ Ollama- Day 10 LLM APIs – the terminal assistant askTalk to a local LLM from Python – chat, streaming, temperature, structured output, measurement – and turn it into the CLI tool ask 120 min
- Day 11 Embeddings and RAG – docsearch queries your notesSplit Markdown notes into chunks, index them as vectors, search semantically and answer questions with source citations – plus measure how well it works 150 min
- Day 12 Tool calling, the agent loop and MCP – ops-agentProvide Python functions as tools for an LLM, build an agent loop with stop conditions and guardrails, and offer the same tools as an MCP server 150 min
- Day 13 Classic ML and getting started with PyTorch – logclassClassify log lines with scikit-learn (TF-IDF, logistic regression, train/test, metrics), evaluate honestly and solve the same task once with a small PyTorch network 120 min
Finale
against the clock- Day 15 Competition – tool challenges against the clockBuild seven small ops tools from scratch under time pressure – with nothing but a specification and a test file – and prove that the patterns from 14 days have stuck 150 min
- Appendix B Final ExamProve that you can build a Python tool on your own, from the specification to CI-checked delivery 150 + 20 min
Extras
optionalReady? Day 0 takes 45 min.
Reading works without an account. A free account saves your progress.
Related courses
More on this topic: DevOps courses