Modern APIs with FastAPI and Python Course

3h 53m 18s
English
Paid

Course description

FastAPI is one of the most exciting new web frameworks out today. It's exciting because it leverages more of the modern Python language features than any other framework: type hints, async and await, dataclasses, and much more. If you are building an API in Python, you have many choices. But, to us, FastAPI is the clear choice going forward. And this course will teach you everything you need to know to get started. We'll build a realistic API working with live data and deploy that API to a cloud server Linux VM. In fact, you'll even see how to create proper HTML web pages to augment your API all within FastAPI.

Read more about the course

What's this course about and how is it different?

This course is designed to get you creating new APIs running in the cloud with FastAPIs quickly. We start off with just a little foundational concepts, then jump right into build our first API with FastAPI.

Then we explore the foundational modern Python features to make sure you're ready to take full advantage of this framework. We'll look at how async and await works in Python, how to build self-validating and describing classes with Pydantic, Python 3's type hints, and other core language concepts.

We round out the course by building a realistic API working with live data. Then we deploy that API using nginx + gunicorn + uvicorn running on Ubuntu in a cloud VM at Digital Ocean.

In this course, you will:

  • See how simple working with basic APIs in FastAPI can be.
  • Create API methods that handle common HTTP verbs (GET, POST, DELETE, etc)
  • Return JSON data to API clients
  • Use async and await to create truly scalable applications
  • Leverage Pydantic to create required and optional data exchange
  • Have FastAPI automatically validate and convert data types (e.g. "2021-01-05" to a datetime)
  • Organize your app using APIRoutes to properly factor your application across Python files.
  • Return the most appropriate error response (e.g. 400 Bad Request) to API clients
  • To deploy Python web applications in production-ready configurations on Linux
  • Understand why gunicorn and uvicorn should be used together in production
  • And lots more

Watch Online

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 84 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing

Watch Online Modern APIs with FastAPI and Python Course

0:00
/
#1: Welcome to Modern APIs with FastAPI

All Course Lessons (84)

#Lesson TitleDurationAccess
1
Welcome to Modern APIs with FastAPI Demo
01:03
2
Why FastAPI?
03:25
3
Modern Python and APIs
02:05
4
Fastapi vs. x
03:14
5
The big ideas covered in the course
02:30
6
Student prerequisites
00:49
7
Your instructor: Michael Kennedy
00:39
8
Get the full story on FastAPI
00:43
9
Python version
02:18
10
Recommended editor
01:41
11
Git the source code
00:53
12
Introducing our first API
00:50
13
Project setup
03:49
14
The most basic API
05:17
15
Concept: A minimal API endpoint
00:46
16
Know your HTTP verbs
03:09
17
Know your HTTP status codes
02:15
18
Passing data to the API
03:00
19
Concept: Passing data to the API
01:12
20
Responding to requests
05:34
21
Using specialized responses
01:29
22
Concept: Returning errors
01:23
23
A home page, of sorts
02:21
24
Modern language features
03:06
25
Type hints motivation
03:35
26
Adding type hints
02:41
27
Concept: Type hints
01:17
28
Non-async web scraper
02:30
29
Async web scraper
04:08
30
Concept: An async method
02:26
31
WSGI and ASGI servers
05:06
32
Model validation, the hard way
06:20
33
Model validation, the Pydantic way
04:59
34
Concept: Pydantic models
00:41
35
Introducing our main API
02:08
36
Creating the weather project
02:36
37
Rendering HTML templates
06:40
38
Concept: Rendering HTML templates
01:17
39
Static files
02:44
40
Partitioning with routers
07:53
41
Concept: Partitioning with routers
01:21
42
Weather API signature
03:30
43
Pydantic models
03:27
44
Open Weather data info
03:29
45
Setting the API key (keeping secrets safe)
04:39
46
Calling open weather map synchronously
04:05
47
Making an async API method
03:31
48
Concept: Async API methods
01:13
49
Faster with caching data
05:59
50
Concept: Caching data
01:13
51
Error responses
05:09
52
Concept: Converting errors to responses
02:14
53
Inbound data introduction
01:13
54
Weather report data layer
07:44
55
Viewing all reports via the API
03:21
56
Adding a weather report via the API
03:41
57
Calling the POST method with RESTful tools
02:20
58
Playing nice with status codes
01:32
59
Concept: Submitted a weather report
01:35
60
Building a report client app
05:52
61
Showing recent events on the home page
04:23
62
Automatic documentation with FastAPI and Swagger/OpenAPI
04:36
63
Deployment introduction
00:47
64
Surveying some hosting options
05:50
65
Create a cloud server
03:51
66
Connecting to and patching our server
02:04
67
Server topology with Gunicorn
03:18
68
Adding ohmyzsh
01:11
69
Preparing to run FastAPI on Ubuntu
03:37
70
Getting the source code from GitHub
04:16
71
venv forever
01:13
72
Gunicorn as Systemd unit
04:13
73
Installing and running nginx
03:30
74
Adding SSL for HTTPS on our API
02:05
75
You've made it
00:27
76
Review: A minimal API endpoint
00:55
77
Review: Type hints
01:21
78
Review: Pydantic objects
01:33
79
Review: async view methods
00:54
80
Review: Rendering templates
01:02
81
Review: Status codes and responses
01:18
82
Review: Modifying data through the API
01:30
83
Review: Deployment
01:19
84
Thanks and goodbye
00:25

Unlock unlimited learning

Get instant access to all 83 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Comments

0 comments

Want to join the conversation?

Sign in to comment

Similar courses

Distributed Tasks Demystified with Celery, SQS & Python

Distributed Tasks Demystified with Celery, SQS & Python

Sources: udemy
This course teaches beginners to industry professionals the fundamental concepts of Distributed Programming in the context of python & Django. We look at how t
4 hours 27 minutes 50 seconds
Data Analysis with Pandas and Python

Data Analysis with Pandas and Python

Sources: udemy
Welcome to the most comprehensive Pandas course available on Udemy! An excellent choice for both beginners and experts looking to expand their knowledge on one of the most popul...
19 hours 5 minutes 40 seconds
Conduct a Choice-Based Conjoint Analysis for Netflix with Python

Conduct a Choice-Based Conjoint Analysis for Netflix with Python

Sources: zerotomastery.io
Learn to use Choice-Based Conjoint Analysis to assist Netflix's growth. This project-based course explores consumer preferences using data analysis and Python.
1 hour 39 minutes 35 seconds
Python for Business Data Analytics & Intelligence

Python for Business Data Analytics & Intelligence

Sources: zerotomastery.io
Become a top Business Data Analyst. We’ll teach you everything you need to go from a complete beginner to getting hired as an analytics professional. You’ll lea
15 hours 25 minutes 6 seconds
#100DaysOfCode with Python course

#100DaysOfCode with Python course

Sources: Talkpython
#100DaysOfCode in Python is your perfect companion to take the 100 days of code challenge and be successful. This course is 1-part video lesson, 2-parts guided projects. You wil...
17 hours 27 minutes 49 seconds