Python Course

Build production APIs with Python & FastAPI

A hands-on backend path — modern Python, FastAPI's dependency injection system, REST APIs, SQLAlchemy, authentication, testing and async concurrency — then into the territory that separates "I built a CRUD API" from "I can run this in production": gRPC, distributed sagas, GraphQL, data pipelines, and profiling the GIL. It ends with a two-week capstone service you architect, secure, test and deploy yourself.

26 Weeks Beginner → Job-Ready Self-Paced Python 3.12 & FastAPI
26
Weeks of study
22
Core modules
2
Capstone weeks
0→1
No prior Python needed
Before You Start

Prerequisites & tooling

What you should already know

  • Basic programming in any language — variables, functions, loops
  • Comfortable with the command line and Git
  • No prior Python or web framework experience required
  • Python 3.12 and a code editor like VS Code installed

Stack you'll work with

The same tools teams use to ship real Python services in production.

Python 3.12 FastAPI Pydantic SQLAlchemy & Alembic PostgreSQL pytest Docker Redis Poetry gRPC Strawberry GraphQL Apache Airflow
Syllabus

Your 26-week learning path

Twenty-two modules, from your first typed function through gRPC, sagas, GraphQL and data pipelines, to a two-week capstone service you deploy in a container.

01
WEEK 1

Python Foundations & Environment Setup

Refresh modern Python and get your backend toolchain running.

  • Type hints, dataclasses & the match statement
  • Python 3.12, virtual environments & Poetry
  • Running your first FastAPI application
Start this lesson
02
WEEK 2

FastAPI Core & Dependency Injection

Understand the system that powers every FastAPI application.

  • Path operations, path/query params & Pydantic models
  • Depends() & the dependency injection system
  • Auto-generated docs with Swagger UI & ReDoc
Start Week 2
03
WEEK 3

Building REST APIs

Design and build clean, well-validated HTTP APIs.

  • APIRouter, request/response models & status codes
  • Validation with Pydantic & custom validators
  • Centralized error handling with exception handlers
Start Week 3
04
WEEKS 4–5

Data Persistence with SQLAlchemy

Model your domain and talk to a real relational database.

  • Models, sessions & the SQLAlchemy 2.0 query API
  • Relationships, lazy loading & transactions
  • Schema migrations with Alembic
Start Week 4Start Week 5
05
WEEKS 6–7

Authentication & Security

Lock down your API with modern, stateless authentication.

  • Password hashing with passlib & OAuth2 password flow
  • JWT-based authentication & refresh tokens
  • Scoped permissions via dependency-based authorization
Start Week 6Start Week 7
06
WEEK 8

Testing FastAPI Applications

Build a layered test suite you can trust before every deploy.

  • Unit testing with pytest & fixtures
  • TestClient & dependency overrides
  • Real-database integration tests with Testcontainers
Start Week 8
07
WEEKS 9–10

Microservices & Messaging

Move from a single service to a small distributed system.

  • Service-to-service calls with httpx
  • Event-driven messaging with Celery & RabbitMQ
  • Resilience patterns: retries, timeouts & circuit breakers
Start Week 9Start Week 10
08
WEEK 11

Caching & Performance

Keep a growing service fast under real load.

  • Caching with Redis & cache invalidation strategies
  • Connection pooling & query performance
  • Background tasks with BackgroundTasks
Start Week 11
09
WEEK 12

Observability & Production Readiness

Understand what your service is doing once it's live.

  • Structured logging & health-check endpoints
  • Metrics with prometheus-client
  • Distributed tracing basics
Start Week 12
10
WEEK 13

Containerization & Deployment

Package and ship your service the way production teams do.

  • Multi-stage Docker images for a Python service
  • CI/CD pipelines for a FastAPI service
  • Deploying with Gunicorn + Uvicorn workers
Start Week 13
11
WEEK 14

Async Python & Concurrency

