AI Instructor Live Labs Included

Python Web Development with FastAPI

Build modern, type-safe web APIs with FastAPI, Pydantic validation, SQLAlchemy databases, and JWT authentication.

Intermediate
12h 40m
14 Lessons
PY-500
Python Web Development with FastAPI Badge

View badge details

About This Course

Build production-ready web APIs with Python's fastest framework. This course teaches FastAPI routing, request validation with Pydantic models, database integration with SQLAlchemy, full CRUD operations with proper error handling, and authentication with JWT tokens and middleware. You'll incrementally build a package tracking API for a logistics company, adding a new layer each lesson. The capstone produces a complete API with models, database, auth, logging, and auto-generated documentation. Requires Python fundamentals including classes, modules, and JSON. Course 5 of 6 in the Python Learning Path.

Course Curriculum

14 Lessons
01
AI Lesson
AI Lesson

FastAPI Basics Routes and Responses

30m
02
Lab Exercise
Lab Exercise

FastAPI Basics - Lab Exercises

1h 15m 1 Exercises

What FastAPI is (ASGI, auto-docs, type hints), first endpoint with @app.get, HTTP methods (GET/POST/PUT/DELETE), response models with Pydantic, auto-docs at /docs (Swagger UI) and /redoc

FastAPI Basics: Routes and Responses FastAPI Basics: Routes and Responses ~30 min
03
AI Lesson
AI Lesson

Request Validation with Pydantic

35m
04
Lab Exercise
Lab Exercise

Pydantic Validation - Lab Exercises

1h 15m 1 Exercises

Pydantic BaseModel for request bodies, field validation (min_length/max_length/ge/le/regex), custom validators (@field_validator/@model_validator), separate input/output models, validation error formatting

Request Validation with Pydantic Request Validation with Pydantic ~30 min
05
AI Lesson
AI Lesson

Path Parameters Query Params and Headers

30m
06
Lab Exercise
Lab Exercise

Parameters and Headers - Lab Exercises

1h 15m 1 Exercises

Path parameters with type coercion, query parameters with defaults and Optional, Header() dependency, Depends() basics for shared validation, pagination pattern (skip/limit with total count)

Path Parameters, Query Params and Headers in FastAPI Path Parameters, Query Params and Headers in FastAPI ~30 min
07
AI Lesson
AI Lesson

Database Integration with SQLAlchemy

40m
08
Lab Exercise
Lab Exercise

Database Integration - Lab Exercises

1h 15m 1 Exercises

SQLAlchemy ORM (engine/session/declarative base), table models with Column types, session management with yield dependency, CRUD functions (add/query/commit/delete), SQLite for development

Database Integration with SQLAlchemy in FastAPI Applications Database Integration with SQLAlchemy in FastAPI Applications ~30 min
09
AI Lesson
AI Lesson

CRUD Operations and Error Handling

35m
10
Lab Exercise
Lab Exercise

CRUD Operations - Lab Exercises

1h 15m 1 Exercises

Full CRUD (create/read single+list/update PUT+PATCH/delete), HTTP status codes (201/204/404/409), HTTPException, custom exception handlers, partial updates with exclude_unset

FastAPI CRUD Operations with Error Handling FastAPI CRUD Operations with Error Handling ~30 min
11
AI Lesson
AI Lesson

Authentication and Middleware

35m
12
Lab Exercise
Lab Exercise

Authentication - Lab Exercises

1h 15m 1 Exercises

API key auth with headers and Depends, OAuth2 password flow with OAuth2PasswordBearer, JWT tokens (structure/creation/verification), middleware for request logging and CORS, role-based access

Authentication and Middleware in FastAPI Authentication and Middleware in FastAPI ~30 min
13
AI Lesson
AI Lesson

Capstone Briefing Package Tracking API

30m
14
Lab Exercise
Lab Exercise

Capstone Package Tracking API

1h 15m 1 Exercises

Capstone building complete SwiftRoute API: Pydantic models for Shipment/Customer/TrackingEvent, SQLAlchemy with relationships, full CRUD with pagination, JWT auth, request logging middleware, structured error responses

Exercise 1 Exercise 1 ~30 min

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 7 Hands-on Lessons
  • 6 Months Access
  • Completion Badge
  • Certificate of Completion
Python Web Development with FastAPI Badge

Earn Your Badge

Complete all lessons to unlock the Python Web Development with FastAPI achievement badge.

Category
Skill Level Intermediate
Total Duration 12h 40m
Python Web Development with FastAPI Badge
Achievement Badge

Python Web Development with FastAPI

Demonstrates proficiency in building web APIs with FastAPI, Pydantic, SQLAlchemy, and JWT authentication.

Course Python Web Development with FastAPI

Skills You'll Earn

Python FastAPI Pydantic SQLAlchemy REST APIs JWT Auth

Complete all lessons in this course to earn this badge