Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building Data Science Applications with FastAPI - Second Edition

You're reading from  Building Data Science Applications with FastAPI - Second Edition

Product type Book
Published in Jul 2023
Publisher Packt
ISBN-13 9781837632749
Pages 422 pages
Edition 2nd Edition
Languages
Author (1):
François Voron François Voron
Profile icon François Voron

Table of Contents (21) Chapters

Preface Part 1: Introduction to Python and FastAPI
Chapter 1: Python Development Environment Setup Chapter 2: Python Programming Specificities Chapter 3: Developing a RESTful API with FastAPI Chapter 4: Managing Pydantic Data Models in FastAPI Chapter 5: Dependency Injection in FastAPI Part 2: Building and Deploying a Complete Web Backend with FastAPI
Chapter 6: Databases and Asynchronous ORMs Chapter 7: Managing Authentication and Security in FastAPI Chapter 8: Defining WebSockets for Two-Way Interactive Communication in FastAPI Chapter 9: Testing an API Asynchronously with pytest and HTTPX Chapter 10: Deploying a FastAPI Project Part 3: Building Resilient and Distributed Data Science Systems with FastAPI
Chapter 11: Introduction to Data Science in Python Chapter 12: Creating an Efficient Prediction API Endpoint with FastAPI Chapter 13: Implementing a Real-Time Object Detection System Using WebSockets with FastAPI Chapter 14: Creating a Distributed Text-to-Image AI System Using the Stable Diffusion Model Chapter 15: Monitoring the Health and Performance of a Data Science System Index Other Books You May Enjoy

Summary

Well done! You should now be comfortable with one of the most iconic features of FastAPI: dependency injection. By implementing your own dependencies, you’ll be able to keep common logic that you wish to reuse across your API separate from the endpoints’ logic. This will make your project clean and maintainable while retaining maximum readability; dependencies just need to be declared as arguments of the path operation functions, which will help you to understand the intent without having to read the body of the function.

Those dependencies can be both simple wrappers to retrieve and validate request parameters, or complex services performing machine learning tasks. Thanks to the class-based approach, you can indeed set dynamic parameters or keep a local state for your most advanced tasks.

Finally, those dependencies can also be used at a router or global level, allowing you to perform common logic or checks for a set of routes or a whole application.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}