Book description
FastAPI is a young yet solid framework that takes advantage of newer Python features in a clean design. As its name implies, FastAPI is indeed fast, rivaling similar frameworks in languages such as Golang. With this practical book, developers familiar with Python will learn how FastAPI lets you accomplish more in less time with less code.
Author Bill Lubanovic covers the nuts and bolts of FastAPI development with how-to guides on various topics such as forms, database access, graphics, maps, and more that will take you beyond the basics. This book also includes how-to guides that will get you up to speed on RESTful APIs, data validation, authorization, and performance. With its similarities to frameworks like Flask and Django, you'll find it easy to get started with FastAPI.
Through the course of this book, you will:
- Learn how to build web applications with FastAPI
- Understand the differences between FastAPI, Starlette, and pydantic
- Learn two features that set FastAPI apart: asynchronous functions and data type checking and validation
- Examine new features of Python 3.8+, especially type annotations
- Understand the differences between sync and async Python
- Learn how to connect with external APIs and services
Publisher resources
Table of contents
- Preface
- I. What’s New?
- 1. The Modern Web
- 2. Modern Python
- II. A FastAPI Tour
- 3. FastAPI Tour
- 4. Async, Concurrency, and Starlette Tour
- 5. Pydantic, Type Hints, and Models Tour
- 6. Dependencies
- 7. Framework Comparisons
- III. Making a Website
-
8. Web Layer
- Preview
- Interlude: Top-Down, Bottom-Up, Middle-Out?
- RESTful API Design
- File and Directory Site Layout
- The First Website Code
- Requests
- Multiple Routers
- Build the Web Layer
- Define Data Models
- Stub and Fake Data
- Create Common Functions Through the Stack
- Create Fake Data
- Test!
- Using the FastAPI Automated Test Forms
- Talking to the Service and Data Layers
- Pagination and Sorting
- Review
- 9. Service Layer
- 10. Data Layer
- 11. Authentication and Authorization
- 12. Testing
- 13. Production
- IV. A Gallery
- 14. Databases, Data Science, and a Little AI
- 15. Files
- 16. Forms and Templates
- 17. Data Discovery and Visualization
- 18. Games
- A. Further Reading
- B. Creatures and Humans
- Index
- About the Author
Product information
- Title: FastAPI
- Author(s):
- Release date: November 2023
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781098135508
You might also like
book
Practical MLOps
Getting your models into production is the fundamental challenge of machine learning. MLOps offers a set …
book
Building Micro-Frontends
What's the answer to today's increasingly complex web applications? Micro-frontends. Inspired by the microservices model, this …
book
Learning Go
Go is rapidly becoming the preferred language for building web services. While there are plenty of …
book
Grokking Algorithms
Grokking Algorithms is a fully illustrated, friendly guide that teaches you how to apply common algorithms …