For faster navigation, this Iframe is preloading the Wikiwand page for FastAPI.

FastAPI

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article contains content that is written like an advertisement. Please help improve it by removing promotional content and inappropriate external links, and by adding encyclopedic content written from a neutral point of view. (February 2022) (Learn how and when to remove this message) This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources. Find sources: "FastAPI" – news · newspapers · books · scholar · JSTOR (February 2022) (Learn how and when to remove this message) (Learn how and when to remove this message)
FastAPI
Developer(s)Sebastián Ramírez
Initial releaseDecember 5, 2018; 5 years ago (2018-12-05)[1]
Stable release
0.111.0[2] Edit this on Wikidata / 3 May 2024; 2 months ago (3 May 2024)
Repositorygithub.com/tiangolo/fastapi
Written inPython
TypeWeb framework
LicenseMIT
Websitefastapi.tiangolo.com

FastAPI is a modern web framework first released in 2018 for building RESTful APIs in Python.[3] It is used for building APIs with Python 3.8+ based on standard Python-type hints.

FastAPI is based on Pydantic and uses type hints to validate, serialize and deserialize data. It also automatically generates OpenAPI documentation for APIs built with it.[4]

Components

Pydantic

Pydantic is a data validation library for Python. While writing code in an IDE, Pydantic provides type hints for schema validation and serialization through type annotations.[5]

Starlette

Starlette is a lightweight ASGI framework/toolkit, to support async functionality in Python.[6]

Uvicorn

Uvicorn is a minimal low-level server/application web server for async frameworks, following the ASGI specification. Technically, it implements a multi-process model with one main process, which is responsible for managing a pool of worker processes and distributing incoming HTTP requests to them. The number of worker processes is pre-configured, but can also be adjusted up or down at runtime.[7]

Example

The following code shows a simple web application that displays "Hello World!" when visited:

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def read_root():
    return "Hello World!"

See also

References

  1. ^ "fastapi repo". GitHub. 2018-12-05.
  2. ^ "Release 0.111.0". 3 May 2024. Retrieved 23 May 2024.
  3. ^ "FastAPI". fastapi.tiangolo.com. Retrieved 2024-04-10.
  4. ^ Lubanovic, Bill (2019-11-06). Introducing Python: Modern Computing in Simple Packages (2nd ed.). O'Reilly Media, Inc. pp. 397, 418. ISBN 9781492051367.
  5. ^ "Why use Pydantic - Pydantic". docs.pydantic.dev. Retrieved 2023-09-21.
  6. ^ "Starlette". www.starlette.io. Retrieved 2023-09-21.
  7. ^ "Restarting `uvicorn` Workers with the `SIGHUP` Signal". bugfactory.io. Retrieved 2024-06-17.
{{bottomLinkPreText}} {{bottomLinkText}}
FastAPI
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?