最終更新:2025-05-02 (金) 15:40:39 (62d)
FastAPI
Top / FastAPI
Pythonの標準である型ヒントに基づいてPython 3.6以降でAPI を構築するための、モダンで、高速(高パフォーマンス)な、Web フレームワークです
https://fastapi.tiangolo.com/ja/
https://github.com/tiangolo/fastapi
pip
pip install fastapi
- コア機能のみをインストール
pip install "fastapi[standard]"
- pip/パッケージ/Extras
- 推奨される周辺ツール群もインストール
本番用サーバ (ASGI対応サーバ)
コマンド
例
- @app.get
from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: str = None): return {"item_id": item_id, "q": q}