A deep dive into the async model FastAPI is built on.

  • asyncio: the event loop, coroutines & tasks
  • Async database drivers & when async def actually helps
  • When to reach for threads, processes, or Celery instead
Start Week 14
12
WEEK 15

Advanced SQLAlchemy — Complex Queries, N+1 & Migrations at Scale

Move past basic queries into the patterns real production repositories need.

  • Dynamic queries with the 2.0 select() API
  • selectinload/joinedload & solving N+1 for real
  • Bulk operations & zero-downtime Alembic migrations
Start Week 15
13
WEEK 16

API Design at Scale — Versioning, Pagination & OpenAPI

Design an API surface that can evolve without breaking every client.

  • API versioning strategies & deprecation headers
  • Cursor-based pagination, filtering & sorting conventions
  • Customizing FastAPI's OpenAPI docs & per-client rate limiting
Start Week 16
14
WEEK 17

gRPC & Protocol Buffers for Service-to-Service Calls

A faster, strongly-typed alternative to REST for internal service communication.

  • Defining a service contract with Protocol Buffers
  • Generating & implementing a Python gRPC server and client
  • Streaming RPCs & when gRPC beats REST between your own services
Start Week 17
15
WEEK 18

Distributed Transactions & the Saga Pattern

Keep data consistent across services without a distributed database transaction.

  • Why two-phase commit doesn't fit microservices
  • Choreography-based sagas with Celery & compensating actions
  • The transactional outbox pattern for reliable event publishing
Start Week 18
16
WEEK 19

Advanced Auth — OAuth2 Provider, API Keys & Multi-Tenancy

Go from consuming OAuth2 to issuing your own tokens, and isolating tenants correctly.

  • Building your own OAuth2 authorization server with authlib
  • API keys & service-to-service client-credentials auth
  • Multi-tenant data isolation strategies
Start Week 19
17
WEEK 20

Data Pipelines & Batch Processing with Airflow

Process large volumes of data reliably, on a schedule, outside the request/response cycle.

  • DAGs, tasks & the Airflow scheduler model
  • Building a real Extract-Transform-Load pipeline
  • Retries, backfills & monitoring a production DAG
Start Week 20
18
WEEK 21

GraphQL with Strawberry

Give clients a query language instead of a fixed set of REST shapes.

  • Code-first schema design with Strawberry & type hints
  • Query & mutation resolvers over your existing SQLAlchemy models
  • Solving GraphQL's own N+1 problem with DataLoader
Start Week 21
19
WEEK 22

Contract Testing & Advanced Test Strategy

Test the boundary between services, not just the code inside one.

  • Consumer-driven contract testing with Pact
  • Mutation testing with mutmut to check what your tests actually catch
  • Testing resilience under deliberate fault injection
Start Week 22
20
WEEK 23

Python Performance — Profiling, the GIL & Free-Threaded Python

Understand what CPython is actually doing when your service gets slow.

  • Profiling with cProfile & py-spy against a live process
  • What the GIL actually serializes, and what it doesn't
  • Free-threaded Python 3.13 & when it's worth the risk
Start Week 23
21
WEEK 24

CI/CD & Progressive Delivery for FastAPI

Take deployment from "push and hope" to a pipeline with a real safety net.

  • Multi-stage pipelines: test, build, scan, deploy
  • Blue-green & canary deploys for a FastAPI service
  • Feature flags for decoupling deploy from release
Start Week 24
22
WEEKS 25–26 · CAPSTONE

Capstone: Ship a Production FastAPI Service

Apply every module in one project — built, tested, secured and deployed by you.

  • Fully tested, secured, containerized service
  • A real CI/CD pipeline with a progressive rollout
  • Portfolio-ready project you can show employers
Start the capstone

Ready to build with Python?

Start with Week 1 and work through a real backend engineering path — or browse the Spring Boot and DevOps & Cloud courses if you're building out a full backend or infrastructure skill set.