29,99 €
FastAPI is a cutting-edge Python framework that is revolutionizing the way web apps and APIs are built. Known for its speed, simplicity, and scalability, FastAPI empowers developers to create high-performing applications with ease. This book will help you leverage FastAPI’s immense potential to handle high-traffic scenarios and integrate seamlessly with modern Python tools.
The book begins by familiarizing you with the basics of setting up and configuring your FastAPI environment before moving to the intricacies of building RESTful APIs, managing data with SQL and NoSQL databases, and handling authentication and authorization. Next, you'll focus on advanced topics such as custom middleware, WebSocket communication, and integration with various Python libraries. Each chapter is meticulously crafted with practical recipes, progressing from foundational concepts to advanced features and best practices. The concluding chapters show you how to optimize performance, implement rate limiting, and execute background tasks, empowering you to become a proficient FastAPI developer.
By the end of this book, you'll have gained the skills you need to migrate existing apps to FastAPI, and be equipped to tackle any challenge in the modern web development landscape, ensuring your apps are not only functional, but also efficient, secure, and scalable.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 365
Veröffentlichungsjahr: 2024
FastAPI Cookbook
Develop high-performance APIs and web applications with Python
Giunio De Luca
Copyright © 2024 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
The author acknowledges the use of cutting-edge AI, such as ChatGPT, with the sole aim of enhancing the language and clarity within the book, thereby ensuring a smooth reading experience for readers. It’s important to note that the content itself has been crafted by the author and edited by a professional publishing team.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Kaustubh Manglurkar
Publishing Product Manager: Bhavya Rao
Book Project Manager: Arul Viveaun S
Senior Editor: Nathanya Dias
Technical Editor: Simran Ali
Copy Editor: Safis Editing
Indexer: Manju Arasan
Production Designer: Jyoti Kadam
DevRel Marketing Coordinators: Anamika Singh and Nivedita Pandey
First published: August 2024
Production reference: 1040724
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK
ISBN 978-1-80512-785-7
www.packtpub.com
To my dear nephew, Marco.
You bring endless joy to our lives. I wish you a future filled with love, growth, and happiness. May you always find success and fulfillment in everything you do.
– Giunio De Luca
Having worked alongside Giunio for over a year, I can confidently say that his expertise and passion for Python development are evident in every line of code he produces. I affirm this with no shadow of a doubt, as I am a developer with over 30 years of experience across several countries and prominent industries, including Microsoft, NATO, and IBM.
We naturally became friends due to our mutual respect and shared interests, both professional and personal. Giunio stood out in our team at Coreso, one of the European Regional Coordination Centers for high-voltage electricity flows. He has an impressive academic background coupled with extensive international experience. What truly sets him apart, however, is his deep and thorough understanding of Python and FastAPI. Giunio’s code is not only functional but also exceptionally clean and clear—a hallmark of a skilled developer, or in other words, a subject matter expert.
Beyond his technical prowess, Giunio possesses a quality that I find equally important: an open mind. He readily embraces new challenges, tackling them with both enthusiasm and a solid foundation of knowledge, which he diligently builds and extends if he does not already possess it. I believe that he has brought these qualities to fruition in creating this book, pushing it beyond the scope of a typical cookbook. For instance, dealing with real-time communication and WebSockets is something rarely found in other cookbooks, and finding the right solution for your needs can consume a lot of valuable time searching online.
This book promises to be a valuable resource for anyone seeking to become proficient in the use of FastAPI. Despite the excellent work the creators do with the product documentation, navigating it can easily lead to hours of frustration. Whether you’re a seasoned Python developer or just starting your journey, Giunio’s clear explanations and practical examples will guide you every step of the way.
So, let Giunio be your expert guide to the power and efficiency of FastAPI!
Antonio Ferraro
MSC Computer Science, Business Owner
Giunio De Luca is a software engineer with over 10 years of experience in fields such as physics, sports, and administration. He graduated in industrial engineering from the University of Basilicata and holds a PhD in numerical simulations from Paris-Saclay University. His work spans developing advanced algorithms, creating sports analytics applications, and improving administrative processes. As an independent consultant, he collaborates with research labs, government agencies, and start-ups across Europe. He also supports coding education in schools and universities through workshops, lectures, and mentorship programs, inspiring the next generation of software engineers with his expertise and dedication.
With heartfelt gratitude, I thank my family and my loved ones for their continuous encouragement. I am also thankful to all my employers who have believed in my expertise, and my current clients and colleagues who keep trusting my work and providing me with valuable opportunities for professional growth.
Adarsh Divakaran is an experienced backend developer with expertise in architecting, building, and deploying APIs, primarily using Python. He is the co-founder of Digievo Labs, a global technology firm. He loves reading all sorts of Python content and runs a newsletter, Python in the Wild, showcasing Python concepts and examples from open source projects. Adarsh also speaks at global Python conferences, including PyCascades, EuroPython, and FlaskCon.