1---2include_yaml:3 sponsors: data/sponsors.yml4---56# FastAPI { #fastapi }78<style>9.md-content .md-typeset h1 { display: none; }10</style>1112<p align="center">13 <a href="https://fastapi.tiangolo.com/ja"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI"></a>14</p>15<p align="center">16 <em>FastAPI フレームワーク、高パフォーマンス、学びやすい、素早くコーディングできる、本番運用に対応</em>17</p>18<p align="center">19<a href="https://github.com/fastapi/fastapi/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster">20 <img src="https://github.com/fastapi/fastapi/actions/workflows/test.yml/badge.svg?event=push&branch=master" alt="Test">21</a>22<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/fastapi">23 <img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/fastapi.svg" alt="Coverage">24</a>25<a href="https://pypi.org/project/fastapi">26 <img src="https://img.shields.io/pypi/v/fastapi?color=%2334D058&label=pypi%20package" alt="Package version">27</a>28<a href="https://pypi.org/project/fastapi">29 <img src="https://img.shields.io/pypi/pyversions/fastapi.svg?color=%2334D058" alt="Supported Python versions">30</a>31</p>3233---3435**ドキュメント**: [https://fastapi.tiangolo.com/ja](https://fastapi.tiangolo.com/ja)3637**ソースコード**: [https://github.com/fastapi/fastapi](https://github.com/fastapi/fastapi)3839---4041FastAPI は、Python の標準である型ヒントに基づいて Python で API を構築するための、モダンで、高速(高パフォーマンス)な Web フレームワークです。4243主な特徴:4445* **高速**: **NodeJS** や **Go** 並みのとても高いパフォーマンス(Starlette と Pydantic のおかげです)。 [利用可能な最も高速な Python フレームワークの一つです](#performance)。46* **高速なコーディング**: 開発速度を約 200%〜300% 向上させます。*47* **少ないバグ**: 開発者起因のヒューマンエラーを約 40% 削減します。*48* **直感的**: 素晴らしいエディタサポート。<dfn title="別名: auto-complete、autocompletion、IntelliSense">補完</dfn> があらゆる場所で使えます。デバッグ時間を削減します。49* **簡単**: 簡単に利用・習得できるようにデザインされています。ドキュメントを読む時間を削減します。50* **短い**: コードの重複を最小限にします。各パラメータ宣言から複数の機能を得られます。バグも減ります。51* **堅牢性**: 自動対話型ドキュメントにより、本番環境向けのコードが得られます。52* **Standards-based**: API のオープンスタンダードに基づいており(そして完全に互換性があります)、[OpenAPI](https://github.com/OAI/OpenAPI-Specification)(以前は Swagger として知られていました)や [JSON Schema](https://json-schema.org/) をサポートします。5354<small>* 本番アプリケーションを構築している社内開発チームのテストに基づく見積もりです。</small>5556## Sponsors { #sponsors }5758<!-- sponsors -->5960### Keystone Sponsor { #keystone-sponsor }6162<div class="fastapi-sponsors fastapi-sponsors--keystone">63{% for sponsor in sponsors.keystone -%}64<a class="fastapi-sponsors__card fastapi-sponsors__card--keystone" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}"></a>65{% endfor -%}66</div>6768### Gold Sponsors { #gold-sponsors }6970<div class="fastapi-sponsors fastapi-sponsors--gold">71{% for sponsor in sponsors.gold -%}72<a class="fastapi-sponsors__card fastapi-sponsors__card--gold" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>73{% endfor -%}74</div>7576### Silver Sponsors { #silver-sponsors }7778<div class="fastapi-sponsors fastapi-sponsors--silver">79{% for sponsor in sponsors.silver -%}80<a class="fastapi-sponsors__card fastapi-sponsors__card--silver" href="{{ sponsor.url }}" title="{{ sponsor.title }}"><img class="fastapi-sponsors__banner" src="{{ sponsor.img }}" alt="{{ sponsor.title }}" loading="lazy"></a>81{% endfor %}82</div>8384<!-- /sponsors -->8586[その他のスポンサー](https://fastapi.tiangolo.com/ja/fastapi-people/#sponsors)8788## 評価 { #opinions }8990<!-- only-mkdocs -->91<div class="fastapi-opinions" data-fastapi-opinions>92 <div class="fastapi-opinions__tabs" role="tablist" aria-label="Companies using FastAPI">93 <button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-microsoft" aria-controls="fo-panel-microsoft" aria-selected="true" tabindex="0">94 <span class="fastapi-opinions__mark"><img src="/img/logos/microsoft.svg" alt="Microsoft" loading="lazy"></span>95 </button>96 <button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-uber" aria-controls="fo-panel-uber" aria-selected="false" tabindex="-1">97 <span class="fastapi-opinions__mark"><img src="/img/logos/uber.svg" alt="Uber" loading="lazy"></span>98 </button>99 <button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-netflix" aria-controls="fo-panel-netflix" aria-selected="false" tabindex="-1">100 <span class="fastapi-opinions__mark"><img src="/img/logos/netflix.svg" alt="Netflix" loading="lazy"></span>101 </button>102 <button class="fastapi-opinions__tab" role="tab" type="button" id="fo-tab-cisco" aria-controls="fo-panel-cisco" aria-selected="false" tabindex="-1">103 <span class="fastapi-opinions__mark"><img src="/img/logos/cisco.svg" alt="Cisco" loading="lazy"></span>104 </button>105 </div>106107 <div class="fastapi-opinions__panel" id="fo-panel-microsoft" role="tabpanel" aria-labelledby="fo-tab-microsoft" tabindex="0">108 <blockquote class="fastapi-opinions__quote">「最近は **FastAPI** をたくさん使っています。実際、私のチームの **Microsoft の ML サービス** 全てで使用する予定です。そのいくつかはコアな **Windows** 製品や **Office** 製品に統合されつつあります。」</blockquote>109 <div class="fastapi-opinions__attr">— Kabir Khan, <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26">(ref)</a></div>110 </div>111 <div class="fastapi-opinions__panel" id="fo-panel-uber" role="tabpanel" aria-labelledby="fo-tab-uber" tabindex="0" hidden>112 <blockquote class="fastapi-opinions__quote">「**FastAPI** ライブラリを採用し、クエリで **予測値** を取得できる **REST** サーバを構築しました。」<em>[for Ludwig]</em></blockquote>113 <div class="fastapi-opinions__attr">— Piero Molino, Yaroslav Dudin, Sai Sumanth Miryala, <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/">(ref)</a></div>114 </div>115 <div class="fastapi-opinions__panel" id="fo-panel-netflix" role="tabpanel" aria-labelledby="fo-tab-netflix" tabindex="0" hidden>116 <blockquote class="fastapi-opinions__quote">「<strong>Netflix</strong> は、私たちの <strong>危機管理</strong> オーケストレーションフレームワーク、<strong>Dispatch</strong> のオープンソースリリースを発表できることをうれしく思います!」<em>[built with FastAPI]</em></blockquote>117 <div class="fastapi-opinions__attr">— Kevin Glisson, Marc Vilanova, Forest Monsen, <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072">(ref)</a></div>118 </div>119 <div class="fastapi-opinions__panel" id="fo-panel-cisco" role="tabpanel" aria-labelledby="fo-tab-cisco" tabindex="0" hidden>120 <blockquote class="fastapi-opinions__quote">「本番の Python API を構築したい方には、**FastAPI** を強くおすすめします。**美しく設計**され、**使いやすく**、**高いスケーラビリティ**があります。私たちの API ファースト開発戦略の **主要コンポーネント** となりました。」</blockquote>121 <div class="fastapi-opinions__attr">— Deon Pillsbury, <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/">(ref)</a></div>122 </div>123</div>124<!-- /only-mkdocs -->125126<div class="only-github" markdown="1">127128"_[...] 最近 **FastAPI** を使っています。 [...] 実際に私のチームの全ての **Microsoft の機械学習サービス** で使用する予定です。 そのうちのいくつかのコアな **Windows** 製品と **Office** 製品に統合されつつあります。_"129130<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26"><small>(ref)</small></a></div>131132---133134"_FastAPIライブラリを採用し、クエリで **予測値** を取得できる **REST** サーバを構築しました。 [for Ludwig]_"135136<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/"><small>(ref)</small></a></div>137138---139140"_**Netflix** は、**危機管理**オーケストレーションフレームワーク、**Dispatch** のオープンソースリリースを発表できることをうれしく思います。 [built with **FastAPI**]_"141142<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072"><small>(ref)</small></a></div>143144---145146"_本番運用の Python API を構築したい方には、**FastAPI** を強くおすすめします。**美しく設計**されており、**使いやすく**、**高いスケーラビリティ**があります。私たちの API ファースト開発戦略の **主要コンポーネント** となり、Virtual TAC Engineer などの多くの自動化やサービスを推進しています。_"147148<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/"><small>(ref)</small></a></div>149150---151152</div>153154## FastAPI Conf { #fastapi-conf }155156[**FastAPI Conf '26**](https://fastapiconf.com) は **2026 年 10 月 28 日** に **オランダ・アムステルダム** で開催されます。FastAPI のすべてを、ソースから直接。🎤157158<a class="fastapi-feature-banner" href="https://fastapiconf.com"><img src="https://fastapi.tiangolo.com/img/fastapi-conf.jpeg" alt="FastAPI Conf '26 - 2026年10月28日 - オランダ・アムステルダム"></a>159160## FastAPI ミニドキュメンタリー { #fastapi-mini-documentary }1611622025 年末に公開された [FastAPI ミニドキュメンタリー](https://www.youtube.com/watch?v=mpR8ngthqiE)があります。オンラインで視聴できます:163164<a class="fastapi-feature-banner" href="https://www.youtube.com/watch?v=mpR8ngthqiE"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>165166## **Typer**、CLI 版 FastAPI { #typer-the-fastapi-of-clis }167168<a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" style="width: 20%;"></a>169170Web API の代わりにターミナルで使用する <abbr title="Command Line Interface - コマンドラインインターフェイス">CLI</abbr> アプリを構築する場合は、[**Typer**](https://typer.tiangolo.com/) を確認してください。171172**Typer** は FastAPI の弟分です。そして、**CLI 版 FastAPI** を意図しています。 ⌨️ 🚀173174## 必要条件 { #requirements }175176FastAPI は巨人の肩の上に立っています。177178* [Starlette](https://www.starlette.dev/)(Web 部分)179* [Pydantic](https://docs.pydantic.dev/)(データ部分)180181## インストール { #installation }182183[仮想環境](https://fastapi.tiangolo.com/ja/virtual-environments/) を作成して有効化し、それから FastAPI をインストールします。184185<div class="termy">186187```console188$ pip install "fastapi[standard]"189190---> 100%191```192193</div>194195**注**: すべてのターミナルで動作するように、`"fastapi[standard]"` は必ずクォートで囲んでください。196197## アプリケーション例 { #example }198199### 作成 { #create-it }200201`main.py` ファイルを作成し、以下のコードを入力します。202203```Python204from fastapi import FastAPI205206app = FastAPI()207208209@app.get("/")210def read_root():211 return {"Hello": "World"}212213214@app.get("/items/{item_id}")215def read_item(item_id: int, q: str | None = None):216 return {"item_id": item_id, "q": q}217```218219<details markdown="1">220<summary>または <code>async def</code> を使います...</summary>221222コードで `async` / `await` を使用する場合は、`async def` を使います。223224```Python hl_lines="7 12"225from fastapi import FastAPI226227app = FastAPI()228229230@app.get("/")231async def read_root():232 return {"Hello": "World"}233234235@app.get("/items/{item_id}")236async def read_item(item_id: int, q: str | None = None):237 return {"item_id": item_id, "q": q}238```239240**注**:241242わからない場合は、_「In a hurry?」_ セクションの [ドキュメントの `async` と `await`](https://fastapi.tiangolo.com/ja/async/#in-a-hurry) を確認してください。243244</details>245246### 実行 { #run-it }247248以下のコマンドでサーバーを起動します。249250<div class="termy">251252```console253$ fastapi dev254255 ╭────────── FastAPI CLI - Development mode ───────────╮256 │ │257 │ Serving at: http://127.0.0.1:8000 │258 │ │259 │ API docs: http://127.0.0.1:8000/docs │260 │ │261 │ Running in development mode, for production use: │262 │ │263 │ fastapi run │264 │ │265 ╰─────────────────────────────────────────────────────╯266267INFO: Will watch for changes in these directories: ['/home/user/code/awesomeapp']268INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)269INFO: Started reloader process [2248755] using WatchFiles270INFO: Started server process [2248757]271INFO: Waiting for application startup.272INFO: Application startup complete.273```274275</div>276277<details markdown="1">278<summary><code>fastapi dev</code> コマンドについて</summary>279280`fastapi dev` コマンドは `main.py` ファイルを自動的に読み取り、その中の **FastAPI** アプリを検出し、[Uvicorn](https://www.uvicorn.dev) を使用してサーバーを起動します。281282デフォルトでは、`fastapi dev` はローカル開発向けに自動リロードを有効にして起動します。283284詳しくは [FastAPI CLI docs](https://fastapi.tiangolo.com/ja/fastapi-cli/) を参照してください。285286</details>287288### 動作確認 { #check-it }289290ブラウザで [http://127.0.0.1:8000/items/5?q=somequery](http://127.0.0.1:8000/items/5?q=somequery) を開きます。291292以下の JSON のレスポンスが確認できます。293294```JSON295{"item_id": 5, "q": "somequery"}296```297298すでに以下の API が作成されています。299300* _パス_ `/` と `/items/{item_id}` で HTTP リクエストを受け取ります。301* 両方の _パス_ は `GET` <em>操作</em>(HTTP _メソッド_ としても知られています)を取ります。302* _パス_ `/items/{item_id}` は `int` であるべき _パスパラメータ_ `item_id` を持ちます。303* _パス_ `/items/{item_id}` はオプションの `str` _クエリパラメータ_ `q` を持ちます。304305### 自動対話型 API ドキュメント { #interactive-api-docs }306307次に、[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs) にアクセスします。308309自動対話型 API ドキュメントが表示されます([Swagger UI](https://github.com/swagger-api/swagger-ui) が提供しています)。310311312313### 代替 API ドキュメント { #alternative-api-docs }314315次に、[http://127.0.0.1:8000/redoc](http://127.0.0.1:8000/redoc) にアクセスします。316317代替の自動ドキュメントが表示されます([ReDoc](https://github.com/Rebilly/ReDoc) が提供しています)。318319320321## アップグレード例 { #example-upgrade }322323次に、`PUT` リクエストからボディを受け取るために `main.py` ファイルを修正しましょう。324325Pydantic によって、標準的な Python の型を使ってボディを宣言します。326327```Python hl_lines="2 7-10 23-25"328from fastapi import FastAPI329from pydantic import BaseModel330331app = FastAPI()332333334class Item(BaseModel):335 name: str336 price: float337 is_offer: bool | None = None338339340@app.get("/")341def read_root():342 return {"Hello": "World"}343344345@app.get("/items/{item_id}")346def read_item(item_id: int, q: str | None = None):347 return {"item_id": item_id, "q": q}348349350@app.put("/items/{item_id}")351def update_item(item_id: int, item: Item):352 return {"item_name": item.name, "item_id": item_id}353```354355`fastapi dev` サーバーは自動でリロードされるはずです。356357### 自動対話型 API ドキュメントのアップグレード { #interactive-api-docs-upgrade }358359次に、[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs) にアクセスします。360361* 自動対話型 API ドキュメントは新しいボディも含めて自動でアップデートされます。362363364365* 「Try it out」ボタンをクリックします。パラメータを入力して API と直接やりとりできます。366367368369* 次に、「Execute」ボタンをクリックします。ユーザーインターフェースは API と通信し、パラメータを送信し、結果を取得して画面に表示します。370371372373### 代替 API ドキュメントのアップグレード { #alternative-api-docs-upgrade }374375次に、[http://127.0.0.1:8000/redoc](http://127.0.0.1:8000/redoc) にアクセスします。376377* 代替のドキュメントにも新しいクエリパラメータやボディが反映されます。378379380381### まとめ { #recap }382383要約すると、関数のパラメータとして、パラメータやボディなどの型を **一度だけ** 宣言します。384385標準的な最新の Python の型を使います。386387新しい構文や特定のライブラリのメソッドやクラスなどを覚える必要はありません。388389単なる標準的な **Python** です。390391例えば、`int` の場合:392393```Python394item_id: int395```396397または、より複雑な `Item` モデルの場合:398399```Python400item: Item401```402403...そして、この一度の宣言で、以下のようになります。404405* 以下を含むエディタサポート:406 * 補完。407 * 型チェック。408* データの検証:409 * データが無効な場合に自動で明確なエラーを返します。410 * 深い入れ子になった JSON オブジェクトでも検証が可能です。411* 入力データの <dfn title="別名: serialization、parsing、marshalling">変換</dfn>: ネットワークから Python のデータや型へ。以下から読み取ります:412 * JSON。413 * パスパラメータ。414 * クエリパラメータ。415 * Cookie。416 * ヘッダー。417 * フォーム。418 * ファイル。419* 出力データの <dfn title="別名: serialization、parsing、marshalling">変換</dfn>: Python のデータや型からネットワークデータへ(JSON として)変換します:420 * Python の型(`str`、`int`、`float`、`bool`、`list` など)の変換。421 * `datetime` オブジェクト。422 * `UUID` オブジェクト。423 * データベースモデル。424 * ...などなど。425* 2 つの代替ユーザーインターフェースを含む自動対話型 API ドキュメント:426 * Swagger UI。427 * ReDoc。428429---430431前のコード例に戻ると、**FastAPI** は次のように動作します。432433* `GET` および `PUT` リクエストのパスに `item_id` があることを検証します。434* `GET` および `PUT` リクエストに対して `item_id` が `int` 型であることを検証します。435 * そうでない場合、クライアントは有用で明確なエラーを受け取ります。436* `GET` リクエストに対して、`q` という名前のオプションのクエリパラメータ(`http://127.0.0.1:8000/items/foo?q=somequery` のような)が存在するかどうかを調べます。437 * `q` パラメータは `= None` で宣言されているため、オプションです。438 * `None` がなければ必須になります(`PUT` の場合のボディと同様です)。439* `PUT` リクエストを `/items/{item_id}` に送信する場合、ボディを JSON として読み込みます:440 * 必須の属性 `name` があり、`str` であるべきことを確認します。441 * 必須の属性 `price` があり、`float` でなければならないことを確認します。442 * オプションの属性 `is_offer` があり、存在する場合は `bool` であるべきことを確認します。443 * これらはすべて、深くネストされた JSON オブジェクトに対しても動作します。444* JSON への/からの変換を自動的に行います。445* OpenAPI ですべてを文書化し、以下で利用できます:446 * 対話型ドキュメントシステム。447 * 多くの言語に対応した自動クライアントコード生成システム。448* 2 つの対話型ドキュメント Web インターフェースを直接提供します。449450---451452まだ表面的な部分に触れただけですが、仕組みはすでにイメージできているはずです。453454以下の行を変更してみてください。455456```Python457 return {"item_name": item.name, "item_id": item_id}458```459460...以下の:461462```Python463 ... "item_name": item.name ...464```465466...を:467468```Python469 ... "item_price": item.price ...470```471472...に変更し、エディタが属性を自動補完し、その型を知ることを確認してください。473474475476より多くの機能を含む、より完全な例については、<a href="https://fastapi.tiangolo.com/ja/tutorial/">Tutorial - User Guide</a> を参照してください。477478**ネタバレ注意**: tutorial - user guide には以下が含まれます。479480* **ヘッダー**、**Cookie**、**フォームフィールド**、**ファイル**など、他のさまざまな場所からの **パラメータ** 宣言。481* `maximum_length` や `regex` のような **検証制約** を設定する方法。482* 非常に強力で使いやすい **<dfn title="別名: components、resources、providers、services、injectables">依存性注入</dfn>** システム。483* **JWT トークン**を用いた **OAuth2** や **HTTP Basic** 認証のサポートを含む、セキュリティと認証。484* **深くネストされた JSON モデル**を宣言するための、より高度な(しかし同様に簡単な)手法(Pydantic のおかげです)。485* [Strawberry](https://strawberry.rocks) および他のライブラリによる **GraphQL** 統合。486* 以下のようなたくさんのおまけ機能(Starlette のおかげです):487 * **WebSockets**488 * HTTPX と `pytest` に基づく極めて簡単なテスト489 * **CORS**490 * **Cookie Sessions**491 * ...などなど。492493### アプリをデプロイ(任意) { #deploy-your-app-optional }494495必要に応じて FastAPI アプリを [FastAPI Cloud](https://fastapicloud.com) にデプロイできます。まだの場合はウェイティングリストに参加してください。 🚀496497すでに **FastAPI Cloud** アカウント(ウェイティングリストから招待されました 😉)がある場合は、1 コマンドでアプリケーションをデプロイできます。498499<div class="termy">500501```console502$ fastapi deploy503504Deploying to FastAPI Cloud...505506✅ Deployment successful!507508🐔 Ready the chicken! Your app is ready at https://myapp.fastapicloud.dev509```510511</div>512513これで完了です!その URL でアプリにアクセスできます。 ✨514515#### FastAPI Cloud について { #about-fastapi-cloud }516517**[FastAPI Cloud](https://fastapicloud.com)** は **FastAPI** の作者と同じチームによって作られています。518519最小限の労力で API を **構築**、**デプロイ**、**アクセス** するためのプロセスを効率化します。520521FastAPI でアプリを構築するのと同じ **開発者体験** を、クラウドへの **デプロイ** にももたらします。 🎉522523FastAPI Cloud は *FastAPI and friends* オープンソースプロジェクトの主要スポンサーであり、資金提供元です。 ✨524525#### 他のクラウドプロバイダにデプロイ { #deploy-to-other-cloud-providers }526527FastAPI はオープンソースであり、標準に基づいています。選択した任意のクラウドプロバイダに FastAPI アプリをデプロイできます。528529各クラウドプロバイダのガイドに従って、FastAPI アプリをデプロイしてください。 🤓530531## パフォーマンス { #performance }532533独立した TechEmpower のベンチマークでは、Uvicorn で動作する **FastAPI** アプリケーションが、[利用可能な最も高速な Python フレームワークの一つ](https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7)であり、Starlette と Uvicorn(FastAPI で内部的に使用されています)にのみ下回っていると示されています。(*)534535詳細は [Benchmarks](https://fastapi.tiangolo.com/ja/benchmarks/) セクションをご覧ください。536537## 依存関係 { #dependencies }538539FastAPI は Pydantic と Starlette に依存しています。540541### `standard` 依存関係 { #standard-dependencies }542543FastAPI を `pip install "fastapi[standard]"` でインストールすると、`standard` グループのオプション依存関係が含まれます。544545Pydantic によって使用されるもの:546547* [`email-validator`](https://github.com/JoshData/python-email-validator) - メール検証のため。548549Starlette によって使用されるもの:550551* [`httpx`](https://www.python-httpx.org) - `TestClient` を使用したい場合に必要です。552* [`jinja2`](https://jinja.palletsprojects.com) - デフォルトのテンプレート設定を使用したい場合に必要です。553* [`python-multipart`](https://github.com/Kludex/python-multipart) - `request.form()` とともに、フォームの <dfn title="HTTP リクエストから届く文字列を Python データに変換すること">「parsing」</dfn> をサポートしたい場合に必要です。554555FastAPI によって使用されるもの:556557* [`uvicorn`](https://www.uvicorn.dev) - アプリケーションをロードして提供するサーバーのため。これには `uvicorn[standard]` も含まれ、高性能なサービングに必要な依存関係(例: `uvloop`)が含まれます。558* `fastapi-cli[standard]` - `fastapi` コマンドを提供します。559 * これには `fastapi-cloud-cli` が含まれ、FastAPI アプリケーションを [FastAPI Cloud](https://fastapicloud.com) にデプロイできます。560561### `standard` 依存関係なし { #without-standard-dependencies }562563`standard` のオプション依存関係を含めたくない場合は、`pip install "fastapi[standard]"` の代わりに `pip install fastapi` でインストールできます。564565### `fastapi-cloud-cli` なし { #without-fastapi-cloud-cli }566567標準の依存関係を含めつつ `fastapi-cloud-cli` を除外して FastAPI をインストールしたい場合は、`pip install "fastapi[standard-no-fastapi-cloud-cli]"` でインストールできます。568569### 追加のオプション依存関係 { #additional-optional-dependencies }570571追加でインストールしたい依存関係があります。572573追加のオプション Pydantic 依存関係:574575* [`pydantic-settings`](https://docs.pydantic.dev/latest/usage/pydantic_settings/) - 設定管理のため。576* [`pydantic-extra-types`](https://docs.pydantic.dev/latest/usage/types/extra_types/extra_types/) - Pydantic で使用する追加の型のため。577578追加のオプション FastAPI 依存関係:579580* [`orjson`](https://github.com/ijl/orjson) - `ORJSONResponse` を使用したい場合に必要です。581* [`ujson`](https://github.com/esnme/ultrajson) - `UJSONResponse` を使用したい場合に必要です。582583## ライセンス { #license }584585このプロジェクトは MIT ライセンスの条項の下でライセンスされています。
Findings
✓ No findings reported for this file.