Course Code: drapf
Duration: 14 hours
Overview:

FastAPI is an open source, high-performance web framework for building APIs with Python. This training assumes that delegates already are experienced with Python, but are looking to have a quick and fast-based introduction to FastAPI. Part of this training will be developing a project that will either run the entire second day or half of the second day based on the delegates’ feedback.

Course Outline:

Introduction

  • FastAPI vs Django vs Flask
  • Overview of FastAPI features and advantages

Getting Started

  • Best practices for Python development
  • Installing FastAPI
  • Defining a schema using OpenAPI

Overview of the FastAPI library

  • Path and Query Parameters
  1. Declaring path parameter types
  2. Parsing and validating data
  3. Declaring required and optional parameters
  4. Converting query parameter types
  5. Multiple path and query parameters
  • Declaring a Request Body with Pydantic Models
  1. Creating a data model
  2. Combining path, query, and body parameters
  3. Declaring validations and metadata
  4. Using deeply nested models
  5. Defining example data
  6. Response and extra models
  • Handling Errors
  1. Using HTTPException
  2. Adding custom headers
  3. Installing custom exception handlers
  4. Overriding default exception handlers
  • Working with Databases
  1. ORMs and file structure
  2. Creating SQLAlchemy parts
  3. Creating database models
  4. Creating Pydantic models
  5. Performing CRUD operations
  6. Creating tables, dependency, and path operations
  7. Using multiple databases 
  • Security and Authentication
  1. Using basic auth and JWT tokens
  • Running background tasks
  • Deployments
  1. Deployment concepts, stages, and tools
  2. Working with Gunicorn and Uvicorn

Working on a FastAPI-based app 

  • designing and developing a simple FastAPI-based application from the scratch,
  • inputs from the training delegates welcome prior the training as this might impact choice of the app being developed!