Technical requirements
To embark on your journey with FastAPI, you’ll need to set up an environment that supports Python development and FastAPI’s functionalities. Here’s a list of the technical requirements and installations needed for this chapter:
- Python: FastAPI is built on Python, so you’ll need a Python version compatible with your FastAPI version. You can download the latest version of it from python.org.
- FastAPI: Install FastAPI using
pip
, Python’s package manager. You can do it by runningpip install fastapi
from the command terminal. - Uvicorn: FastAPI requires an Asynchronous Server Gateway Interface (ASGI) server, and Uvicorn is a lightning-fast ASGI server implementation. Install it using
pip
install uvicorn
. - Integrated development environment (IDE): An IDE such as Visual Studio Code (VS Code), PyCharm, or any other IDE that supports Python development will be necessary for writing and testing your code.
- Postman or Swagger UI: For testing API endpoints. FastAPI automatically generates and hosts Swagger UI, so you can use it right out of the box.
- Git: Version control is essential, and Git is a widely used system. If not already installed, you can get it from git-scm.com.
- GitHub account: A GitHub account is required to access the code repositories. Sign up at github.com if you haven’t already.
The code used in the chapter is available on GitHub at the following address: https://github.com/PacktPublishing/FastAPI-Cookbook/tree/main/Chapter01. You can clone or download the repository at https://github.com/PacktPublishing/FastAPI-Cookbook to follow along on your local machine.