Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Components  



1.1  Pydantic  





1.2  Starlette  





1.3  Uvicorn  







2 Example  





3 See also  





4 External links  





5 References  














FastAPI






Беларуская
Русский
Shqip
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


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; 54 days 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 APIsinPython.[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[edit]

Pydantic[edit]

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[edit]

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

Uvicorn[edit]

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[edit]

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[edit]

External links[edit]

References[edit]

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

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=FastAPI&oldid=1231150193"

    Categories: 
    2018 software
    Python (programming language) web frameworks
    Software using the MIT license
    Web frameworks
    Web software stubs
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
    Articles with a promotional tone from February 2022
    All articles with a promotional tone
    Articles lacking reliable references from February 2022
    All articles lacking reliable references
    Articles with multiple maintenance issues
    All stub articles
     



    This page was last edited on 26 June 2024, at 19:21 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki