What tools and libraries form the basis of FastAPI?
sobes.tech AI
Answer from AI
FastAPI is a modern web framework for Python that allows for the rapid development of high-performance APIs. It is built on several key tools and libraries:
-
Starlette — an asynchronous web framework and toolkit that provides routing, middleware, WebSocket, HTTP/2 support, and more. FastAPI uses Starlette to handle HTTP requests.
-
Pydantic — a library for data validation and settings management using Python type hints. FastAPI employs Pydantic for automatic validation and serialization of input and output data.
-
Uvicorn — an ASGI server often used to run FastAPI applications, providing asynchronous request handling.
FastAPI is based on OpenAPI and JSON Schema standards, which allows for automatic generation of documentation and client SDKs.
Thus, FastAPI combines Starlette for the web layer, Pydantic for validation and typing, and uses ASGI servers like Uvicorn to run applications.