相關主題
商品描述
Build APIs and web apps based on Asynchronous Server Gateway Interface (ASGI). This book provides a comprehensive explanation of using Pydantic models to construct the request/response objects in a FASTAPI path operation.
You'll start by reviewing type hints in Python and the asynchronous processing concepts. One of the highlights of FastAPI is its auto generation of API docs. Pydantic library is the main pillar on top of which FastAPI is built. You'll see that ASGI has a far better performance compared to most of the other popular Python frameworks as they implement Web server Gateway Interface (WSGI), which is synchronous in nature and hence having slower response time.
This book thoroughly explains how FastAPI interacts asynchronously with relational as well as NOSQL databases. Modern web apps use template engines to interact with the front-end. In this book, you will learn to use jinja2 templates and static assets. Swagger UI and OpenAPI standards are also covered in detail. Finally, different options of deployment of FastAPI app have been explored in this book.
This book uses practical examples to empower you to build high performance APIs
What You'll Learn
- Develop robust and high-performance web apps
- Deploy the FastAPI app for public availability using cloud services such as Deta and Docker container
- Understand the important building blocks of a web app such as form handling, templating and database interaction
Who This Book Is For
Aspiring and the experienced Python developers looking to leverage the flexibility of Python and the powerful features introduced in Modern Python. Computer science Engineering students at graduate and postgraduate level will also benefit immensely from the practical approach adapted in the book.
商品描述(中文翻譯)
基於非同步伺服器網關介面(ASGI)建立API和網頁應用程式。本書詳細解釋了如何使用Pydantic模型在FASTAPI路徑操作中構建請求/響應對象。
您將首先回顧Python中的類型提示和非同步處理概念。FastAPI的一個亮點是自動生成API文檔。Pydantic庫是FastAPI的主要支柱。您將看到,與大多數其他流行的Python框架實現的同步Web服務器網關介面(WSGI)相比,ASGI具有更好的性能,因為它是非同步的,因此響應時間更快。
本書詳細解釋了FastAPI如何與關聯型和非關聯型數據庫進行非同步交互。現代網頁應用程式使用模板引擎與前端進行交互。在本書中,您將學習使用jinja2模板和靜態資源。還詳細介紹了Swagger UI和OpenAPI標準。最後,本書探討了FastAPI應用程式的不同部署選項。
本書通過實際示例使您能夠構建高性能的API。
您將學到什麼:
- 開發強大且高性能的網頁應用程式
- 使用雲服務(如Deta和Docker容器)將FastAPI應用程式部署為公開可用
- 了解網頁應用程式的重要構建塊,如表單處理、模板和數據庫交互
本書適合對Python有興趣且有經驗的開發人員,他們希望利用Python的靈活性和現代Python引入的強大功能。研究生和博士生的計算機科學工程學生也將從本書中的實踐方法中受益。
作者簡介
Malhar Lathkar is an independent developer, trainer, technical writer and author with over 30 years of experience. He holds a postgraduate degree in Electronics. After a brief stint as a degree college lecturer, he started his own software training and development institute. Over the years, he has gained proficiency in various programming technologies and imparted training to thousands of students and professionals from India and different countries around the world. Malhar also offers software training services to corporates. He has been associated with many EdTech companies as a freelance Subject Matter Expert. He has written a few books that have been published by well-known publishing houses.
作者簡介(中文翻譯)
Malhar Lathkar是一位獨立開發者、培訓師、技術作家和作者,擁有超過30年的經驗。他擁有電子學碩士學位。在短暫擔任大學講師後,他開辦了自己的軟體培訓和開發機構。多年來,他在各種程式設計技術上獲得了熟練的能力,並向來自印度和世界各地的數千名學生和專業人士提供培訓。Malhar還向企業提供軟體培訓服務。他曾與許多EdTech公司合作,擔任自由職業主題專家。他還撰寫了幾本由知名出版社出版的書籍。