Overview
You write TypeScript or Go backends. You know git, Docker, and cloud services cold. You have little or no modern Python — or you learned Python years ago and the ecosystem has moved on without you. This guide is built for exactly that.
It is example-driven: every concept has runnable code, and almost everything is shown three ways — the TypeScript way, the Go way, and the Python way — so you map what you already know onto Python instead of starting from scratch.
It is also aggressively modern. Python’s tooling went through a quiet
revolution: uv replaced the pip/virtualenv/poetry tangle, ruff replaced
black + flake8 + isort, type hints went from optional to expected, and async
became a first-class way to build services. This guide teaches the 2026 stack
only. Legacy tools get named once for context, then we move on.
Who this is for
Section titled “Who this is for”- You write TypeScript or Go backends professionally.
- You know git, Docker, and cloud services well.
- You have little or no current Python experience (or rusty, pre-3.10 Python).
- You want to be productive on Python backends quickly — the modern way.
You need Python 3.13+ (we target 3.14), uv, and Docker. Module 01 walks through the toolchain in detail; the short version for the shared infrastructure is:
-
Install uv (it manages Python itself — no separate Python install needed):
Terminal window curl -LsSf https://astral.sh/uv/install.sh | shuv python install 3.14 -
Start all infrastructure (PostgreSQL, Redis, Kafka):
Terminal window cd shared-infra && docker compose up -d -
Tear everything down when you’re done:
Terminal window docker compose down -v
| Tool | Version |
|---|---|
| Python | 3.14 (3.13+ fine) |
| uv | latest |
| Ruff | latest |
| ty | latest (mypy as the mature alternative) |
| FastAPI | latest |
| Pydantic | v2 |
| SQLAlchemy | 2.0 (async) |
| PostgreSQL | 17 |
| Redis | 8 |
| Kafka | 4.x (KRaft) |
Modules
Section titled “Modules”Python Language
Section titled “Python Language”| Module | You build |
|---|---|
| Dev Environment & Tooling | A uv project from scratch with Ruff + ty, a JSON CLI tool |
| Modern Typing | Type hints, generics (PEP 695), Protocols, match — with TS/Go comparisons |
| Data Structures & Functional Style | Dataclasses, comprehensions, itertools/functools, generators, a data pipeline |
| Pydantic & Typed Data Validation | Pydantic v2 models, validators, typed settings |
| Module | You build |
|---|---|
| Async & Structured Concurrency | A concurrent HTTP fetcher with TaskGroup, timeouts, cancellation |
| Streams & Background Work | Async generators, queues, a real-time processing pipeline |
Frameworks
Section titled “Frameworks”| Module | You build |
|---|---|
| FastAPI REST APIs | A full CRUD API with dependency injection, lifespan, settings |
| Litestar — the same API, compared | The same CRUD API in Litestar — compare both, pick your style |
| Module | You build |
|---|---|
| PostgreSQL Access | The same queries four ways — raw asyncpg, SQLAlchemy Core, ORM, SQLModel — plus Alembic |
| Redis & Caching | Cache-aside, pub/sub, rate limiting |
| Event-Driven with Kafka | A producer/consumer pipeline, dead letter queue, event sourcing |
Production
Section titled “Production”| Module | You build |
|---|---|
| Testing | pytest, pytest-asyncio, Hypothesis, Testcontainers — unit through integration |
| Security & Auth | JWT auth, argon2 hashing, OAuth2, RBAC |
| API Design & Serialization | REST + GraphQL (Strawberry) + gRPC, OpenAPI docs |
| Observability | Structured logging (structlog), OpenTelemetry traces, Prometheus metrics |
Advanced
Section titled “Advanced”| Module | You build |
|---|---|
| Advanced Python | Decorators, context managers, descriptors, the GIL & free-threading, performance |
| Packaging & Deployment | uv-based multi-stage Docker, distroless images, GitHub Actions CI/CD, K8s manifests |
Capstone
Section titled “Capstone”| Module | You build |
|---|---|
| Capstone: Notification Service | A full microservice: API + DB + Cache + Kafka + Auth + Tests + Deploy |
Learning paths
Section titled “Learning paths”Pick a path based on your goal — modules are referenced by number.
Get productive fast (7 modules)
01 → 02 → 05 → 07 → 09 → 12 → 17Complete backend (17 modules)
01 → 02 → 03 → 04 → 05 → 06 → 07 → 09 → 10 → 11 → 12 → 13 → 14 → 15 → 16 → 17 → 18API-focused
01 → 02 → 04 → 07 → 09 → 12 → 13 → 14 → 17Data & async focus
01 → 02 → 03 → 05 → 06 → 09 → 10 → 11How each module works
Section titled “How each module works”Each module is a lesson plus one or more hands-on exercises. Every exercise is
a self-contained uv project with a worked solution:
Directorymodule-name/
- the lesson content + side-by-side code examples
Directoryexercises/
Directoryproject-name/
- pyproject.toml
- docker-compose.yml if the exercise needs infrastructure
Directorysrc/
- …
Building and running any exercise is the same uv dance:
uv sync # create the venv and install deps (like npm install)uv run python -m app.main # run it (uv handles the venv for you)uv run pytest # run testsTear down any module-specific Docker services with docker compose down -v.
Shared infrastructure
Section titled “Shared infrastructure”All modules share one Docker Compose stack under shared-infra/:
| Service | Port | Credentials |
|---|---|---|
| PostgreSQL | 5432 | dev / dev / app |
| Redis | 6379 | no auth |
| Kafka | 29092 | no auth |
| Kafka UI | 8090 | browser |
# Start everythingcd shared-infra && docker compose up -d
# Stop and wipe all datadocker compose down -vReady? Start with Dev Environment & Tooling.