The Future of FastAPI and Pydantic is Bright

Sebastián Ramírez
15 min readJun 19, 2021

This article lives in:

In very short

The future of FastAPI and Pydantic is bright. ✨

This is because we all, as the Python community, define their future. To help us and to help others. From the Core Developers making Python itself to the new developers that started learning Python this month.

And as long as these tools are helping us all solve problems, help ourselves, help others, and be more efficient and productive, we all will keep them working and improving.

And that’s what we are all doing. 🤓🚀


You might have heard not long ago about PEP 563, PEP 649, and some changes that could affect Pydantic and FastAPI in the future.

If you read about it, I wouldn’t expect you to understand what all that meant. I didn’t fully understand it until I spent hours reading all the related content and doing multiple experiments.

It might have worried you and maybe confuse you a bit.

Now there’s nothing to be worried about. But still, here I want to help clarify all that and give you a bit more context.

Brace yourself, you are about to learn a bit more about how Python works, how FastAPI and Pydantic work, how type annotations work, and more. 👇


Start with a basic FastAPI app

FastAPI is based on Pydantic. Let’s see a simple example using them both.

Imagine that we have a file ./ with the following code:

from typing import Optionalimport uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
class Item(BaseModel):
name: str
description: Optional[str] = None
price: float
app = FastAPI()"/items/")
def create_item(item: Item):
return item
if __name__ == "__main__":

You could run this example and start the API application with:

$ python ./main.pyINFO:     Started server process [4418]
INFO: Waiting for application startup.
Sebastián Ramírez

Creator of FastAPI and Typer. Dev at Exposion AI. APIs, Deep Learning/Machine Learning, full-stack distributed systems, SQL/NoSQL, Python, Docker, JS, TS, etc.