Python Web APIs with FastAPI Training
Build production-grade REST APIs with this intensive 3-day FastAPI training. Learn to design clean API architectures, validate data with Pydantic, handle requests asynchronously, and ship APIs with automatic OpenAPI documentation and comprehensive test coverage.
Training Details
Section titled “Training Details”| Duration | 3 days (24 hours) |
| Level | Intermediate |
| Delivery | In-person, Live online, Hybrid |
| Certification | N/A |
Who Is This For?
Section titled “Who Is This For?”- Python developers building web APIs
- Backend engineers transitioning from Flask or Django
- Full-stack developers needing API backends
- Teams adopting FastAPI for new projects
- Architects evaluating modern Python web frameworks
Learning Outcomes
Section titled “Learning Outcomes”After completing this training, participants will be able to:
- Design and implement RESTful APIs with FastAPI routing and path operations
- Validate request and response data with Pydantic models and schemas
- Build async endpoints for high-throughput API services
- Implement authentication and authorization with OAuth2 and JWT
- Generate and customize OpenAPI documentation automatically
- Test APIs thoroughly with pytest and httpx
Detailed Agenda
Section titled “Detailed Agenda”Day 1: FastAPI Foundations
Section titled “Day 1: FastAPI Foundations”Module 1: FastAPI Setup and Routing
- Project structure and application factory pattern
- Path operations: GET, POST, PUT, DELETE, PATCH
- Path parameters, query parameters, and request bodies
- Hands-on: Build a CRUD API for a resource management system
Module 2: Pydantic Models and Validation
- Defining request and response models
- Field validation, custom validators, and computed fields
- Nested models and model inheritance
- Hands-on: Implement comprehensive input validation for a booking API
Module 3: Dependency Injection
- FastAPI’s dependency injection system
- Function and class dependencies
- Dependency chains and shared state
- Hands-on: Build a layered service architecture with DI
Day 2: Database Integration and Auth
Section titled “Day 2: Database Integration and Auth”Module 4: Database Integration
- SQLAlchemy ORM with async sessions
- Database models, migrations with Alembic
- Repository pattern for data access
- Hands-on: Connect the API to PostgreSQL with full CRUD operations
Module 5: Authentication and Security
- OAuth2 password flow with JWT tokens
- Token refresh and revocation
- Role-based access control and permissions
- Hands-on: Secure API endpoints with authentication and authorization
Module 6: Middleware and Error Handling
- Custom middleware for logging and CORS
- Exception handlers and error response models
- Rate limiting and request throttling
- Hands-on: Add production middleware stack to the API
Day 3: Production Readiness
Section titled “Day 3: Production Readiness”Module 7: Async Patterns
- Async vs sync endpoints and when to use each
- Background tasks and task queues
- Streaming responses and WebSocket support
- Hands-on: Build async endpoints with background processing
Module 8: Testing and Documentation
- Testing with pytest and httpx TestClient
- Test fixtures, factories, and database isolation
- OpenAPI schema customization and documentation
- Hands-on: Achieve full test coverage for the API
Module 9: Deployment and Operations
- Running with Uvicorn and Gunicorn
- Docker containerization for FastAPI apps
- Health checks, structured logging, and monitoring
- Hands-on: Package and deploy the API with Docker Compose
Prerequisites
Section titled “Prerequisites”- Python Fundamentals or equivalent programming experience
- Comfort with functions, classes, and decorators
- Basic understanding of HTTP methods and REST concepts
- Familiarity with JSON data format
Delivery Formats
Section titled “Delivery Formats”| Format | Description |
|---|---|
| In-Person | On-site at your company’s location, hands-on with direct interaction |
| Live Online | Interactive virtual sessions with screen sharing and real-time labs |
| Hybrid | Combination of on-site and remote sessions, flexible scheduling |
All formats include hands-on labs, course materials, starter project templates, and post-training support.