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
- Declaring path parameter types
- Parsing and validating data
- Declaring required and optional parameters
- Converting query parameter types
- Multiple path and query parameters
- Declaring a Request Body with Pydantic Models
- Creating a data model
- Combining path, query, and body parameters
- Declaring validations and metadata
- Using deeply nested models
- Defining example data
- Response and extra models
- Handling Errors
- Using HTTPException
- Adding custom headers
- Installing custom exception handlers
- Overriding default exception handlers
- Working with Databases
- ORMs and file structure
- Creating SQLAlchemy parts
- Creating database models
- Creating Pydantic models
- Performing CRUD operations
- Creating tables, dependency, and path operations
- Using multiple databases
- Security and Authentication
- Using basic auth and JWT tokens
- Running background tasks
- Deployments
- Deployment concepts, stages, and tools
- 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!