Browse Source

Merge branch 'master' into master

pull/9837/head
Michael Jones 5 months ago
committed by GitHub
parent
commit
53f2a62071
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 32
      .github/workflows/test.yml
  2. 7
      .pre-commit-config.yaml
  3. 18
      README.md
  4. 18
      docs/en/data/contributors.yml
  5. 336
      docs/en/data/topic_repos.yml
  6. 114
      docs/en/data/translation_reviewers.yml
  7. 43
      docs/en/data/translators.yml
  8. 20
      docs/en/docs/advanced/wsgi.md
  9. 6
      docs/en/docs/contributing.md
  10. 4
      docs/en/docs/deployment/docker.md
  11. 18
      docs/en/docs/index.md
  12. 8
      docs/en/docs/reference/middleware.md
  13. 2
      docs/en/docs/reference/request.md
  14. 2
      docs/en/docs/reference/response.md
  15. 2
      docs/en/docs/reference/responses.md
  16. 2
      docs/en/docs/reference/security/index.md
  17. 24
      docs/en/docs/reference/websockets.md
  18. 32
      docs/en/docs/release-notes.md
  19. 11
      docs/en/docs/translation-banner.md
  20. 7
      docs/en/docs/tutorial/body-multiple-params.md
  21. 4
      docs/en/docs/tutorial/path-operation-configuration.md
  22. 11
      docs/ru/docs/translation-banner.md
  23. 2
      docs/tr/docs/about/index.md
  24. 31
      docs/tr/docs/advanced/index.md
  25. 12
      docs/tr/docs/advanced/security/index.md
  26. 10
      docs/tr/docs/advanced/testing-websockets.md
  27. 24
      docs/tr/docs/advanced/wsgi.md
  28. 36
      docs/tr/docs/benchmarks.md
  29. 25
      docs/tr/docs/deployment/cloud.md
  30. 22
      docs/tr/docs/deployment/index.md
  31. 40
      docs/tr/docs/how-to/general.md
  32. 10
      docs/tr/docs/how-to/index.md
  33. 425
      docs/tr/docs/index.md
  34. 4
      docs/tr/docs/learn/index.md
  35. 112
      docs/tr/docs/project-generation.md
  36. 421
      docs/tr/docs/python-types.md
  37. 4
      docs/tr/docs/resources/index.md
  38. 34
      docs/tr/docs/tutorial/cookie-params.md
  39. 311
      docs/tr/docs/tutorial/first-steps.md
  40. 190
      docs/tr/docs/tutorial/path-params.md
  41. 94
      docs/tr/docs/tutorial/query-params.md
  42. 48
      docs/tr/docs/tutorial/request-forms.md
  43. 38
      docs/tr/docs/tutorial/static-files.md
  44. 80
      docs/uk/docs/alternatives.md
  45. 108
      docs/uk/docs/fastapi-cli.md
  46. 138
      docs/uk/docs/features.md
  47. 4
      docs_src/app_testing/app_b_an_py310/main.py
  48. 4
      docs_src/app_testing/app_b_an_py39/main.py
  49. 4
      docs_src/app_testing/app_b_py310/main.py
  50. 4
      docs_src/app_testing/app_b_py39/main.py
  51. 4
      docs_src/body_updates/tutorial002_py310.py
  52. 4
      docs_src/body_updates/tutorial002_py39.py
  53. 2
      docs_src/metadata/tutorial001_1_py39.py
  54. 4
      docs_src/path_operation_advanced_configuration/tutorial004_py310.py
  55. 4
      docs_src/path_operation_advanced_configuration/tutorial004_py39.py
  56. 4
      docs_src/path_operation_configuration/tutorial001_py310.py
  57. 4
      docs_src/path_operation_configuration/tutorial001_py39.py
  58. 4
      docs_src/path_operation_configuration/tutorial002_py310.py
  59. 4
      docs_src/path_operation_configuration/tutorial002_py39.py
  60. 3
      docs_src/path_operation_configuration/tutorial003_py310.py
  61. 3
      docs_src/path_operation_configuration/tutorial003_py39.py
  62. 4
      docs_src/path_operation_configuration/tutorial004_py310.py
  63. 4
      docs_src/path_operation_configuration/tutorial004_py39.py
  64. 3
      docs_src/path_operation_configuration/tutorial005_py310.py
  65. 3
      docs_src/path_operation_configuration/tutorial005_py39.py
  66. 4
      docs_src/security/tutorial004_an_py310.py
  67. 4
      docs_src/security/tutorial004_an_py39.py
  68. 4
      docs_src/security/tutorial004_py310.py
  69. 4
      docs_src/security/tutorial004_py39.py
  70. 4
      docs_src/security/tutorial005_an_py310.py
  71. 4
      docs_src/security/tutorial005_an_py39.py
  72. 4
      docs_src/security/tutorial005_py310.py
  73. 4
      docs_src/security/tutorial005_py39.py
  74. 2
      docs_src/wsgi/tutorial001_py39.py
  75. 4
      fastapi/_compat/shared.py
  76. 8
      fastapi/_compat/v2.py
  77. 7
      fastapi/applications.py
  78. 6
      fastapi/dependencies/utils.py
  79. 10
      fastapi/exceptions.py
  80. 4
      fastapi/middleware/wsgi.py
  81. 30
      fastapi/openapi/docs.py
  82. 3
      fastapi/openapi/utils.py
  83. 94
      fastapi/param_functions.py
  84. 30
      fastapi/security/oauth2.py
  85. 2
      fastapi/utils.py
  86. 12
      pyproject.toml
  87. 30
      scripts/mkdocs_hooks.py
  88. 28
      scripts/translate.py
  89. 123
      tests/test_additional_responses_union_duplicate_anyof.py
  90. 15
      tests/test_invalid_sequence_param.py
  91. 2
      tests/test_tutorial/test_metadata/test_tutorial001_1.py
  92. 114
      uv.lock

32
.github/workflows/test.yml

@ -16,7 +16,35 @@ env:
UV_NO_SYNC: true UV_NO_SYNC: true
jobs: jobs:
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v6
# For pull requests it's not necessary to checkout the code but for the main branch it is
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- .github/workflows/test.yml
- docs_src/**
- fastapi/**
- scripts/**
- tests/**
- .python-version
- pyproject.toml
- uv.lock
test: test:
needs:
- changes
if: needs.changes.outputs.src == 'true'
strategy: strategy:
matrix: matrix:
os: [ windows-latest, macos-latest ] os: [ windows-latest, macos-latest ]
@ -91,7 +119,8 @@ jobs:
include-hidden-files: true include-hidden-files: true
coverage-combine: coverage-combine:
needs: [test] needs:
- test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Dump GitHub context - name: Dump GitHub context
@ -143,3 +172,4 @@ jobs:
uses: re-actors/alls-green@release/v1 uses: re-actors/alls-green@release/v1
with: with:
jobs: ${{ toJSON(needs) }} jobs: ${{ toJSON(needs) }}
allowed-skips: coverage-combine,test

7
.pre-commit-config.yaml

@ -30,6 +30,13 @@ repos:
language: unsupported language: unsupported
types: [python] types: [python]
- id: local-mypy
name: mypy check
entry: uv run mypy fastapi
require_serial: true
language: unsupported
pass_filenames: false
- id: add-permalinks-pages - id: add-permalinks-pages
language: unsupported language: unsupported
name: add-permalinks-pages name: add-permalinks-pages

18
README.md

@ -164,8 +164,6 @@ $ pip install "fastapi[standard]"
Create a file `main.py` with: Create a file `main.py` with:
```Python ```Python
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -177,7 +175,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```
@ -186,9 +184,7 @@ def read_item(item_id: int, q: Union[str, None] = None):
If your code uses `async` / `await`, use `async def`: If your code uses `async` / `await`, use `async def`:
```Python hl_lines="9 14" ```Python hl_lines="7 12"
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -200,7 +196,7 @@ async def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
async def read_item(item_id: int, q: Union[str, None] = None): async def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```
@ -291,9 +287,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request.
Declare the body using standard Python types, thanks to Pydantic. Declare the body using standard Python types, thanks to Pydantic.
```Python hl_lines="4 9-12 25-27" ```Python hl_lines="2 7-10 23-25"
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
from pydantic import BaseModel from pydantic import BaseModel
@ -303,7 +297,7 @@ app = FastAPI()
class Item(BaseModel): class Item(BaseModel):
name: str name: str
price: float price: float
is_offer: Union[bool, None] = None is_offer: bool | None = None
@app.get("/") @app.get("/")
@ -312,7 +306,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}

18
docs/en/data/contributors.yml

@ -1,17 +1,17 @@
tiangolo: tiangolo:
login: tiangolo login: tiangolo
count: 857 count: 871
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4
url: https://github.com/tiangolo url: https://github.com/tiangolo
dependabot: dependabot:
login: dependabot login: dependabot
count: 130 count: 133
avatarUrl: https://avatars.githubusercontent.com/in/29110?v=4 avatarUrl: https://avatars.githubusercontent.com/in/29110?v=4
url: https://github.com/apps/dependabot url: https://github.com/apps/dependabot
alejsdev: alejsdev:
login: alejsdev login: alejsdev
count: 53 count: 53
avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=85ceac49fb87138aebe8d663912e359447329090&v=4 avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=0facffe3abf87f57a1f05fa773d1119cc5c2f6a5&v=4
url: https://github.com/alejsdev url: https://github.com/alejsdev
pre-commit-ci: pre-commit-ci:
login: pre-commit-ci login: pre-commit-ci
@ -20,8 +20,8 @@ pre-commit-ci:
url: https://github.com/apps/pre-commit-ci url: https://github.com/apps/pre-commit-ci
YuriiMotov: YuriiMotov:
login: YuriiMotov login: YuriiMotov
count: 36 count: 38
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=b9b13d598dddfab529a52d264df80a900bfe7060&v=4 avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=bc48be95c429989224786106b027f3c5e40cc354&v=4
url: https://github.com/YuriiMotov url: https://github.com/YuriiMotov
github-actions: github-actions:
login: github-actions login: github-actions
@ -40,7 +40,7 @@ dmontagu:
url: https://github.com/dmontagu url: https://github.com/dmontagu
svlandeg: svlandeg:
login: svlandeg login: svlandeg
count: 16 count: 17
avatarUrl: https://avatars.githubusercontent.com/u/8796347?u=556c97650c27021911b0b9447ec55e75987b0e8a&v=4 avatarUrl: https://avatars.githubusercontent.com/u/8796347?u=556c97650c27021911b0b9447ec55e75987b0e8a&v=4
url: https://github.com/svlandeg url: https://github.com/svlandeg
nilslindemann: nilslindemann:
@ -126,7 +126,7 @@ hitrust:
ShahriyarR: ShahriyarR:
login: ShahriyarR login: ShahriyarR
count: 4 count: 4
avatarUrl: https://avatars.githubusercontent.com/u/3852029?u=631b2ae59360ab380c524b32bc3d245aff1165af&v=4 avatarUrl: https://avatars.githubusercontent.com/u/3852029?u=2dc6402d9053ee53f7afc407089cbab21c68f21d&v=4
url: https://github.com/ShahriyarR url: https://github.com/ShahriyarR
adriangb: adriangb:
login: adriangb login: adriangb
@ -266,7 +266,7 @@ Nimitha-jagadeesha:
lucaromagnoli: lucaromagnoli:
login: lucaromagnoli login: lucaromagnoli
count: 3 count: 3
avatarUrl: https://avatars.githubusercontent.com/u/38782977?u=15df02e806a2293af40ac619fba11dbe3c0c4fd4&v=4 avatarUrl: https://avatars.githubusercontent.com/u/38782977?u=a09a2e916625fa035f9dfa25ebc58e07aac8ec36&v=4
url: https://github.com/lucaromagnoli url: https://github.com/lucaromagnoli
salmantec: salmantec:
login: salmantec login: salmantec
@ -521,7 +521,7 @@ s111d:
estebanx64: estebanx64:
login: estebanx64 login: estebanx64
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/10840422?u=1900887aeed268699e5ea6f3fb7db614f7b77cd3&v=4 avatarUrl: https://avatars.githubusercontent.com/u/10840422?u=812422ae5d6a4bc5ff331c901fc54f9ab3cecf5c&v=4
url: https://github.com/estebanx64 url: https://github.com/estebanx64
ndimares: ndimares:
login: ndimares login: ndimares

336
docs/en/data/topic_repos.yml

@ -1,176 +1,181 @@
- name: full-stack-fastapi-template - name: full-stack-fastapi-template
html_url: https://github.com/fastapi/full-stack-fastapi-template html_url: https://github.com/fastapi/full-stack-fastapi-template
stars: 40334 stars: 41312
owner_login: fastapi owner_login: fastapi
owner_html_url: https://github.com/fastapi owner_html_url: https://github.com/fastapi
- name: Hello-Python - name: Hello-Python
html_url: https://github.com/mouredev/Hello-Python html_url: https://github.com/mouredev/Hello-Python
stars: 33628 stars: 34206
owner_login: mouredev owner_login: mouredev
owner_html_url: https://github.com/mouredev owner_html_url: https://github.com/mouredev
- name: serve - name: serve
html_url: https://github.com/jina-ai/serve html_url: https://github.com/jina-ai/serve
stars: 21817 stars: 21832
owner_login: jina-ai owner_login: jina-ai
owner_html_url: https://github.com/jina-ai owner_html_url: https://github.com/jina-ai
- name: HivisionIDPhotos - name: HivisionIDPhotos
html_url: https://github.com/Zeyi-Lin/HivisionIDPhotos html_url: https://github.com/Zeyi-Lin/HivisionIDPhotos
stars: 20409 stars: 20661
owner_login: Zeyi-Lin owner_login: Zeyi-Lin
owner_html_url: https://github.com/Zeyi-Lin owner_html_url: https://github.com/Zeyi-Lin
- name: sqlmodel - name: sqlmodel
html_url: https://github.com/fastapi/sqlmodel html_url: https://github.com/fastapi/sqlmodel
stars: 17415 stars: 17567
owner_login: fastapi owner_login: fastapi
owner_html_url: https://github.com/fastapi owner_html_url: https://github.com/fastapi
- name: fastapi-best-practices - name: fastapi-best-practices
html_url: https://github.com/zhanymkanov/fastapi-best-practices html_url: https://github.com/zhanymkanov/fastapi-best-practices
stars: 15776 stars: 16291
owner_login: zhanymkanov owner_login: zhanymkanov
owner_html_url: https://github.com/zhanymkanov owner_html_url: https://github.com/zhanymkanov
- name: Douyin_TikTok_Download_API - name: Douyin_TikTok_Download_API
html_url: https://github.com/Evil0ctal/Douyin_TikTok_Download_API html_url: https://github.com/Evil0ctal/Douyin_TikTok_Download_API
stars: 15588 stars: 16132
owner_login: Evil0ctal owner_login: Evil0ctal
owner_html_url: https://github.com/Evil0ctal owner_html_url: https://github.com/Evil0ctal
- name: machine-learning-zoomcamp
html_url: https://github.com/DataTalksClub/machine-learning-zoomcamp
stars: 12447
owner_login: DataTalksClub
owner_html_url: https://github.com/DataTalksClub
- name: SurfSense - name: SurfSense
html_url: https://github.com/MODSetter/SurfSense html_url: https://github.com/MODSetter/SurfSense
stars: 12128 stars: 12723
owner_login: MODSetter owner_login: MODSetter
owner_html_url: https://github.com/MODSetter owner_html_url: https://github.com/MODSetter
- name: machine-learning-zoomcamp
html_url: https://github.com/DataTalksClub/machine-learning-zoomcamp
stars: 12575
owner_login: DataTalksClub
owner_html_url: https://github.com/DataTalksClub
- name: fastapi_mcp - name: fastapi_mcp
html_url: https://github.com/tadata-org/fastapi_mcp html_url: https://github.com/tadata-org/fastapi_mcp
stars: 11326 stars: 11478
owner_login: tadata-org owner_login: tadata-org
owner_html_url: https://github.com/tadata-org owner_html_url: https://github.com/tadata-org
- name: awesome-fastapi - name: awesome-fastapi
html_url: https://github.com/mjhea0/awesome-fastapi html_url: https://github.com/mjhea0/awesome-fastapi
stars: 10901 stars: 11018
owner_login: mjhea0 owner_login: mjhea0
owner_html_url: https://github.com/mjhea0 owner_html_url: https://github.com/mjhea0
- name: XHS-Downloader - name: XHS-Downloader
html_url: https://github.com/JoeanAmier/XHS-Downloader html_url: https://github.com/JoeanAmier/XHS-Downloader
stars: 9584 stars: 9938
owner_login: JoeanAmier owner_login: JoeanAmier
owner_html_url: https://github.com/JoeanAmier owner_html_url: https://github.com/JoeanAmier
- name: polar - name: polar
html_url: https://github.com/polarsource/polar html_url: https://github.com/polarsource/polar
stars: 8951 stars: 9348
owner_login: polarsource owner_login: polarsource
owner_html_url: https://github.com/polarsource owner_html_url: https://github.com/polarsource
- name: FastUI - name: FastUI
html_url: https://github.com/pydantic/FastUI html_url: https://github.com/pydantic/FastUI
stars: 8934 stars: 8949
owner_login: pydantic owner_login: pydantic
owner_html_url: https://github.com/pydantic owner_html_url: https://github.com/pydantic
- name: FileCodeBox - name: FileCodeBox
html_url: https://github.com/vastsa/FileCodeBox html_url: https://github.com/vastsa/FileCodeBox
stars: 7934 stars: 8060
owner_login: vastsa owner_login: vastsa
owner_html_url: https://github.com/vastsa owner_html_url: https://github.com/vastsa
- name: nonebot2 - name: nonebot2
html_url: https://github.com/nonebot/nonebot2 html_url: https://github.com/nonebot/nonebot2
stars: 7248 stars: 7311
owner_login: nonebot owner_login: nonebot
owner_html_url: https://github.com/nonebot owner_html_url: https://github.com/nonebot
- name: hatchet - name: hatchet
html_url: https://github.com/hatchet-dev/hatchet html_url: https://github.com/hatchet-dev/hatchet
stars: 6392 stars: 6479
owner_login: hatchet-dev owner_login: hatchet-dev
owner_html_url: https://github.com/hatchet-dev owner_html_url: https://github.com/hatchet-dev
- name: fastapi-users - name: fastapi-users
html_url: https://github.com/fastapi-users/fastapi-users html_url: https://github.com/fastapi-users/fastapi-users
stars: 5899 stars: 5970
owner_login: fastapi-users owner_login: fastapi-users
owner_html_url: https://github.com/fastapi-users owner_html_url: https://github.com/fastapi-users
- name: serge - name: serge
html_url: https://github.com/serge-chat/serge html_url: https://github.com/serge-chat/serge
stars: 5754 stars: 5751
owner_login: serge-chat owner_login: serge-chat
owner_html_url: https://github.com/serge-chat owner_html_url: https://github.com/serge-chat
- name: strawberry - name: strawberry
html_url: https://github.com/strawberry-graphql/strawberry html_url: https://github.com/strawberry-graphql/strawberry
stars: 4577 stars: 4598
owner_login: strawberry-graphql owner_login: strawberry-graphql
owner_html_url: https://github.com/strawberry-graphql owner_html_url: https://github.com/strawberry-graphql
- name: devpush
html_url: https://github.com/hunvreus/devpush
stars: 4407
owner_login: hunvreus
owner_html_url: https://github.com/hunvreus
- name: Kokoro-FastAPI
html_url: https://github.com/remsky/Kokoro-FastAPI
stars: 4359
owner_login: remsky
owner_html_url: https://github.com/remsky
- name: poem - name: poem
html_url: https://github.com/poem-web/poem html_url: https://github.com/poem-web/poem
stars: 4303 stars: 4337
owner_login: poem-web owner_login: poem-web
owner_html_url: https://github.com/poem-web owner_html_url: https://github.com/poem-web
- name: chatgpt-web-share - name: chatgpt-web-share
html_url: https://github.com/chatpire/chatgpt-web-share html_url: https://github.com/chatpire/chatgpt-web-share
stars: 4287 stars: 4279
owner_login: chatpire owner_login: chatpire
owner_html_url: https://github.com/chatpire owner_html_url: https://github.com/chatpire
- name: dynaconf - name: dynaconf
html_url: https://github.com/dynaconf/dynaconf html_url: https://github.com/dynaconf/dynaconf
stars: 4221 stars: 4244
owner_login: dynaconf owner_login: dynaconf
owner_html_url: https://github.com/dynaconf owner_html_url: https://github.com/dynaconf
- name: Kokoro-FastAPI - name: Yuxi-Know
html_url: https://github.com/remsky/Kokoro-FastAPI html_url: https://github.com/xerrors/Yuxi-Know
stars: 4181 stars: 4154
owner_login: remsky owner_login: xerrors
owner_html_url: https://github.com/remsky owner_html_url: https://github.com/xerrors
- name: atrilabs-engine - name: atrilabs-engine
html_url: https://github.com/Atri-Labs/atrilabs-engine html_url: https://github.com/Atri-Labs/atrilabs-engine
stars: 4090 stars: 4086
owner_login: Atri-Labs owner_login: Atri-Labs
owner_html_url: https://github.com/Atri-Labs owner_html_url: https://github.com/Atri-Labs
- name: devpush
html_url: https://github.com/hunvreus/devpush
stars: 4037
owner_login: hunvreus
owner_html_url: https://github.com/hunvreus
- name: logfire - name: logfire
html_url: https://github.com/pydantic/logfire html_url: https://github.com/pydantic/logfire
stars: 3896 stars: 3975
owner_login: pydantic owner_login: pydantic
owner_html_url: https://github.com/pydantic owner_html_url: https://github.com/pydantic
- name: LitServe - name: LitServe
html_url: https://github.com/Lightning-AI/LitServe html_url: https://github.com/Lightning-AI/LitServe
stars: 3756 stars: 3797
owner_login: Lightning-AI owner_login: Lightning-AI
owner_html_url: https://github.com/Lightning-AI owner_html_url: https://github.com/Lightning-AI
- name: huma - name: huma
html_url: https://github.com/danielgtaylor/huma html_url: https://github.com/danielgtaylor/huma
stars: 3702 stars: 3785
owner_login: danielgtaylor owner_login: danielgtaylor
owner_html_url: https://github.com/danielgtaylor owner_html_url: https://github.com/danielgtaylor
- name: Yuxi-Know
html_url: https://github.com/xerrors/Yuxi-Know
stars: 3680
owner_login: xerrors
owner_html_url: https://github.com/xerrors
- name: datamodel-code-generator - name: datamodel-code-generator
html_url: https://github.com/koxudaxi/datamodel-code-generator html_url: https://github.com/koxudaxi/datamodel-code-generator
stars: 3675 stars: 3731
owner_login: koxudaxi owner_login: koxudaxi
owner_html_url: https://github.com/koxudaxi owner_html_url: https://github.com/koxudaxi
- name: fastapi-admin - name: fastapi-admin
html_url: https://github.com/fastapi-admin/fastapi-admin html_url: https://github.com/fastapi-admin/fastapi-admin
stars: 3659 stars: 3697
owner_login: fastapi-admin owner_login: fastapi-admin
owner_html_url: https://github.com/fastapi-admin owner_html_url: https://github.com/fastapi-admin
- name: farfalle - name: farfalle
html_url: https://github.com/rashadphz/farfalle html_url: https://github.com/rashadphz/farfalle
stars: 3497 stars: 3506
owner_login: rashadphz owner_login: rashadphz
owner_html_url: https://github.com/rashadphz owner_html_url: https://github.com/rashadphz
- name: tracecat - name: tracecat
html_url: https://github.com/TracecatHQ/tracecat html_url: https://github.com/TracecatHQ/tracecat
stars: 3421 stars: 3458
owner_login: TracecatHQ owner_login: TracecatHQ
owner_html_url: https://github.com/TracecatHQ owner_html_url: https://github.com/TracecatHQ
- name: mcp-context-forge
html_url: https://github.com/IBM/mcp-context-forge
stars: 3216
owner_login: IBM
owner_html_url: https://github.com/IBM
- name: opyrator - name: opyrator
html_url: https://github.com/ml-tooling/opyrator html_url: https://github.com/ml-tooling/opyrator
stars: 3136 stars: 3134
owner_login: ml-tooling owner_login: ml-tooling
owner_html_url: https://github.com/ml-tooling owner_html_url: https://github.com/ml-tooling
- name: docarray - name: docarray
@ -180,316 +185,311 @@
owner_html_url: https://github.com/docarray owner_html_url: https://github.com/docarray
- name: fastapi-realworld-example-app - name: fastapi-realworld-example-app
html_url: https://github.com/nsidnev/fastapi-realworld-example-app html_url: https://github.com/nsidnev/fastapi-realworld-example-app
stars: 3051 stars: 3072
owner_login: nsidnev owner_login: nsidnev
owner_html_url: https://github.com/nsidnev owner_html_url: https://github.com/nsidnev
- name: mcp-context-forge
html_url: https://github.com/IBM/mcp-context-forge
stars: 3034
owner_login: IBM
owner_html_url: https://github.com/IBM
- name: uvicorn-gunicorn-fastapi-docker - name: uvicorn-gunicorn-fastapi-docker
html_url: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker html_url: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker
stars: 2904 stars: 2908
owner_login: tiangolo owner_login: tiangolo
owner_html_url: https://github.com/tiangolo owner_html_url: https://github.com/tiangolo
- name: FastAPI-template - name: FastAPI-template
html_url: https://github.com/s3rius/FastAPI-template html_url: https://github.com/s3rius/FastAPI-template
stars: 2680 stars: 2728
owner_login: s3rius owner_login: s3rius
owner_html_url: https://github.com/s3rius owner_html_url: https://github.com/s3rius
- name: best-of-web-python - name: best-of-web-python
html_url: https://github.com/ml-tooling/best-of-web-python html_url: https://github.com/ml-tooling/best-of-web-python
stars: 2662 stars: 2686
owner_login: ml-tooling owner_login: ml-tooling
owner_html_url: https://github.com/ml-tooling owner_html_url: https://github.com/ml-tooling
- name: YC-Killer - name: YC-Killer
html_url: https://github.com/sahibzada-allahyar/YC-Killer html_url: https://github.com/sahibzada-allahyar/YC-Killer
stars: 2614 stars: 2648
owner_login: sahibzada-allahyar owner_login: sahibzada-allahyar
owner_html_url: https://github.com/sahibzada-allahyar owner_html_url: https://github.com/sahibzada-allahyar
- name: sqladmin - name: sqladmin
html_url: https://github.com/aminalaee/sqladmin html_url: https://github.com/aminalaee/sqladmin
stars: 2587 stars: 2637
owner_login: aminalaee owner_login: aminalaee
owner_html_url: https://github.com/aminalaee owner_html_url: https://github.com/aminalaee
- name: fastapi-react - name: fastapi-react
html_url: https://github.com/Buuntu/fastapi-react html_url: https://github.com/Buuntu/fastapi-react
stars: 2566 stars: 2573
owner_login: Buuntu owner_login: Buuntu
owner_html_url: https://github.com/Buuntu owner_html_url: https://github.com/Buuntu
- name: RasaGPT - name: RasaGPT
html_url: https://github.com/paulpierre/RasaGPT html_url: https://github.com/paulpierre/RasaGPT
stars: 2456 stars: 2460
owner_login: paulpierre owner_login: paulpierre
owner_html_url: https://github.com/paulpierre owner_html_url: https://github.com/paulpierre
- name: supabase-py - name: supabase-py
html_url: https://github.com/supabase/supabase-py html_url: https://github.com/supabase/supabase-py
stars: 2394 stars: 2428
owner_login: supabase owner_login: supabase
owner_html_url: https://github.com/supabase owner_html_url: https://github.com/supabase
- name: 30-Days-of-Python
html_url: https://github.com/codingforentrepreneurs/30-Days-of-Python
stars: 2347
owner_login: codingforentrepreneurs
owner_html_url: https://github.com/codingforentrepreneurs
- name: nextpy - name: nextpy
html_url: https://github.com/dot-agent/nextpy html_url: https://github.com/dot-agent/nextpy
stars: 2338 stars: 2337
owner_login: dot-agent owner_login: dot-agent
owner_html_url: https://github.com/dot-agent owner_html_url: https://github.com/dot-agent
- name: fastapi-utils - name: fastapi-utils
html_url: https://github.com/fastapiutils/fastapi-utils html_url: https://github.com/fastapiutils/fastapi-utils
stars: 2289 stars: 2299
owner_login: fastapiutils owner_login: fastapiutils
owner_html_url: https://github.com/fastapiutils owner_html_url: https://github.com/fastapiutils
- name: langserve - name: langserve
html_url: https://github.com/langchain-ai/langserve html_url: https://github.com/langchain-ai/langserve
stars: 2234 stars: 2255
owner_login: langchain-ai owner_login: langchain-ai
owner_html_url: https://github.com/langchain-ai owner_html_url: https://github.com/langchain-ai
- name: 30-Days-of-Python - name: NoteDiscovery
html_url: https://github.com/codingforentrepreneurs/30-Days-of-Python html_url: https://github.com/gamosoft/NoteDiscovery
stars: 2232 stars: 2182
owner_login: codingforentrepreneurs owner_login: gamosoft
owner_html_url: https://github.com/codingforentrepreneurs owner_html_url: https://github.com/gamosoft
- name: solara - name: solara
html_url: https://github.com/widgetti/solara html_url: https://github.com/widgetti/solara
stars: 2141 stars: 2154
owner_login: widgetti owner_login: widgetti
owner_html_url: https://github.com/widgetti owner_html_url: https://github.com/widgetti
- name: mangum - name: mangum
html_url: https://github.com/Kludex/mangum html_url: https://github.com/Kludex/mangum
stars: 2046 stars: 2071
owner_login: Kludex owner_login: Kludex
owner_html_url: https://github.com/Kludex owner_html_url: https://github.com/Kludex
- name: fastapi_best_architecture - name: fastapi_best_architecture
html_url: https://github.com/fastapi-practices/fastapi_best_architecture html_url: https://github.com/fastapi-practices/fastapi_best_architecture
stars: 1963 stars: 2036
owner_login: fastapi-practices owner_login: fastapi-practices
owner_html_url: https://github.com/fastapi-practices owner_html_url: https://github.com/fastapi-practices
- name: NoteDiscovery
html_url: https://github.com/gamosoft/NoteDiscovery
stars: 1943
owner_login: gamosoft
owner_html_url: https://github.com/gamosoft
- name: agentkit
html_url: https://github.com/BCG-X-Official/agentkit
stars: 1936
owner_login: BCG-X-Official
owner_html_url: https://github.com/BCG-X-Official
- name: vue-fastapi-admin - name: vue-fastapi-admin
html_url: https://github.com/mizhexiaoxiao/vue-fastapi-admin html_url: https://github.com/mizhexiaoxiao/vue-fastapi-admin
stars: 1909 stars: 1983
owner_login: mizhexiaoxiao owner_login: mizhexiaoxiao
owner_html_url: https://github.com/mizhexiaoxiao owner_html_url: https://github.com/mizhexiaoxiao
- name: manage-fastapi - name: agentkit
html_url: https://github.com/ycd/manage-fastapi html_url: https://github.com/BCG-X-Official/agentkit
stars: 1887 stars: 1941
owner_login: ycd owner_login: BCG-X-Official
owner_html_url: https://github.com/ycd owner_html_url: https://github.com/BCG-X-Official
- name: fastapi-langgraph-agent-production-ready-template
html_url: https://github.com/wassim249/fastapi-langgraph-agent-production-ready-template
stars: 1920
owner_login: wassim249
owner_html_url: https://github.com/wassim249
- name: openapi-python-client - name: openapi-python-client
html_url: https://github.com/openapi-generators/openapi-python-client html_url: https://github.com/openapi-generators/openapi-python-client
stars: 1879 stars: 1900
owner_login: openapi-generators owner_login: openapi-generators
owner_html_url: https://github.com/openapi-generators owner_html_url: https://github.com/openapi-generators
- name: manage-fastapi
html_url: https://github.com/ycd/manage-fastapi
stars: 1894
owner_login: ycd
owner_html_url: https://github.com/ycd
- name: slowapi - name: slowapi
html_url: https://github.com/laurentS/slowapi html_url: https://github.com/laurentS/slowapi
stars: 1845 stars: 1891
owner_login: laurentS owner_login: laurentS
owner_html_url: https://github.com/laurentS owner_html_url: https://github.com/laurentS
- name: piccolo - name: piccolo
html_url: https://github.com/piccolo-orm/piccolo html_url: https://github.com/piccolo-orm/piccolo
stars: 1843 stars: 1854
owner_login: piccolo-orm owner_login: piccolo-orm
owner_html_url: https://github.com/piccolo-orm owner_html_url: https://github.com/piccolo-orm
- name: fastapi-cache
html_url: https://github.com/long2ice/fastapi-cache
stars: 1816
owner_login: long2ice
owner_html_url: https://github.com/long2ice
- name: python-week-2022 - name: python-week-2022
html_url: https://github.com/rochacbruno/python-week-2022 html_url: https://github.com/rochacbruno/python-week-2022
stars: 1813 stars: 1813
owner_login: rochacbruno owner_login: rochacbruno
owner_html_url: https://github.com/rochacbruno owner_html_url: https://github.com/rochacbruno
- name: fastapi-cache
html_url: https://github.com/long2ice/fastapi-cache
stars: 1805
owner_login: long2ice
owner_html_url: https://github.com/long2ice
- name: ormar - name: ormar
html_url: https://github.com/collerek/ormar html_url: https://github.com/collerek/ormar
stars: 1785 stars: 1797
owner_login: collerek owner_login: collerek
owner_html_url: https://github.com/collerek owner_html_url: https://github.com/collerek
- name: fastapi-langgraph-agent-production-ready-template
html_url: https://github.com/wassim249/fastapi-langgraph-agent-production-ready-template
stars: 1780
owner_login: wassim249
owner_html_url: https://github.com/wassim249
- name: FastAPI-boilerplate - name: FastAPI-boilerplate
html_url: https://github.com/benavlabs/FastAPI-boilerplate html_url: https://github.com/benavlabs/FastAPI-boilerplate
stars: 1734 stars: 1792
owner_login: benavlabs owner_login: benavlabs
owner_html_url: https://github.com/benavlabs owner_html_url: https://github.com/benavlabs
- name: termpair - name: termpair
html_url: https://github.com/cs01/termpair html_url: https://github.com/cs01/termpair
stars: 1724 stars: 1727
owner_login: cs01 owner_login: cs01
owner_html_url: https://github.com/cs01 owner_html_url: https://github.com/cs01
- name: fastapi-crudrouter - name: fastapi-crudrouter
html_url: https://github.com/awtkns/fastapi-crudrouter html_url: https://github.com/awtkns/fastapi-crudrouter
stars: 1671 stars: 1677
owner_login: awtkns owner_login: awtkns
owner_html_url: https://github.com/awtkns owner_html_url: https://github.com/awtkns
- name: langchain-serve - name: langchain-serve
html_url: https://github.com/jina-ai/langchain-serve html_url: https://github.com/jina-ai/langchain-serve
stars: 1633 stars: 1634
owner_login: jina-ai owner_login: jina-ai
owner_html_url: https://github.com/jina-ai owner_html_url: https://github.com/jina-ai
- name: fastapi-pagination - name: fastapi-pagination
html_url: https://github.com/uriyyo/fastapi-pagination html_url: https://github.com/uriyyo/fastapi-pagination
stars: 1588 stars: 1607
owner_login: uriyyo owner_login: uriyyo
owner_html_url: https://github.com/uriyyo owner_html_url: https://github.com/uriyyo
- name: awesome-fastapi-projects - name: awesome-fastapi-projects
html_url: https://github.com/Kludex/awesome-fastapi-projects html_url: https://github.com/Kludex/awesome-fastapi-projects
stars: 1583 stars: 1592
owner_login: Kludex owner_login: Kludex
owner_html_url: https://github.com/Kludex owner_html_url: https://github.com/Kludex
- name: coronavirus-tracker-api
html_url: https://github.com/ExpDev07/coronavirus-tracker-api
stars: 1571
owner_login: ExpDev07
owner_html_url: https://github.com/ExpDev07
- name: bracket - name: bracket
html_url: https://github.com/evroon/bracket html_url: https://github.com/evroon/bracket
stars: 1549 stars: 1580
owner_login: evroon owner_login: evroon
owner_html_url: https://github.com/evroon owner_html_url: https://github.com/evroon
- name: coronavirus-tracker-api
html_url: https://github.com/ExpDev07/coronavirus-tracker-api
stars: 1570
owner_login: ExpDev07
owner_html_url: https://github.com/ExpDev07
- name: fastapi-amis-admin - name: fastapi-amis-admin
html_url: https://github.com/amisadmin/fastapi-amis-admin html_url: https://github.com/amisadmin/fastapi-amis-admin
stars: 1491 stars: 1512
owner_login: amisadmin owner_login: amisadmin
owner_html_url: https://github.com/amisadmin owner_html_url: https://github.com/amisadmin
- name: fastapi-boilerplate
html_url: https://github.com/teamhide/fastapi-boilerplate
stars: 1452
owner_login: teamhide
owner_html_url: https://github.com/teamhide
- name: fastcrud - name: fastcrud
html_url: https://github.com/benavlabs/fastcrud html_url: https://github.com/benavlabs/fastcrud
stars: 1452 stars: 1471
owner_login: benavlabs owner_login: benavlabs
owner_html_url: https://github.com/benavlabs owner_html_url: https://github.com/benavlabs
- name: fastapi-boilerplate
html_url: https://github.com/teamhide/fastapi-boilerplate
stars: 1461
owner_login: teamhide
owner_html_url: https://github.com/teamhide
- name: awesome-python-resources - name: awesome-python-resources
html_url: https://github.com/DjangoEx/awesome-python-resources html_url: https://github.com/DjangoEx/awesome-python-resources
stars: 1430 stars: 1435
owner_login: DjangoEx owner_login: DjangoEx
owner_html_url: https://github.com/DjangoEx owner_html_url: https://github.com/DjangoEx
- name: prometheus-fastapi-instrumentator - name: prometheus-fastapi-instrumentator
html_url: https://github.com/trallnag/prometheus-fastapi-instrumentator html_url: https://github.com/trallnag/prometheus-fastapi-instrumentator
stars: 1399 stars: 1417
owner_login: trallnag owner_login: trallnag
owner_html_url: https://github.com/trallnag owner_html_url: https://github.com/trallnag
- name: fastapi-code-generator - name: fastapi-code-generator
html_url: https://github.com/koxudaxi/fastapi-code-generator html_url: https://github.com/koxudaxi/fastapi-code-generator
stars: 1371 stars: 1382
owner_login: koxudaxi owner_login: koxudaxi
owner_html_url: https://github.com/koxudaxi owner_html_url: https://github.com/koxudaxi
- name: fastapi-scaff
html_url: https://github.com/atpuxiner/fastapi-scaff
stars: 1367
owner_login: atpuxiner
owner_html_url: https://github.com/atpuxiner
- name: fastapi-tutorial - name: fastapi-tutorial
html_url: https://github.com/liaogx/fastapi-tutorial html_url: https://github.com/liaogx/fastapi-tutorial
stars: 1346 stars: 1360
owner_login: liaogx owner_login: liaogx
owner_html_url: https://github.com/liaogx owner_html_url: https://github.com/liaogx
- name: budgetml - name: budgetml
html_url: https://github.com/ebhy/budgetml html_url: https://github.com/ebhy/budgetml
stars: 1345 stars: 1343
owner_login: ebhy owner_login: ebhy
owner_html_url: https://github.com/ebhy owner_html_url: https://github.com/ebhy
- name: fastapi-scaff
html_url: https://github.com/atpuxiner/fastapi-scaff
stars: 1331
owner_login: atpuxiner
owner_html_url: https://github.com/atpuxiner
- name: bolt-python - name: bolt-python
html_url: https://github.com/slackapi/bolt-python html_url: https://github.com/slackapi/bolt-python
stars: 1266 stars: 1276
owner_login: slackapi owner_login: slackapi
owner_html_url: https://github.com/slackapi owner_html_url: https://github.com/slackapi
- name: bedrock-chat - name: bedrock-chat
html_url: https://github.com/aws-samples/bedrock-chat html_url: https://github.com/aws-samples/bedrock-chat
stars: 1266 stars: 1268
owner_login: aws-samples owner_login: aws-samples
owner_html_url: https://github.com/aws-samples owner_html_url: https://github.com/aws-samples
- name: fastapi-alembic-sqlmodel-async - name: fastapi-alembic-sqlmodel-async
html_url: https://github.com/jonra1993/fastapi-alembic-sqlmodel-async html_url: https://github.com/vargasjona/fastapi-alembic-sqlmodel-async
stars: 1260 stars: 1265
owner_login: jonra1993 owner_login: vargasjona
owner_html_url: https://github.com/jonra1993 owner_html_url: https://github.com/vargasjona
- name: fastapi_production_template - name: fastapi_production_template
html_url: https://github.com/zhanymkanov/fastapi_production_template html_url: https://github.com/zhanymkanov/fastapi_production_template
stars: 1222 stars: 1227
owner_login: zhanymkanov owner_login: zhanymkanov
owner_html_url: https://github.com/zhanymkanov owner_html_url: https://github.com/zhanymkanov
- name: langchain-extract
html_url: https://github.com/langchain-ai/langchain-extract
stars: 1179
owner_login: langchain-ai
owner_html_url: https://github.com/langchain-ai
- name: restish - name: restish
html_url: https://github.com/rest-sh/restish html_url: https://github.com/rest-sh/restish
stars: 1152 stars: 1200
owner_login: rest-sh owner_login: rest-sh
owner_html_url: https://github.com/rest-sh owner_html_url: https://github.com/rest-sh
- name: langchain-extract
html_url: https://github.com/langchain-ai/langchain-extract
stars: 1183
owner_login: langchain-ai
owner_html_url: https://github.com/langchain-ai
- name: odmantic - name: odmantic
html_url: https://github.com/art049/odmantic html_url: https://github.com/art049/odmantic
stars: 1143 stars: 1162
owner_login: art049 owner_login: art049
owner_html_url: https://github.com/art049 owner_html_url: https://github.com/art049
- name: authx
html_url: https://github.com/yezz123/authx
stars: 1128
owner_login: yezz123
owner_html_url: https://github.com/yezz123
- name: SAG
html_url: https://github.com/Zleap-AI/SAG
stars: 1104
owner_login: Zleap-AI
owner_html_url: https://github.com/Zleap-AI
- name: aktools - name: aktools
html_url: https://github.com/akfamily/aktools html_url: https://github.com/akfamily/aktools
stars: 1072 stars: 1155
owner_login: akfamily owner_login: akfamily
owner_html_url: https://github.com/akfamily owner_html_url: https://github.com/akfamily
- name: RuoYi-Vue3-FastAPI - name: RuoYi-Vue3-FastAPI
html_url: https://github.com/insistence/RuoYi-Vue3-FastAPI html_url: https://github.com/insistence/RuoYi-Vue3-FastAPI
stars: 1063 stars: 1155
owner_login: insistence owner_login: insistence
owner_html_url: https://github.com/insistence owner_html_url: https://github.com/insistence
- name: authx
html_url: https://github.com/yezz123/authx
stars: 1142
owner_login: yezz123
owner_html_url: https://github.com/yezz123
- name: SAG
html_url: https://github.com/Zleap-AI/SAG
stars: 1110
owner_login: Zleap-AI
owner_html_url: https://github.com/Zleap-AI
- name: flock - name: flock
html_url: https://github.com/Onelevenvy/flock html_url: https://github.com/Onelevenvy/flock
stars: 1059 stars: 1069
owner_login: Onelevenvy owner_login: Onelevenvy
owner_html_url: https://github.com/Onelevenvy owner_html_url: https://github.com/Onelevenvy
- name: fastapi-observability - name: fastapi-observability
html_url: https://github.com/blueswen/fastapi-observability html_url: https://github.com/blueswen/fastapi-observability
stars: 1046 stars: 1063
owner_login: blueswen owner_login: blueswen
owner_html_url: https://github.com/blueswen owner_html_url: https://github.com/blueswen
- name: enterprise-deep-research - name: enterprise-deep-research
html_url: https://github.com/SalesforceAIResearch/enterprise-deep-research html_url: https://github.com/SalesforceAIResearch/enterprise-deep-research
stars: 1019 stars: 1061
owner_login: SalesforceAIResearch owner_login: SalesforceAIResearch
owner_html_url: https://github.com/SalesforceAIResearch owner_html_url: https://github.com/SalesforceAIResearch
- name: titiler - name: titiler
html_url: https://github.com/developmentseed/titiler html_url: https://github.com/developmentseed/titiler
stars: 1016 stars: 1039
owner_login: developmentseed owner_login: developmentseed
owner_html_url: https://github.com/developmentseed owner_html_url: https://github.com/developmentseed
- name: every-pdf - name: every-pdf
html_url: https://github.com/DDULDDUCK/every-pdf html_url: https://github.com/DDULDDUCK/every-pdf
stars: 1004 stars: 1017
owner_login: DDULDDUCK owner_login: DDULDDUCK
owner_html_url: https://github.com/DDULDDUCK owner_html_url: https://github.com/DDULDDUCK
- name: autollm - name: autollm
html_url: https://github.com/viddexa/autollm html_url: https://github.com/viddexa/autollm
stars: 1003 stars: 1005
owner_login: viddexa owner_login: viddexa
owner_html_url: https://github.com/viddexa owner_html_url: https://github.com/viddexa
- name: lanarky - name: lanarky
html_url: https://github.com/ajndkr/lanarky html_url: https://github.com/ajndkr/lanarky
stars: 996 stars: 995
owner_login: ajndkr owner_login: ajndkr
owner_html_url: https://github.com/ajndkr owner_html_url: https://github.com/ajndkr

114
docs/en/data/translation_reviewers.yml

@ -10,12 +10,12 @@ Xewus:
url: https://github.com/Xewus url: https://github.com/Xewus
sodaMelon: sodaMelon:
login: sodaMelon login: sodaMelon
count: 127 count: 128
avatarUrl: https://avatars.githubusercontent.com/u/66295123?u=be939db90f1119efee9e6110cc05066ff1f40f00&v=4 avatarUrl: https://avatars.githubusercontent.com/u/66295123?u=be939db90f1119efee9e6110cc05066ff1f40f00&v=4
url: https://github.com/sodaMelon url: https://github.com/sodaMelon
ceb10n: ceb10n:
login: ceb10n login: ceb10n
count: 117 count: 119
avatarUrl: https://avatars.githubusercontent.com/u/235213?u=edcce471814a1eba9f0cdaa4cd0de18921a940a6&v=4 avatarUrl: https://avatars.githubusercontent.com/u/235213?u=edcce471814a1eba9f0cdaa4cd0de18921a940a6&v=4
url: https://github.com/ceb10n url: https://github.com/ceb10n
tokusumi: tokusumi:
@ -25,7 +25,7 @@ tokusumi:
url: https://github.com/tokusumi url: https://github.com/tokusumi
hard-coders: hard-coders:
login: hard-coders login: hard-coders
count: 96 count: 102
avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=78d12d1acdf853c817700145e73de7fd9e5d068b&v=4 avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=78d12d1acdf853c817700145e73de7fd9e5d068b&v=4
url: https://github.com/hard-coders url: https://github.com/hard-coders
hasansezertasan: hasansezertasan:
@ -50,7 +50,7 @@ AlertRED:
url: https://github.com/AlertRED url: https://github.com/AlertRED
tiangolo: tiangolo:
login: tiangolo login: tiangolo
count: 73 count: 78
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4
url: https://github.com/tiangolo url: https://github.com/tiangolo
Alexandrhub: Alexandrhub:
@ -58,26 +58,31 @@ Alexandrhub:
count: 68 count: 68
avatarUrl: https://avatars.githubusercontent.com/u/119126536?u=9fc0d48f3307817bafecc5861eb2168401a6cb04&v=4 avatarUrl: https://avatars.githubusercontent.com/u/119126536?u=9fc0d48f3307817bafecc5861eb2168401a6cb04&v=4
url: https://github.com/Alexandrhub url: https://github.com/Alexandrhub
cassiobotaro:
login: cassiobotaro
count: 64
avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=a08022b191ddbd0a6159b2981d9d878b6d5bb71f&v=4
url: https://github.com/cassiobotaro
waynerv: waynerv:
login: waynerv login: waynerv
count: 63 count: 63
avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4
url: https://github.com/waynerv url: https://github.com/waynerv
cassiobotaro: nilslindemann:
login: cassiobotaro login: nilslindemann
count: 62 count: 61
avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=a08022b191ddbd0a6159b2981d9d878b6d5bb71f&v=4 avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
url: https://github.com/cassiobotaro url: https://github.com/nilslindemann
mattwang44: mattwang44:
login: mattwang44 login: mattwang44
count: 61 count: 61
avatarUrl: https://avatars.githubusercontent.com/u/24987826?u=58e37fb3927b9124b458945ac4c97aa0f1062d85&v=4 avatarUrl: https://avatars.githubusercontent.com/u/24987826?u=58e37fb3927b9124b458945ac4c97aa0f1062d85&v=4
url: https://github.com/mattwang44 url: https://github.com/mattwang44
nilslindemann: YuriiMotov:
login: nilslindemann login: YuriiMotov
count: 59 count: 56
avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4 avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=bc48be95c429989224786106b027f3c5e40cc354&v=4
url: https://github.com/nilslindemann url: https://github.com/YuriiMotov
Laineyzhang55: Laineyzhang55:
login: Laineyzhang55 login: Laineyzhang55
count: 48 count: 48
@ -88,26 +93,21 @@ Kludex:
count: 47 count: 47
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=df8a3f06ba8f55ae1967a3e2d5ed882903a4e330&v=4 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=df8a3f06ba8f55ae1967a3e2d5ed882903a4e330&v=4
url: https://github.com/Kludex url: https://github.com/Kludex
YuriiMotov:
login: YuriiMotov
count: 46
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=b9b13d598dddfab529a52d264df80a900bfe7060&v=4
url: https://github.com/YuriiMotov
komtaki: komtaki:
login: komtaki login: komtaki
count: 45 count: 45
avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=260ad6b1a4b34c07dbfa728da5e586f16f6d1824&v=4 avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=260ad6b1a4b34c07dbfa728da5e586f16f6d1824&v=4
url: https://github.com/komtaki url: https://github.com/komtaki
svlandeg:
login: svlandeg
count: 43
avatarUrl: https://avatars.githubusercontent.com/u/8796347?u=556c97650c27021911b0b9447ec55e75987b0e8a&v=4
url: https://github.com/svlandeg
rostik1410: rostik1410:
login: rostik1410 login: rostik1410
count: 42 count: 42
avatarUrl: https://avatars.githubusercontent.com/u/11443899?u=e26a635c2ba220467b308a326a579b8ccf4a8701&v=4 avatarUrl: https://avatars.githubusercontent.com/u/11443899?u=e26a635c2ba220467b308a326a579b8ccf4a8701&v=4
url: https://github.com/rostik1410 url: https://github.com/rostik1410
svlandeg:
login: svlandeg
count: 42
avatarUrl: https://avatars.githubusercontent.com/u/8796347?u=556c97650c27021911b0b9447ec55e75987b0e8a&v=4
url: https://github.com/svlandeg
alperiox: alperiox:
login: alperiox login: alperiox
count: 42 count: 42
@ -136,7 +136,7 @@ JavierSanchezCastro:
alejsdev: alejsdev:
login: alejsdev login: alejsdev
count: 37 count: 37
avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=85ceac49fb87138aebe8d663912e359447329090&v=4 avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=0facffe3abf87f57a1f05fa773d1119cc5c2f6a5&v=4
url: https://github.com/alejsdev url: https://github.com/alejsdev
mezgoodle: mezgoodle:
login: mezgoodle login: mezgoodle
@ -383,6 +383,11 @@ Joao-Pedro-P-Holanda:
count: 16 count: 16
avatarUrl: https://avatars.githubusercontent.com/u/110267046?u=331bd016326dac4cf3df4848f6db2dbbf8b5f978&v=4 avatarUrl: https://avatars.githubusercontent.com/u/110267046?u=331bd016326dac4cf3df4848f6db2dbbf8b5f978&v=4
url: https://github.com/Joao-Pedro-P-Holanda url: https://github.com/Joao-Pedro-P-Holanda
maru0123-2004:
login: maru0123-2004
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/43961566?u=16ed8603a4d6a4665cb6c53a7aece6f31379b769&v=4
url: https://github.com/maru0123-2004
JaeHyuckSa: JaeHyuckSa:
login: JaeHyuckSa login: JaeHyuckSa
count: 16 count: 16
@ -418,11 +423,6 @@ mattkoehne:
count: 14 count: 14
avatarUrl: https://avatars.githubusercontent.com/u/80362153?v=4 avatarUrl: https://avatars.githubusercontent.com/u/80362153?v=4
url: https://github.com/mattkoehne url: https://github.com/mattkoehne
maru0123-2004:
login: maru0123-2004
count: 14
avatarUrl: https://avatars.githubusercontent.com/u/43961566?u=16ed8603a4d6a4665cb6c53a7aece6f31379b769&v=4
url: https://github.com/maru0123-2004
jovicon: jovicon:
login: jovicon login: jovicon
count: 13 count: 13
@ -458,6 +458,11 @@ wesinalves:
count: 13 count: 13
avatarUrl: https://avatars.githubusercontent.com/u/13563128?u=9eb17ed50645dd684bfec47e75dba4e9772ec9c1&v=4 avatarUrl: https://avatars.githubusercontent.com/u/13563128?u=9eb17ed50645dd684bfec47e75dba4e9772ec9c1&v=4
url: https://github.com/wesinalves url: https://github.com/wesinalves
andersonrocha0:
login: andersonrocha0
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/22346169?u=93a1359c8c5461d894802c0cc65bcd09217e7a02&v=4
url: https://github.com/andersonrocha0
NastasiaSaby: NastasiaSaby:
login: NastasiaSaby login: NastasiaSaby
count: 12 count: 12
@ -471,7 +476,7 @@ oandersonmagalhaes:
mkdir700: mkdir700:
login: mkdir700 login: mkdir700
count: 12 count: 12
avatarUrl: https://avatars.githubusercontent.com/u/56359329?u=3d6ea8714f5000829b60dcf7b13a75b1e73aaf47&v=4 avatarUrl: https://avatars.githubusercontent.com/u/56359329?u=818e5f4b4dcc1a6ffb3e5aaa08fd827e5a726dfd&v=4
url: https://github.com/mkdir700 url: https://github.com/mkdir700
batlopes: batlopes:
login: batlopes login: batlopes
@ -493,11 +498,6 @@ KaniKim:
count: 12 count: 12
avatarUrl: https://avatars.githubusercontent.com/u/19832624?u=296dbdd490e0eb96e3d45a2608c065603b17dc31&v=4 avatarUrl: https://avatars.githubusercontent.com/u/19832624?u=296dbdd490e0eb96e3d45a2608c065603b17dc31&v=4
url: https://github.com/KaniKim url: https://github.com/KaniKim
andersonrocha0:
login: andersonrocha0
count: 12
avatarUrl: https://avatars.githubusercontent.com/u/22346169?u=93a1359c8c5461d894802c0cc65bcd09217e7a02&v=4
url: https://github.com/andersonrocha0
gitgernit: gitgernit:
login: gitgernit login: gitgernit
count: 12 count: 12
@ -558,6 +558,11 @@ Zhongheng-Cheng:
count: 11 count: 11
avatarUrl: https://avatars.githubusercontent.com/u/95612344?u=a0f7730a3cc7486827965e01a119ad610bda4b0a&v=4 avatarUrl: https://avatars.githubusercontent.com/u/95612344?u=a0f7730a3cc7486827965e01a119ad610bda4b0a&v=4
url: https://github.com/Zhongheng-Cheng url: https://github.com/Zhongheng-Cheng
Pyth3rEx:
login: Pyth3rEx
count: 11
avatarUrl: https://avatars.githubusercontent.com/u/26427764?u=087724f74d813c95925d51e354554bd4b6d6bb60&v=4
url: https://github.com/Pyth3rEx
mariacamilagl: mariacamilagl:
login: mariacamilagl login: mariacamilagl
count: 10 count: 10
@ -611,7 +616,7 @@ socket-socket:
nick-cjyx9: nick-cjyx9:
login: nick-cjyx9 login: nick-cjyx9
count: 10 count: 10
avatarUrl: https://avatars.githubusercontent.com/u/119087246?u=7227a2de948c68fb8396d5beff1ee5b0e057c42e&v=4 avatarUrl: https://avatars.githubusercontent.com/u/119087246?u=3d51dcbd79222ecb6538642f31dc7c8bb708d191&v=4
url: https://github.com/nick-cjyx9 url: https://github.com/nick-cjyx9
marcelomarkus: marcelomarkus:
login: marcelomarkus login: marcelomarkus
@ -683,11 +688,6 @@ Yarous:
count: 9 count: 9
avatarUrl: https://avatars.githubusercontent.com/u/61277193?u=5b462347458a373b2d599c6f416d2b75eddbffad&v=4 avatarUrl: https://avatars.githubusercontent.com/u/61277193?u=5b462347458a373b2d599c6f416d2b75eddbffad&v=4
url: https://github.com/Yarous url: https://github.com/Yarous
Pyth3rEx:
login: Pyth3rEx
count: 9
avatarUrl: https://avatars.githubusercontent.com/u/26427764?u=087724f74d813c95925d51e354554bd4b6d6bb60&v=4
url: https://github.com/Pyth3rEx
dimaqq: dimaqq:
login: dimaqq login: dimaqq
count: 8 count: 8
@ -736,7 +736,7 @@ minaton-ru:
sungchan1: sungchan1:
login: sungchan1 login: sungchan1
count: 8 count: 8
avatarUrl: https://avatars.githubusercontent.com/u/28076127?u=a816d86ef3e60450a7225f128caf9a394c9320f9&v=4 avatarUrl: https://avatars.githubusercontent.com/u/28076127?u=fadbf24840186aca639d344bb3e0ecf7ff3441cf&v=4
url: https://github.com/sungchan1 url: https://github.com/sungchan1
Serrones: Serrones:
login: Serrones login: Serrones
@ -761,7 +761,7 @@ anthonycepeda:
fabioueno: fabioueno:
login: fabioueno login: fabioueno
count: 7 count: 7
avatarUrl: https://avatars.githubusercontent.com/u/14273852?u=edd700982b16317ac6ebfd24c47bc0029b21d360&v=4 avatarUrl: https://avatars.githubusercontent.com/u/14273852?u=a3d546449cdc96621c32bcc26cf74be6e4390209&v=4
url: https://github.com/fabioueno url: https://github.com/fabioueno
cfraboulet: cfraboulet:
login: cfraboulet login: cfraboulet
@ -793,6 +793,11 @@ Zerohertz:
count: 7 count: 7
avatarUrl: https://avatars.githubusercontent.com/u/42334717?u=5ebf4d33e73b1ad373154f6cdee44f7cab4d05ba&v=4 avatarUrl: https://avatars.githubusercontent.com/u/42334717?u=5ebf4d33e73b1ad373154f6cdee44f7cab4d05ba&v=4
url: https://github.com/Zerohertz url: https://github.com/Zerohertz
EdmilsonRodrigues:
login: EdmilsonRodrigues
count: 7
avatarUrl: https://avatars.githubusercontent.com/u/62777025?u=217d6f3cd6cc750bb8818a3af7726c8d74eb7c2d&v=4
url: https://github.com/EdmilsonRodrigues
deniscapeto: deniscapeto:
login: deniscapeto login: deniscapeto
count: 6 count: 6
@ -1028,11 +1033,6 @@ devluisrodrigues:
count: 5 count: 5
avatarUrl: https://avatars.githubusercontent.com/u/21125286?v=4 avatarUrl: https://avatars.githubusercontent.com/u/21125286?v=4
url: https://github.com/11kkw url: https://github.com/11kkw
EdmilsonRodrigues:
login: EdmilsonRodrigues
count: 5
avatarUrl: https://avatars.githubusercontent.com/u/62777025?u=217d6f3cd6cc750bb8818a3af7726c8d74eb7c2d&v=4
url: https://github.com/EdmilsonRodrigues
lpdswing: lpdswing:
login: lpdswing login: lpdswing
count: 4 count: 4
@ -1178,6 +1178,11 @@ SBillion:
count: 4 count: 4
avatarUrl: https://avatars.githubusercontent.com/u/1070649?u=3ab493dfc88b39da0eb1600e3b8e7df1c90a5dee&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1070649?u=3ab493dfc88b39da0eb1600e3b8e7df1c90a5dee&v=4
url: https://github.com/SBillion url: https://github.com/SBillion
seuthootDev:
login: seuthootDev
count: 4
avatarUrl: https://avatars.githubusercontent.com/u/175179350?u=7c2cbc48ab43b52e0c86592111d92e013d72ea4d&v=4
url: https://github.com/seuthootDev
tyronedamasceno: tyronedamasceno:
login: tyronedamasceno login: tyronedamasceno
count: 3 count: 3
@ -1266,7 +1271,7 @@ rafsaf:
frnsimoes: frnsimoes:
login: frnsimoes login: frnsimoes
count: 3 count: 3
avatarUrl: https://avatars.githubusercontent.com/u/66239468?u=fd8d408946633acc4bea057c207e6c0833871527&v=4 avatarUrl: https://avatars.githubusercontent.com/u/66239468?u=cba345870d8d6b25dd6d56ee18f7120581e3c573&v=4
url: https://github.com/frnsimoes url: https://github.com/frnsimoes
lieryan: lieryan:
login: lieryan login: lieryan
@ -1593,6 +1598,11 @@ ayr-ton:
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/1090517?u=5cf70a0e0f0dbf084e074e494aa94d7c91a46ba6&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1090517?u=5cf70a0e0f0dbf084e074e494aa94d7c91a46ba6&v=4
url: https://github.com/ayr-ton url: https://github.com/ayr-ton
Kadermiyanyedi:
login: Kadermiyanyedi
count: 2
avatarUrl: https://avatars.githubusercontent.com/u/48386782?u=e34f31bf50a8ed8d37fbfa4f301b0c190b1b4b86&v=4
url: https://github.com/Kadermiyanyedi
raphaelauv: raphaelauv:
login: raphaelauv login: raphaelauv
count: 2 count: 2
@ -1831,7 +1841,7 @@ EgorOnishchuk:
iamantonreznik: iamantonreznik:
login: iamantonreznik login: iamantonreznik
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/112612414?u=bf6de9a1ab17326fe14de0709719fff3826526d0&v=4 avatarUrl: https://avatars.githubusercontent.com/u/112612414?u=b9ba8d9b4d3940198bc3a4353dfce70c044a39b1&v=4
url: https://github.com/iamantonreznik url: https://github.com/iamantonreznik
Azazul123: Azazul123:
login: Azazul123 login: Azazul123
@ -1851,7 +1861,7 @@ NavesSapnis:
isgin01: isgin01:
login: isgin01 login: isgin01
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/157279130?u=ddffde10876b50f35dc90d1337f507a630530a6a&v=4 avatarUrl: https://avatars.githubusercontent.com/u/157279130?u=16d6466476cf7dbc55a4cd575b6ea920ebdd81e1&v=4
url: https://github.com/isgin01 url: https://github.com/isgin01
syedasamina56: syedasamina56:
login: syedasamina56 login: syedasamina56

43
docs/en/data/translators.yml

@ -8,9 +8,14 @@ jaystone776:
count: 46 count: 46
avatarUrl: https://avatars.githubusercontent.com/u/11191137?u=299205a95e9b6817a43144a48b643346a5aac5cc&v=4 avatarUrl: https://avatars.githubusercontent.com/u/11191137?u=299205a95e9b6817a43144a48b643346a5aac5cc&v=4
url: https://github.com/jaystone776 url: https://github.com/jaystone776
tiangolo:
login: tiangolo
count: 31
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4
url: https://github.com/tiangolo
ceb10n: ceb10n:
login: ceb10n login: ceb10n
count: 29 count: 30
avatarUrl: https://avatars.githubusercontent.com/u/235213?u=edcce471814a1eba9f0cdaa4cd0de18921a940a6&v=4 avatarUrl: https://avatars.githubusercontent.com/u/235213?u=edcce471814a1eba9f0cdaa4cd0de18921a940a6&v=4
url: https://github.com/ceb10n url: https://github.com/ceb10n
valentinDruzhinin: valentinDruzhinin:
@ -28,11 +33,6 @@ SwftAlpc:
count: 23 count: 23
avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4 avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4
url: https://github.com/SwftAlpc url: https://github.com/SwftAlpc
tiangolo:
login: tiangolo
count: 22
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4
url: https://github.com/tiangolo
hasansezertasan: hasansezertasan:
login: hasansezertasan login: hasansezertasan
count: 22 count: 22
@ -43,16 +43,16 @@ waynerv:
count: 20 count: 20
avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4
url: https://github.com/waynerv url: https://github.com/waynerv
hard-coders:
login: hard-coders
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=78d12d1acdf853c817700145e73de7fd9e5d068b&v=4
url: https://github.com/hard-coders
AlertRED: AlertRED:
login: AlertRED login: AlertRED
count: 16 count: 16
avatarUrl: https://avatars.githubusercontent.com/u/15695000?u=f5a4944c6df443030409c88da7d7fa0b7ead985c&v=4 avatarUrl: https://avatars.githubusercontent.com/u/15695000?u=f5a4944c6df443030409c88da7d7fa0b7ead985c&v=4
url: https://github.com/AlertRED url: https://github.com/AlertRED
hard-coders:
login: hard-coders
count: 15
avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=78d12d1acdf853c817700145e73de7fd9e5d068b&v=4
url: https://github.com/hard-coders
Joao-Pedro-P-Holanda: Joao-Pedro-P-Holanda:
login: Joao-Pedro-P-Holanda login: Joao-Pedro-P-Holanda
count: 14 count: 14
@ -108,6 +108,11 @@ pablocm83:
count: 8 count: 8
avatarUrl: https://avatars.githubusercontent.com/u/28315068?u=3310fbb05bb8bfc50d2c48b6cb64ac9ee4a14549&v=4 avatarUrl: https://avatars.githubusercontent.com/u/28315068?u=3310fbb05bb8bfc50d2c48b6cb64ac9ee4a14549&v=4
url: https://github.com/pablocm83 url: https://github.com/pablocm83
YuriiMotov:
login: YuriiMotov
count: 8
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=bc48be95c429989224786106b027f3c5e40cc354&v=4
url: https://github.com/YuriiMotov
ptt3199: ptt3199:
login: ptt3199 login: ptt3199
count: 7 count: 7
@ -133,11 +138,6 @@ Alexandrhub:
count: 6 count: 6
avatarUrl: https://avatars.githubusercontent.com/u/119126536?u=9fc0d48f3307817bafecc5861eb2168401a6cb04&v=4 avatarUrl: https://avatars.githubusercontent.com/u/119126536?u=9fc0d48f3307817bafecc5861eb2168401a6cb04&v=4
url: https://github.com/Alexandrhub url: https://github.com/Alexandrhub
YuriiMotov:
login: YuriiMotov
count: 6
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=b9b13d598dddfab529a52d264df80a900bfe7060&v=4
url: https://github.com/YuriiMotov
Serrones: Serrones:
login: Serrones login: Serrones
count: 5 count: 5
@ -291,7 +291,7 @@ hsuanchi:
alejsdev: alejsdev:
login: alejsdev login: alejsdev
count: 3 count: 3
avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=85ceac49fb87138aebe8d663912e359447329090&v=4 avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=0facffe3abf87f57a1f05fa773d1119cc5c2f6a5&v=4
url: https://github.com/alejsdev url: https://github.com/alejsdev
riroan: riroan:
login: riroan login: riroan
@ -361,7 +361,7 @@ Rishat-F:
ruzia: ruzia:
login: ruzia login: ruzia
count: 3 count: 3
avatarUrl: https://avatars.githubusercontent.com/u/24503?v=4 avatarUrl: https://avatars.githubusercontent.com/u/24503?u=abce66d26c9611818720f11e6ae6773a6e0928f8&v=4
url: https://github.com/ruzia url: https://github.com/ruzia
izaguerreiro: izaguerreiro:
login: izaguerreiro login: izaguerreiro
@ -413,6 +413,11 @@ ayr-ton:
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/1090517?u=5cf70a0e0f0dbf084e074e494aa94d7c91a46ba6&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1090517?u=5cf70a0e0f0dbf084e074e494aa94d7c91a46ba6&v=4
url: https://github.com/ayr-ton url: https://github.com/ayr-ton
Kadermiyanyedi:
login: Kadermiyanyedi
count: 2
avatarUrl: https://avatars.githubusercontent.com/u/48386782?u=e34f31bf50a8ed8d37fbfa4f301b0c190b1b4b86&v=4
url: https://github.com/Kadermiyanyedi
KdHyeon0661: KdHyeon0661:
login: KdHyeon0661 login: KdHyeon0661
count: 2 count: 2
@ -461,7 +466,7 @@ ArtemKhymenko:
hasnatsajid: hasnatsajid:
login: hasnatsajid login: hasnatsajid
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/86589885?u=6668823c3b029bfecf10a8918ed3af1aafb8b15e&v=4 avatarUrl: https://avatars.githubusercontent.com/u/86589885?v=4
url: https://github.com/hasnatsajid url: https://github.com/hasnatsajid
alperiox: alperiox:
login: alperiox login: alperiox

20
docs/en/docs/advanced/wsgi.md

@ -6,13 +6,29 @@ For that, you can use the `WSGIMiddleware` and use it to wrap your WSGI applicat
## Using `WSGIMiddleware` { #using-wsgimiddleware } ## Using `WSGIMiddleware` { #using-wsgimiddleware }
You need to import `WSGIMiddleware`. /// info
This requires installing `a2wsgi` for example with `pip install a2wsgi`.
///
You need to import `WSGIMiddleware` from `a2wsgi`.
Then wrap the WSGI (e.g. Flask) app with the middleware. Then wrap the WSGI (e.g. Flask) app with the middleware.
And then mount that under a path. And then mount that under a path.
{* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *} {* ../../docs_src/wsgi/tutorial001_py39.py hl[1,3,23] *}
/// note
Previously, it was recommended to use `WSGIMiddleware` from `fastapi.middleware.wsgi`, but it is now deprecated.
It’s advised to use the `a2wsgi` package instead. The usage remains the same.
Just ensure that you have the `a2wsgi` package installed and import `WSGIMiddleware` correctly from `a2wsgi`.
///
## Check it { #check-it } ## Check it { #check-it }

6
docs/en/docs/contributing.md

@ -13,7 +13,7 @@ Create a virtual environment and install the required packages with <a href="htt
<div class="termy"> <div class="termy">
```console ```console
$ uv sync $ uv sync --extra all
---> 100% ---> 100%
``` ```
@ -32,9 +32,9 @@ That way, you don't have to "install" your local version to be able to test ever
/// note | Technical Details /// note | Technical Details
This only happens when you install using `uv sync` instead of running `pip install fastapi` directly. This only happens when you install using `uv sync --extra all` instead of running `pip install fastapi` directly.
That is because `uv sync` will install the local version of FastAPI in "editable" mode by default. That is because `uv sync --extra all` will install the local version of FastAPI in "editable" mode by default.
/// ///

4
docs/en/docs/deployment/docker.md

@ -145,8 +145,6 @@ There are other formats and tools to define and install package dependencies.
* Create a `main.py` file with: * Create a `main.py` file with:
```Python ```Python
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -158,7 +156,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```

18
docs/en/docs/index.md

@ -161,8 +161,6 @@ $ pip install "fastapi[standard]"
Create a file `main.py` with: Create a file `main.py` with:
```Python ```Python
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -174,7 +172,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```
@ -183,9 +181,7 @@ def read_item(item_id: int, q: Union[str, None] = None):
If your code uses `async` / `await`, use `async def`: If your code uses `async` / `await`, use `async def`:
```Python hl_lines="9 14" ```Python hl_lines="7 12"
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -197,7 +193,7 @@ async def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
async def read_item(item_id: int, q: Union[str, None] = None): async def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```
@ -288,9 +284,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request.
Declare the body using standard Python types, thanks to Pydantic. Declare the body using standard Python types, thanks to Pydantic.
```Python hl_lines="4 9-12 25-27" ```Python hl_lines="2 7-10 23-25"
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
from pydantic import BaseModel from pydantic import BaseModel
@ -300,7 +294,7 @@ app = FastAPI()
class Item(BaseModel): class Item(BaseModel):
name: str name: str
price: float price: float
is_offer: Union[bool, None] = None is_offer: bool | None = None
@app.get("/") @app.get("/")
@ -309,7 +303,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}

8
docs/en/docs/reference/middleware.md

@ -35,11 +35,3 @@ It can be imported from `fastapi`:
```python ```python
from fastapi.middleware.trustedhost import TrustedHostMiddleware from fastapi.middleware.trustedhost import TrustedHostMiddleware
``` ```
::: fastapi.middleware.wsgi.WSGIMiddleware
It can be imported from `fastapi`:
```python
from fastapi.middleware.wsgi import WSGIMiddleware
```

2
docs/en/docs/reference/request.md

@ -2,6 +2,8 @@
You can declare a parameter in a *path operation function* or dependency to be of type `Request` and then you can access the raw request object directly, without any validation, etc. You can declare a parameter in a *path operation function* or dependency to be of type `Request` and then you can access the raw request object directly, without any validation, etc.
Read more about it in the [FastAPI docs about using Request directly](https://fastapi.tiangolo.com/advanced/using-request-directly/)
You can import it directly from `fastapi`: You can import it directly from `fastapi`:
```python ```python

2
docs/en/docs/reference/response.md

@ -4,6 +4,8 @@ You can declare a parameter in a *path operation function* or dependency to be o
You can also use it directly to create an instance of it and return it from your *path operations*. You can also use it directly to create an instance of it and return it from your *path operations*.
Read more about it in the [FastAPI docs about returning a custom Response](https://fastapi.tiangolo.com/advanced/response-directly/#returning-a-custom-response)
You can import it directly from `fastapi`: You can import it directly from `fastapi`:
```python ```python

2
docs/en/docs/reference/responses.md

@ -56,6 +56,8 @@ There are a couple of custom FastAPI response classes, you can use them to optim
## Starlette Responses ## Starlette Responses
You can read more about all of them in the [FastAPI docs for Custom Response](https://fastapi.tiangolo.com/advanced/custom-response/) and in the [Starlette docs about Responses](https://starlette.dev/responses/).
::: fastapi.responses.FileResponse ::: fastapi.responses.FileResponse
options: options:
members: members:

2
docs/en/docs/reference/security/index.md

@ -28,6 +28,8 @@ from fastapi.security import (
) )
``` ```
Read more about them in the [FastAPI docs about Security](https://fastapi.tiangolo.com/tutorial/security/).
## API Key Security Schemes ## API Key Security Schemes
::: fastapi.security.APIKeyCookie ::: fastapi.security.APIKeyCookie

24
docs/en/docs/reference/websockets.md

@ -2,6 +2,8 @@
When defining WebSockets, you normally declare a parameter of type `WebSocket` and with it you can read data from the client and send data to it. When defining WebSockets, you normally declare a parameter of type `WebSocket` and with it you can read data from the client and send data to it.
Read more about it in the [FastAPI docs for WebSockets](https://fastapi.tiangolo.com/advanced/websockets/)
It is provided directly by Starlette, but you can import it from `fastapi`: It is provided directly by Starlette, but you can import it from `fastapi`:
```python ```python
@ -44,16 +46,6 @@ When you want to define dependencies that should be compatible with both HTTP an
- send_json - send_json
- close - close
When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it.
You can import it directly form `fastapi`:
```python
from fastapi import WebSocketDisconnect
```
::: fastapi.WebSocketDisconnect
## WebSockets - additional classes ## WebSockets - additional classes
Additional classes for handling WebSockets. Additional classes for handling WebSockets.
@ -66,4 +58,16 @@ from fastapi.websockets import WebSocketDisconnect, WebSocketState
::: fastapi.websockets.WebSocketDisconnect ::: fastapi.websockets.WebSocketDisconnect
When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it.
You can import it directly form `fastapi`:
```python
from fastapi import WebSocketDisconnect
```
Read more about it in the [FastAPI docs for WebSockets](https://fastapi.tiangolo.com/advanced/websockets/#handling-disconnections-and-multiple-clients)
::: fastapi.websockets.WebSocketState ::: fastapi.websockets.WebSocketState
`WebSocketState` is an enumeration of the possible states of a WebSocket connection.

32
docs/en/docs/release-notes.md

@ -7,8 +7,27 @@ hide:
## Latest Changes ## Latest Changes
### Features
* 🚸 Improve error message for invalid query parameter type annotations. PR [#14479](https://github.com/fastapi/fastapi/pull/14479) by [@retwish](https://github.com/retwish).
### Fixes
* 🐛 Fix OpenAPI duplication of `anyOf` refs for app-level responses with specified `content` and `model` as `Union`. PR [#14463](https://github.com/fastapi/fastapi/pull/14463) by [@DJMcoder](https://github.com/DJMcoder).
### Refactors
* 💡 Update comment for Pydantic internals. PR [#14814](https://github.com/fastapi/fastapi/pull/14814) by [@tiangolo](https://github.com/tiangolo).
### Docs ### Docs
* 📝 Fix example of license identifier in documentation. PR [#14492](https://github.com/fastapi/fastapi/pull/14492) by [@johnson-earls](https://github.com/johnson-earls).
* 📝 Add banner to translated pages. PR [#14809](https://github.com/fastapi/fastapi/pull/14809) by [@YuriiMotov](https://github.com/YuriiMotov).
* 📝 Add links to related sections of docs to docstrings. PR [#14776](https://github.com/fastapi/fastapi/pull/14776) by [@YuriiMotov](https://github.com/YuriiMotov).
* 📝 Update embedded code examples to Python 3.10 syntax. PR [#14758](https://github.com/fastapi/fastapi/pull/14758) by [@YuriiMotov](https://github.com/YuriiMotov).
* 📝 Fix dependency installation command in `docs/en/docs/contributing.md`. PR [#14757](https://github.com/fastapi/fastapi/pull/14757) by [@YuriiMotov](https://github.com/YuriiMotov).
* 📝 Use return type annotation instead of `response_model` when possible. PR [#14753](https://github.com/fastapi/fastapi/pull/14753) by [@YuriiMotov](https://github.com/YuriiMotov).
* 📝 Use `WSGIMiddleware` from `a2wsgi` instead of deprecated `fastapi.middleware.wsgi.WSGIMiddleware`. PR [#14756](https://github.com/fastapi/fastapi/pull/14756) by [@YuriiMotov](https://github.com/YuriiMotov).
* 📝 Fix minor typos in release notes. PR [#14780](https://github.com/fastapi/fastapi/pull/14780) by [@whyvineet](https://github.com/whyvineet). * 📝 Fix minor typos in release notes. PR [#14780](https://github.com/fastapi/fastapi/pull/14780) by [@whyvineet](https://github.com/whyvineet).
* 🐛 Fix copy button in custom.js. PR [#14722](https://github.com/fastapi/fastapi/pull/14722) by [@fcharrier](https://github.com/fcharrier). * 🐛 Fix copy button in custom.js. PR [#14722](https://github.com/fastapi/fastapi/pull/14722) by [@fcharrier](https://github.com/fcharrier).
* 📝 Add contribution instructions about LLM generated code and comments and automated tools for PRs. PR [#14706](https://github.com/fastapi/fastapi/pull/14706) by [@tiangolo](https://github.com/tiangolo). * 📝 Add contribution instructions about LLM generated code and comments and automated tools for PRs. PR [#14706](https://github.com/fastapi/fastapi/pull/14706) by [@tiangolo](https://github.com/tiangolo).
@ -19,6 +38,8 @@ hide:
### Translations ### Translations
* 🌐 Update translations for uk (update outdated, found by fixer tool). PR [#14739](https://github.com/fastapi/fastapi/pull/14739) by [@YuriiMotov](https://github.com/YuriiMotov).
* 🌐 Update translations for tr (update-outdated). PR [#14745](https://github.com/fastapi/fastapi/pull/14745) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update `llm-prompt.md` for Korean language. PR [#14763](https://github.com/fastapi/fastapi/pull/14763) by [@seuthootDev](https://github.com/seuthootDev). * 🌐 Update `llm-prompt.md` for Korean language. PR [#14763](https://github.com/fastapi/fastapi/pull/14763) by [@seuthootDev](https://github.com/seuthootDev).
* 🌐 Update translations for ko (update outdated, found by fixer tool). PR [#14738](https://github.com/fastapi/fastapi/pull/14738) by [@YuriiMotov](https://github.com/YuriiMotov). * 🌐 Update translations for ko (update outdated, found by fixer tool). PR [#14738](https://github.com/fastapi/fastapi/pull/14738) by [@YuriiMotov](https://github.com/YuriiMotov).
* 🌐 Update translations for de (update-outdated). PR [#14690](https://github.com/fastapi/fastapi/pull/14690) by [@tiangolo](https://github.com/tiangolo). * 🌐 Update translations for de (update-outdated). PR [#14690](https://github.com/fastapi/fastapi/pull/14690) by [@tiangolo](https://github.com/tiangolo).
@ -39,6 +60,17 @@ hide:
### Internal ### Internal
* 🔨 Update translation script to retry if LLM-response doesn't pass validation with Translation Fixer tool. PR [#14749](https://github.com/fastapi/fastapi/pull/14749) by [@YuriiMotov](https://github.com/YuriiMotov).
* 👷 Run tests only on relevant code changes (not on docs). PR [#14813](https://github.com/fastapi/fastapi/pull/14813) by [@tiangolo](https://github.com/tiangolo).
* 👷 Run mypy by pre-commit. PR [#14806](https://github.com/fastapi/fastapi/pull/14806) by [@YuriiMotov](https://github.com/YuriiMotov).
* ⬆ Bump ruff from 0.14.3 to 0.14.14. PR [#14798](https://github.com/fastapi/fastapi/pull/14798) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump pyasn1 from 0.6.1 to 0.6.2. PR [#14804](https://github.com/fastapi/fastapi/pull/14804) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump sqlmodel from 0.0.27 to 0.0.31. PR [#14802](https://github.com/fastapi/fastapi/pull/14802) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump mkdocs-macros-plugin from 1.4.1 to 1.5.0. PR [#14801](https://github.com/fastapi/fastapi/pull/14801) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump gitpython from 3.1.45 to 3.1.46. PR [#14800](https://github.com/fastapi/fastapi/pull/14800) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump typer from 0.16.0 to 0.21.1. PR [#14799](https://github.com/fastapi/fastapi/pull/14799) by [@dependabot[bot]](https://github.com/apps/dependabot).
* 👥 Update FastAPI GitHub topic repositories. PR [#14803](https://github.com/fastapi/fastapi/pull/14803) by [@tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People - Contributors and Translators. PR [#14796](https://github.com/fastapi/fastapi/pull/14796) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Ensure that an edit to `uv.lock` gets the `internal` label. PR [#14759](https://github.com/fastapi/fastapi/pull/14759) by [@svlandeg](https://github.com/svlandeg). * 🔧 Ensure that an edit to `uv.lock` gets the `internal` label. PR [#14759](https://github.com/fastapi/fastapi/pull/14759) by [@svlandeg](https://github.com/svlandeg).
* 🔧 Update sponsors: remove Requestly. PR [#14735](https://github.com/fastapi/fastapi/pull/14735) by [@tiangolo](https://github.com/tiangolo). * 🔧 Update sponsors: remove Requestly. PR [#14735](https://github.com/fastapi/fastapi/pull/14735) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Update sponsors, LambdaTest changes to TestMu AI. PR [#14734](https://github.com/fastapi/fastapi/pull/14734) by [@tiangolo](https://github.com/tiangolo). * 🔧 Update sponsors, LambdaTest changes to TestMu AI. PR [#14734](https://github.com/fastapi/fastapi/pull/14734) by [@tiangolo](https://github.com/tiangolo).

11
docs/en/docs/translation-banner.md

@ -0,0 +1,11 @@
/// details | 🌐 Translation by AI and humans
This translation was made by AI guided by humans. 🤝
It could have mistakes of misunderstanding the original meaning, or looking unnatural, etc. 🤖
You can improve this translation by [helping us guide the AI LLM better](https://fastapi.tiangolo.com/contributing/#translations).
[English version](ENGLISH_VERSION_URL)
///

7
docs/en/docs/tutorial/body-multiple-params.md

@ -103,15 +103,16 @@ Of course, you can also declare additional query parameters whenever you need, a
As, by default, singular values are interpreted as query parameters, you don't have to explicitly add a `Query`, you can just do: As, by default, singular values are interpreted as query parameters, you don't have to explicitly add a `Query`, you can just do:
```Python ```Python
q: Union[str, None] = None q: str | None = None
``` ```
Or in Python 3.10 and above: Or in Python 3.9:
```Python ```Python
q: str | None = None q: Union[str, None] = None
``` ```
For example: For example:
{* ../../docs_src/body_multiple_params/tutorial004_an_py310.py hl[28] *} {* ../../docs_src/body_multiple_params/tutorial004_an_py310.py hl[28] *}

4
docs/en/docs/tutorial/path-operation-configuration.md

@ -52,7 +52,7 @@ In these cases, it could make sense to store the tags in an `Enum`.
You can add a `summary` and `description`: You can add a `summary` and `description`:
{* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[18:19] *} {* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[17:18] *}
## Description from docstring { #description-from-docstring } ## Description from docstring { #description-from-docstring }
@ -70,7 +70,7 @@ It will be used in the interactive docs:
You can specify the response description with the parameter `response_description`: You can specify the response description with the parameter `response_description`:
{* ../../docs_src/path_operation_configuration/tutorial005_py310.py hl[19] *} {* ../../docs_src/path_operation_configuration/tutorial005_py310.py hl[18] *}
/// info /// info

11
docs/ru/docs/translation-banner.md

@ -0,0 +1,11 @@
/// details | 🌐 Перевод выполнен с помощью ИИ и людей
Этот перевод был сделан ИИ под руководством людей. 🤝
В нем могут быть ошибки из-за неправильного понимания оригинального смысла или неестественности и т. д. 🤖
Вы можете улучшить этот перевод, [помогая нам лучше направлять ИИ LLM](https://fastapi.tiangolo.com/ru/contributing/#translations).
[Английская версия](ENGLISH_VERSION_URL)
///

2
docs/tr/docs/about/index.md

@ -1,3 +1,3 @@
# Hakkında # Hakkında { #about }
FastAPI, tasarımı, ilham kaynağı ve daha fazlası hakkında. 🤓 FastAPI, tasarımı, ilham kaynağı ve daha fazlası hakkında. 🤓

31
docs/tr/docs/advanced/index.md

@ -1,36 +1,21 @@
# Gelişmiş Kullanıcı Rehberi # Gelişmiş Kullanıcı Rehberi { #advanced-user-guide }
## Ek Özellikler ## Ek Özellikler { #additional-features }
[Tutorial - User Guide](../tutorial/index.md){.internal-link target=_blank} sayfası **FastAPI**'ın tüm ana özelliklerini tanıtmaya yetecektir. Ana [Tutorial - User Guide](../tutorial/index.md){.internal-link target=_blank} sayfası, **FastAPI**'ın tüm temel özelliklerini tanımanız için yeterli olmalıdır.
İlerleyen bölümlerde diğer seçenekler, konfigürasyonlar ve ek özellikleri göreceğiz. Sonraki bölümlerde diğer seçenekleri, konfigürasyonları ve ek özellikleri göreceksiniz.
/// tip | İpucu /// tip | İpucu
Sonraki bölümler **mutlaka "gelişmiş" olmak zorunda değildir**. Sonraki bölümler **mutlaka "gelişmiş" olmak zorunda değildir**.
Kullanım şeklinize bağlı olarak, çözümünüz bu bölümlerden birinde olabilir. Ve kullanım amacınıza bağlı olarak, çözüm bunlardan birinde olabilir.
/// ///
## Önce Öğreticiyi Okuyun ## Önce Tutorial'ı Okuyun { #read-the-tutorial-first }
[Tutorial - User Guide](../tutorial/index.md){.internal-link target=_blank} sayfasındaki bilgilerle **FastAPI**'nın çoğu özelliğini kullanabilirsiniz. Ana [Tutorial - User Guide](../tutorial/index.md){.internal-link target=_blank} sayfasındaki bilgilerle **FastAPI**'nın çoğu özelliğini yine de kullanabilirsiniz.
Sonraki bölümler bu sayfayı okuduğunuzu ve bu ana fikirleri bildiğinizi varsayarak hazırlanmıştır. Ve sonraki bölümler, onu zaten okuduğunuzu ve bu temel fikirleri bildiğinizi varsayar.
## Diğer Kurslar
[Tutorial - User Guide](../tutorial/index.md){.internal-link target=_blank} sayfası ve bu **Gelişmiş Kullanıcı Rehberi**, öğretici bir kılavuz (bir kitap gibi) şeklinde yazılmıştır ve **FastAPI'ı öğrenmek** için yeterli olsa da, ek kurslarla desteklemek isteyebilirsiniz.
Belki de öğrenme tarzınıza daha iyi uyduğu için başka kursları tercih edebilirsiniz.
Bazı kurs sağlayıcıları ✨ [**FastAPI destekçileridir**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} ✨, bu FastAPI ve **ekosisteminin** sürekli ve sağlıklı bir şekilde **gelişmesini** sağlar.
Ayrıca, size **iyi bir öğrenme deneyimi** sağlamakla kalmayıp, **iyi ve sağlıklı bir framework** olan FastAPI'a ve ve **topluluğuna** (yani size) olan gerçek bağlılıklarını gösterir.
Onların kurslarını denemek isteyebilirsiniz:
* <a href="https://training.talkpython.fm/fastapi-courses" class="external-link" target="_blank">Talk Python Training</a>
* <a href="https://testdriven.io/courses/tdd-fastapi/" class="external-link" target="_blank">Test-Driven Development</a>

12
docs/tr/docs/advanced/security/index.md

@ -1,6 +1,6 @@
# Gelişmiş Güvenlik # Gelişmiş Güvenlik { #advanced-security }
## Ek Özellikler ## Ek Özellikler { #additional-features }
[Tutorial - User Guide: Security](../../tutorial/security/index.md){.internal-link target=_blank} sayfasında ele alınanların dışında güvenlikle ilgili bazı ek özellikler vardır. [Tutorial - User Guide: Security](../../tutorial/security/index.md){.internal-link target=_blank} sayfasında ele alınanların dışında güvenlikle ilgili bazı ek özellikler vardır.
@ -8,12 +8,12 @@
Sonraki bölümler **mutlaka "gelişmiş" olmak zorunda değildir**. Sonraki bölümler **mutlaka "gelişmiş" olmak zorunda değildir**.
Kullanım şeklinize bağlı olarak, çözümünüz bu bölümlerden birinde olabilir. Ve kullanım durumunuza göre, çözüm bu bölümlerden birinde olabilir.
/// ///
## Önce Öğreticiyi Okuyun ## Önce Öğreticiyi Okuyun { #read-the-tutorial-first }
Sonraki bölümler [Tutorial - User Guide: Security](../../tutorial/security/index.md){.internal-link target=_blank} sayfasını okuduğunuzu varsayarak hazırlanmıştır. Sonraki bölümler, ana [Tutorial - User Guide: Security](../../tutorial/security/index.md){.internal-link target=_blank} sayfasını zaten okuduğunuzu varsayar.
Bu bölümler aynı kavramlara dayanır, ancak bazı ek işlevsellikler sağlar. Hepsi aynı kavramlara dayanır, ancak bazı ek işlevselliklere izin verir.

10
docs/tr/docs/advanced/testing-websockets.md

@ -1,13 +1,13 @@
# WebSockets'i Test Etmek # WebSockets'i Test Etmek { #testing-websockets }
WebSockets testi yapmak için `TestClient`'ı kullanabilirsiniz. WebSockets'i test etmek için aynı `TestClient`'ı kullanabilirsiniz.
Bu işlem için, `TestClient`'ı bir `with` ifadesinde kullanarak WebSocket'e bağlanabilirsiniz: Bunun için `TestClient`'ı bir `with` ifadesinde kullanarak WebSocket'e bağlanırsınız:
{* ../../docs_src/app_testing/tutorial002.py hl[27:31] *} {* ../../docs_src/app_testing/tutorial002_py39.py hl[27:31] *}
/// note | Not /// note | Not
Daha fazla detay için Starlette'in <a href="https://www.starlette.dev/staticfiles/" class="external-link" target="_blank">Websockets'i Test Etmek</a> dokümantasyonunu inceleyin. Daha fazla detay için Starlette'in <a href="https://www.starlette.dev/testclient/#testing-websocket-sessions" class="external-link" target="_blank">WebSockets'i test etme</a> dokümantasyonuna bakın.
/// ///

24
docs/tr/docs/advanced/wsgi.md

@ -1,32 +1,32 @@
# WSGI - Flask, Django ve Daha Fazlasını FastAPI ile Kullanma # WSGI'yi Dahil Etme - Flask, Django ve Diğerleri { #including-wsgi-flask-django-others }
WSGI uygulamalarını [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank} bölümlerinde gördüğünüz gibi bağlayabilirsiniz. WSGI uygulamalarını [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank} bölümlerinde gördüğünüz gibi mount edebilirsiniz.
Bunun için `WSGIMiddleware` ile Flask, Django vb. WSGI uygulamanızı sarmalayabilir ve FastAPI'ya bağlayabilirsiniz. Bunun için `WSGIMiddleware`'ı kullanabilir ve bunu WSGI uygulamanızı (örneğin Flask, Django vb.) sarmalamak için kullanabilirsiniz.
## `WSGIMiddleware` Kullanımı ## `WSGIMiddleware` Kullanımı { #using-wsgimiddleware }
`WSGIMiddleware`projenize dahil edin. `WSGIMiddleware`import etmeniz gerekir.
Ardından WSGI (örneğin Flask) uygulamanızı middleware ile sarmalayın. Ardından WSGI (örn. Flask) uygulamasını middleware ile sarmalayın.
Son olarak da bir yol altında bağlama işlemini gerçekleştirin. Ve sonra bunu bir path'in altına mount edin.
{* ../../docs_src/wsgi/tutorial001.py hl[2:3,23] *} {* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *}
## Kontrol Edelim ## Kontrol Edelim { #check-it }
Artık `/v1/` yolunun altındaki her istek Flask uygulaması tarafından işlenecektir. Artık `/v1/` path'i altındaki her request Flask uygulaması tarafından işlenecektir.
Geri kalanı ise **FastAPI** tarafından işlenecektir. Geri kalanı ise **FastAPI** tarafından işlenecektir.
Eğer uygulamanızı çalıştırıp <a href="http://localhost:8000/v1/" class="external-link" target="_blank">http://localhost:8000/v1/</a> adresine giderseniz, Flask'tan gelen yanıtı göreceksiniz: Eğer uygulamanızı çalıştırıp <a href="http://localhost:8000/v1/" class="external-link" target="_blank">http://localhost:8000/v1/</a> adresine giderseniz, Flask'tan gelen response'u göreceksiniz:
```txt ```txt
Hello, World from Flask! Hello, World from Flask!
``` ```
Eğer <a href="http://localhost:8000/v2/" class="external-link" target="_blank">http://localhost:8000/v2/</a> adresine giderseniz, FastAPI'dan gelen yanıtı göreceksiniz: Ve eğer <a href="http://localhost:8000/v2" class="external-link" target="_blank">http://localhost:8000/v2</a> adresine giderseniz, FastAPI'dan gelen response'u göreceksiniz:
```JSON ```JSON
{ {

36
docs/tr/docs/benchmarks.md

@ -1,34 +1,34 @@
# Kıyaslamalar # Kıyaslamalar { #benchmarks }
Bağımsız TechEmpower kıyaslamaları gösteriyor ki <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">en hızlı Python frameworklerinden birisi</a> olan Uvicorn ile çalıştırılan **FastAPI** uygulamaları, sadece Starlette ve Uvicorn'dan daha düşük sıralamada (FastAPI bu frameworklerin üzerine kurulu) yer alıyor. (*) Bağımsız TechEmpower kıyaslamaları, Uvicorn altında çalışan **FastAPI** uygulamalarının <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">mevcut en hızlı Python frameworklerinden biri</a> olduğunu, yalnızca Starlette ve Uvicorn'un kendilerinin altında yer aldığını gösteriyor (FastAPI bunları dahili olarak kullanır).
Fakat kıyaslamaları ve karşılaştırmaları incelerken şunları aklınızda bulundurmalısınız. Fakat kıyaslamaları ve karşılaştırmaları incelerken şunları aklınızda bulundurmalısınız.
## Kıyaslamalar ve Hız ## Kıyaslamalar ve Hız { #benchmarks-and-speed }
Kıyaslamaları incelediğinizde, farklı özelliklere sahip araçların eşdeğer olarak karşılaştırıldığını yaygın bir şekilde görebilirsiniz. Kıyaslamalara baktığınızda, farklı türlerdeki birkaç aracın eşdeğermiş gibi karşılaştırıldığını görmek yaygındır.
Özellikle, (diğer birçok araç arasında) Uvicorn, Starlette ve FastAPI'ın birlikte karşılaştırıldığını görebilirsiniz. Özellikle, (diğer birçok araç arasında) Uvicorn, Starlette ve FastAPI'ın birlikte karşılaştırıldığını görebilirsiniz.
Aracın çözdüğü problem ne kadar basitse, performansı o kadar iyi olacaktır. Ancak kıyaslamaların çoğu, aracın sağladığı ek özellikleri test etmez. Aracın çözdüğü problem ne kadar basitse, elde edeceği performans o kadar iyi olur. Ayrıca kıyaslamaların çoğu, aracın sağladığı ek özellikleri test etmez.
Hiyerarşi şöyledir: Hiyerarşi şöyledir:
* **Uvicorn**: bir ASGI sunucusu * **Uvicorn**: bir ASGI sunucusu
* **Starlette**: (Uvicorn'u kullanır) bir web mikroframeworkü * **Starlette**: (Uvicorn'u kullanır) bir web mikroframework'ü
* **FastAPI**: (Starlette'i kullanır) veri doğrulama vb. çeşitli ek özelliklere sahip, API oluşturmak için kullanılan bir API mikroframeworkü * **FastAPI**: (Starlette'i kullanır) veri doğrulama vb. ile API'lar oluşturmak için çeşitli ek özelliklere sahip bir API mikroframework'ü
* **Uvicorn**: * **Uvicorn**:
* Sunucunun kendisi dışında ekstra bir kod içermediği için en iyi performansa sahip olacaktır. * Sunucunun kendisi dışında çok fazla ekstra kod içermediği için en iyi performansa sahip olacaktır.
* Doğrudan Uvicorn ile bir uygulama yazmazsınız. Bu, yazdığınız kodun en azından Starlette tarafından sağlanan tüm kodu (veya **FastAPI**) az çok içermesi gerektiği anlamına gelir. Eğer bunu yaptıysanız, son uygulamanız bir framework kullanmak ve uygulama kodlarını ve hataları en aza indirmekle aynı ek yüke sahip olacaktır. * Uvicorn ile doğrudan bir uygulama yazmazsınız. Bu, kodunuzun en azından Starlette'in (veya **FastAPI**'ın) sağladığı kodun aşağı yukarı tamamını içermesi gerektiği anlamına gelir. Bunu yaparsanız, nihai uygulamanız; bir framework kullanmış olmanın ve uygulama kodunu ve bug'ları en aza indirmenin getirdiği ek yükle aynı ek yüke sahip olur.
* Eğer Uvicorn'u karşılaştırıyorsanız, Daphne, Hypercorn, uWSGI, vb. uygulama sunucuları ile karşılaştırın. * Uvicorn'u karşılaştırıyorsanız, Daphne, Hypercorn, uWSGI vb. application server'larla karşılaştırın.
* **Starlette**: * **Starlette**:
* Uvicorn'dan sonraki en iyi performansa sahip olacaktır. İşin aslı, Starlette çalışmak için Uvicorn'u kullanıyor. Dolayısıyla, daha fazla kod çalıştırmaası gerektiğinden muhtemelen Uvicorn'dan sadece "daha yavaş" olabilir. * Uvicorn'dan sonra en iyi performansa sahip olacaktır. Aslında Starlette çalışmak için Uvicorn'u kullanır. Bu yüzden muhtemelen yalnızca daha fazla kod çalıştırmak zorunda kaldığı için Uvicorn'dan "daha yavaş" olabilir.
* Ancak yol bazlı yönlendirme vb. basit web uygulamaları oluşturmak için araçlar sağlar. * Ancak path tabanlı routing vb. ile basit web uygulamaları oluşturmanız için araçlar sağlar.
* Eğer Starlette'i karşılaştırıyorsanız, Sanic, Flask, Django, vb. frameworkler (veya mikroframeworkler) ile karşılaştırın. * Starlette'i karşılaştırıyorsanız, Sanic, Flask, Django vb. web framework'lerle (veya mikroframework'lerle) karşılaştırın.
* **FastAPI**: * **FastAPI**:
* Starlette'in Uvicorn'u kullandığı ve ondan daha hızlı olamayacağı gibi, **FastAPI**'da Starlette'i kullanır, dolayısıyla ondan daha hızlı olamaz. * Starlette'in Uvicorn'u kullanıp ondan daha hızlı olamaması gibi, **FastAPI** da Starlette'i kullanır; dolayısıyla ondan daha hızlı olamaz.
* FastAPI, Starlette'e ek olarak daha fazla özellik sunar. Bunlar veri doğrulama ve <abbr title="Dönüşüm: serialization, parsing, marshalling olarak da biliniyor">dönüşümü</abbr> gibi API'lar oluştururken neredeyse ve her zaman ihtiyaç duyduğunuz özelliklerdir. Ve bunu kullanarak, ücretsiz olarak otomatik dokümantasyon elde edersiniz (otomatik dokümantasyon çalışan uygulamalara ek yük getirmez, başlangıçta oluşturulur). * FastAPI, Starlette'in üzerine daha fazla özellik sağlar. API'lar oluştururken neredeyse her zaman ihtiyaç duyduğunuz veri doğrulama ve <abbr title="serialization - serileştirme">serialization</abbr> gibi özellikler. Ayrıca bunu kullanarak ücretsiz olarak otomatik dokümantasyon elde edersiniz (otomatik dokümantasyon, çalışan uygulamalara ek yük bile getirmez; startup'ta üretilir).
* FastAPI'ı kullanmadıysanız ve Starlette'i doğrudan kullandıysanız (veya başka bir araç, Sanic, Flask, Responder, vb.) tüm veri doğrulama ve dönüştürme araçlarını kendiniz geliştirmeniz gerekir. Dolayısıyla, son uygulamanız FastAPI kullanılarak oluşturulmuş gibi hâlâ aynı ek yüke sahip olacaktır. Çoğu durumda, uygulamalarda yazılan kodun büyük bir kısmını veri doğrulama ve dönüştürme kodları oluşturur. * FastAPI'ı kullanmayıp Starlette'i doğrudan kullansaydınız (veya Sanic, Flask, Responder vb. başka bir aracı), tüm veri doğrulama ve serialization işlemlerini kendiniz uygulamak zorunda kalırdınız. Dolayısıyla nihai uygulamanız, FastAPI kullanılarak inşa edilmiş olsaydı sahip olacağı ek yükle hâlâ aynı ek yüke sahip olurdu. Ve çoğu durumda, uygulamalarda yazılan en büyük kod miktarı veri doğrulama ve serialization kısmıdır.
* Dolayısıyla, FastAPI'ı kullanarak geliştirme süresinden, hatalardan, kod satırlarından tasarruf edersiniz ve kullanmadığınız durumda (birçok özelliği geliştirmek zorunda kalmakla birlikte) muhtemelen aynı performansı (veya daha iyisini) elde ederdiniz. * Bu nedenle FastAPI kullanarak geliştirme süresinden, bug'lardan, kod satırlarından tasarruf edersiniz; ayrıca muhtemelen, onu kullanmasaydınız (tüm bunları kodunuzda kendiniz uygulamak zorunda kalacağınız için) elde edeceğiniz performansın aynısını (veya daha iyisini) elde edersiniz.
* Eğer FastAPI'ı karşılaştırıyorsanız, Flask-apispec, NestJS, Molten, vb. gibi veri doğrulama, dönüştürme ve dokümantasyon sağlayan bir web uygulaması frameworkü ile (veya araç setiyle) karşılaştırın. * FastAPI'ı karşılaştırıyorsanız, Flask-apispec, NestJS, Molten vb. veri doğrulama, serialization ve dokümantasyon sağlayan bir web uygulaması framework'ü (veya araç seti) ile karşılaştırın. Entegre otomatik veri doğrulama, serialization ve dokümantasyona sahip framework'ler.

25
docs/tr/docs/deployment/cloud.md

@ -1,13 +1,24 @@
# FastAPI Uygulamasını Bulut Sağlayıcılar Üzerinde Yayınlama # Bulut Sağlayıcılar Üzerinde FastAPI Yayınlama { #deploy-fastapi-on-cloud-providers }
FastAPI uygulamasını yayınlamak için hemen hemen **herhangi bir bulut sağlayıcıyı** kullanabilirsiniz. FastAPI uygulamanızı yayınlamak için neredeyse **herhangi bir bulut sağlayıcıyı** kullanabilirsiniz.
Büyük bulut sağlayıcıların çoğu FastAPI uygulamasını yayınlamak için kılavuzlara sahiptir. Çoğu durumda, ana bulut sağlayıcıların FastAPI'yi onlarla birlikte yayınlamak için kılavuzları vardır.
## Bulut Sağlayıcılar - Sponsorlar ## FastAPI Cloud { #fastapi-cloud }
Bazı bulut sağlayıcılar ✨ [**FastAPI destekçileridir**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} ✨, bu FastAPI ve **ekosisteminin** sürekli ve sağlıklı bir şekilde **gelişmesini** sağlar. **<a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>**, **FastAPI**'nin arkasındaki aynı yazar ve ekip tarafından geliştirilmiştir.
Ayrıca, size **iyi servisler** sağlamakla kalmayıp, **iyi ve sağlıklı bir framework** olan FastAPI'a bağlılıklarını gösterir. Bir API'yi minimum çabayla **oluşturma**, **yayınlama** ve **erişme** sürecini kolaylaştırır.
Bu hizmetleri denemek ve kılavuzlarını incelemek isteyebilirsiniz. FastAPI ile uygulama geliştirirken elde edilen aynı **geliştirici deneyimini**, onları buluta **yayınlamaya** da taşır. 🎉
FastAPI Cloud, *FastAPI and friends* açık kaynak projelerinin birincil sponsoru ve finansman sağlayıcısıdır. ✨
## Bulut Sağlayıcılar - Sponsorlar { #cloud-providers-sponsors }
Diğer bazı bulut sağlayıcılar da ✨ [**FastAPI'ye sponsor olur**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} ✨. 🙇
Kılavuzlarını takip etmek ve servislerini denemek için onları da değerlendirmek isteyebilirsiniz:
* <a href="https://docs.render.com/deploy-fastapi?utm_source=deploydoc&utm_medium=referral&utm_campaign=fastapi" class="external-link" target="_blank">Render</a>
* <a href="https://docs.railway.com/guides/fastapi?utm_medium=integration&utm_source=docs&utm_campaign=fastapi" class="external-link" target="_blank">Railway</a>

22
docs/tr/docs/deployment/index.md

@ -1,21 +1,23 @@
# Deployment (Yayınlama) # Deployment { #deployment }
**FastAPI** uygulamasını deploy etmek oldukça kolaydır. **FastAPI** uygulamasını deploy etmek nispeten kolaydır.
## Deployment Ne Anlama Gelir? ## Deployment Ne Anlama Gelir? { #what-does-deployment-mean }
Bir uygulamayı **deploy** etmek (yayınlamak), uygulamayı **kullanıcılara erişilebilir hale getirmek** için gerekli adımları gerçekleştirmek anlamına gelir. Bir uygulamayı **deploy** etmek, onu **kullanıcılara erişilebilir hale getirmek** için gerekli adımları gerçekleştirmek anlamına gelir.
Bir **Web API** için bu süreç normalde uygulamayı **uzak bir makineye** yerleştirmeyi, iyi performans, kararlılık vb. özellikler sağlayan bir **sunucu programı** ile **kullanıcılarınızın** uygulamaya etkili ve kesintisiz bir şekilde **erişebilmesini** kapsar. Bir **web API** için bu süreç normalde uygulamayı **uzak bir makineye** yerleştirmeyi, iyi performans, kararlılık vb. özellikler sağlayan bir **sunucu programı** ile **kullanıcılarınızın** uygulamaya etkili ve kesintisiz bir şekilde, sorun yaşamadan **erişebilmesini** kapsar.
Bu, kodu sürekli olarak değiştirdiğiniz, hata alıp hata giderdiğiniz, geliştirme sunucusunu durdurup yeniden başlattığınız vb. **geliştirme** aşamalarının tam tersidir. Bu, kodu sürekli olarak değiştirdiğiniz, bozup düzelttiğiniz, geliştirme sunucusunu durdurup yeniden başlattığınız vb. **geliştirme** aşamalarının tam tersidir.
## Deployment Stratejileri ## Deployment Stratejileri { #deployment-strategies }
Kullanım durumunuza ve kullandığınız araçlara bağlı olarak bir kaç farklı yol izleyebilirsiniz. Kullanım durumunuza ve kullandığınız araçlara bağlı olarak bunu yapmanın birkaç yolu vardır.
Bir dizi araç kombinasyonunu kullanarak kendiniz **bir sunucu yayınlayabilirsiniz**, yayınlama sürecinin bir kısmını sizin için gerçekleştiren bir **bulut hizmeti** veya diğer olası seçenekleri kullanabilirsiniz. Bir dizi araç kombinasyonunu kullanarak kendiniz **bir sunucu deploy edebilirsiniz**, yayınlama sürecinin bir kısmını sizin için gerçekleştiren bir **bulut hizmeti** veya diğer olası seçenekleri kullanabilirsiniz.
Örneğin, FastAPI'nin arkasındaki ekip olarak, FastAPI uygulamalarını buluta mümkün olduğunca akıcı şekilde deploy etmeyi sağlamak için, FastAPI ile çalışmanın aynı geliştirici deneyimini sunarak <a href="https://fastapicloud.com" class="external-link" target="_blank">**FastAPI Cloud**</a>'u oluşturduk.
**FastAPI** uygulamasını yayınlarken aklınızda bulundurmanız gereken ana kavramlardan bazılarını size göstereceğim (ancak bunların çoğu diğer web uygulamaları için de geçerlidir). **FastAPI** uygulamasını yayınlarken aklınızda bulundurmanız gereken ana kavramlardan bazılarını size göstereceğim (ancak bunların çoğu diğer web uygulamaları için de geçerlidir).
Sonraki bölümlerde akılda tutulması gereken diğer ayrıntıları ve yayınlama tekniklerinden bazılarını göreceksiniz. ✨ Sonraki bölümlerde akılda tutulması gereken diğer ayrıntıları ve bunu yapmaya yönelik bazı teknikleri göreceksiniz. ✨

40
docs/tr/docs/how-to/general.md

@ -1,39 +1,39 @@
# Genel - Nasıl Yapılır - Tarifler # Genel - Nasıl Yapılır - Tarifler { #general-how-to-recipes }
Bu sayfada genel ve sıkça sorulan sorular için dokümantasyonun diğer sayfalarına yönlendirmeler bulunmaktadır. Bu sayfada genel veya sık sorulan sorular için dokümantasyonun diğer bölümlerine çeşitli yönlendirmeler bulunmaktadır.
## Veri Filtreleme - Güvenlik ## Veri Filtreleme - Güvenlik { #filter-data-security }
Döndürmeniz gereken veriden fazlasını döndürmediğinizden emin olmak için, [Tutorial - Response Model - Return Type](../tutorial/response-model.md){.internal-link target=_blank} sayfasını okuyun. Döndürmeniz gerekenden daha fazla veri döndürmediğinizden emin olmak için, [Tutorial - Response Model - Return Type](../tutorial/response-model.md){.internal-link target=_blank} dokümantasyonunu okuyun.
## Dokümantasyon Etiketleri - OpenAPI ## Dokümantasyon Etiketleri - OpenAPI { #documentation-tags-openapi }
*Yol operasyonlarınıza* etiketler ekleyerek dokümantasyon arayüzünde gruplar halinde görünmesini sağlamak için, [Tutorial - Path Operation Configurations - Tags](../tutorial/path-operation-configuration.md#tags){.internal-link target=_blank} sayfasını okuyun. *path operation*'larınıza etiketler eklemek ve dokümantasyon arayüzünde gruplamak için, [Tutorial - Path Operation Configurations - Tags](../tutorial/path-operation-configuration.md#tags){.internal-link target=_blank} dokümantasyonunu okuyun.
## Dokümantasyon Özeti ve Açıklaması - OpenAPI ## Dokümantasyon Özeti ve Açıklaması - OpenAPI { #documentation-summary-and-description-openapi }
*Yol operasyonlarınıza* özet ve açıklama ekleyip dokümantasyon arayüzünde görünmesini sağlamak için, [Tutorial - Path Operation Configurations - Summary and Description](../tutorial/path-operation-configuration.md#summary-and-description){.internal-link target=_blank} sayfasını okuyun. *path operation*'larınıza özet ve açıklama eklemek ve bunları dokümantasyon arayüzünde göstermek için, [Tutorial - Path Operation Configurations - Summary and Description](../tutorial/path-operation-configuration.md#summary-and-description){.internal-link target=_blank} dokümantasyonunu okuyun.
## Yanıt Açıklaması Dokümantasyonu - OpenAPI ## Dokümantasyon Yanıt Açıklaması - OpenAPI { #documentation-response-description-openapi }
Dokümantasyon arayüzünde yer alan yanıt açıklamasını tanımlamak için, [Tutorial - Path Operation Configurations - Response description](../tutorial/path-operation-configuration.md#response-description){.internal-link target=_blank} sayfasını okuyun. Dokümantasyon arayüzünde gösterilen response açıklamasını tanımlamak için, [Tutorial - Path Operation Configurations - Response description](../tutorial/path-operation-configuration.md#response-description){.internal-link target=_blank} dokümantasyonunu okuyun.
## *Yol Operasyonunu* Kullanımdan Kaldırma - OpenAPI ## Dokümantasyonda Bir *Path Operation*'ı Kullanımdan Kaldırma - OpenAPI { #documentation-deprecate-a-path-operation-openapi }
Bir *yol işlemi*ni kullanımdan kaldırmak ve bunu dokümantasyon arayüzünde göstermek için, [Tutorial - Path Operation Configurations - Deprecation](../tutorial/path-operation-configuration.md#deprecate-a-path-operation){.internal-link target=_blank} sayfasını okuyun. Bir *path operation* kullanımdan kaldırmak ve bunu dokümantasyon arayüzünde göstermek için, [Tutorial - Path Operation Configurations - Deprecation](../tutorial/path-operation-configuration.md#deprecate-a-path-operation){.internal-link target=_blank} dokümantasyonunu okuyun.
## Herhangi Bir Veriyi JSON Uyumlu Hale Getirme ## Herhangi Bir Veriyi JSON Uyumlu Hale Getirme { #convert-any-data-to-json-compatible }
Herhangi bir veriyi JSON uyumlu hale getirmek için, [Tutorial - JSON Compatible Encoder](../tutorial/encoder.md){.internal-link target=_blank} sayfasını okuyun. Herhangi bir veriyi JSON uyumlu hale getirmek için, [Tutorial - JSON Compatible Encoder](../tutorial/encoder.md){.internal-link target=_blank} dokümantasyonunu okuyun.
## OpenAPI Meta Verileri - Dokümantasyon ## OpenAPI Meta Verileri - Dokümantasyon { #openapi-metadata-docs }
OpenAPI şemanıza lisans, sürüm, iletişim vb. meta veriler eklemek için, [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md){.internal-link target=_blank} sayfasını okuyun. Lisans, sürüm, iletişim vb. dahil olmak üzere OpenAPI şemanıza meta veriler eklemek için, [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md){.internal-link target=_blank} dokümantasyonunu okuyun.
## OpenAPI Bağlantı Özelleştirme ## OpenAPI Özel URL { #openapi-custom-url }
OpenAPI bağlantısını özelleştirmek (veya kaldırmak) için, [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md#openapi-url){.internal-link target=_blank} sayfasını okuyun. OpenAPI URL'ini özelleştirmek (veya kaldırmak) için, [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md#openapi-url){.internal-link target=_blank} dokümantasyonunu okuyun.
## OpenAPI Dokümantasyon Bağlantıları ## OpenAPI Dokümantasyon URL'leri { #openapi-docs-urls }
Dokümantasyonu arayüzünde kullanılan bağlantıları güncellemek için, [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md#docs-urls){.internal-link target=_blank} sayfasını okuyun. Otomatik olarak oluşturulan dokümantasyon kullanıcı arayüzlerinde kullanılan URL'leri güncellemek için, [Tutorial - Metadata and Docs URLs](../tutorial/metadata.md#docs-urls){.internal-link target=_blank} dokümantasyonunu okuyun.

10
docs/tr/docs/how-to/index.md

@ -1,13 +1,13 @@
# Nasıl Yapılır - Tarifler # Nasıl Yapılır - Tarifler { #how-to-recipes }
Burada çeşitli konular hakkında farklı tarifler veya "nasıl yapılır" kılavuzları yer alıyor. Burada **çeşitli konular** hakkında farklı tarifler veya "nasıl yapılır" kılavuzları göreceksiniz.
Bu fikirlerin büyük bir kısmı aşağı yukarı **bağımsız** olacaktır, çoğu durumda bunları sadece **projenize** hitap ediyorsa incelemelisiniz. Bu fikirlerin büyük bir kısmı aşağı yukarı **bağımsız** olacaktır ve çoğu durumda bunları yalnızca doğrudan **projenize** uygulanıyorsa incelemeniz yeterli olacaktır.
Projeniz için ilginç ve yararlı görünen bir şey varsa devam edin ve inceleyin, aksi halde bunları atlayabilirsiniz. Projeniz için ilginç ve yararlı görünen bir şey varsa devam edin ve inceleyin; aksi halde muhtemelen bunları atlayabilirsiniz.
/// tip | İpucu /// tip | İpucu
**FastAPI**'ı düzgün (ve önerilen) şekilde öğrenmek istiyorsanız [Öğretici - Kullanıcı Rehberi](../tutorial/index.md){.internal-link target=_blank}'ni bölüm bölüm okuyun. **FastAPI**'ı yapılandırılmış bir şekilde (önerilir) **öğrenmek** istiyorsanız bunun yerine [Öğretici - Kullanıcı Rehberi](../tutorial/index.md){.internal-link target=_blank}'ni bölüm bölüm okuyun.
/// ///

425
docs/tr/docs/index.md

@ -1,14 +1,14 @@
# FastAPI # FastAPI { #fastapi }
<style> <style>
.md-content .md-typeset h1 { display: none; } .md-content .md-typeset h1 { display: none; }
</style> </style>
<p align="center"> <p align="center">
<a href="https://fastapi.tiangolo.com"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI"></a> <a href="https://fastapi.tiangolo.com/tr"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI"></a>
</p> </p>
<p align="center"> <p align="center">
<em>FastAPI framework, yüksek performanslı, öğrenmesi oldukça kolay, kodlaması hızlı, kullanıma hazır</em> <em>FastAPI framework, yüksek performanslı, öğrenmesi kolay, kodlaması hızlı, production'a hazır</em>
</p> </p>
<p align="center"> <p align="center">
<a href="https://github.com/fastapi/fastapi/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster" target="_blank"> <a href="https://github.com/fastapi/fastapi/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster" target="_blank">
@ -27,59 +27,65 @@
--- ---
**Dokümantasyon**: <a href="https://fastapi.tiangolo.com" target="_blank">https://fastapi.tiangolo.com</a> **Dokümantasyon**: <a href="https://fastapi.tiangolo.com/tr" target="_blank">https://fastapi.tiangolo.com</a>
**Kaynak Kod**: <a href="https://github.com/fastapi/fastapi" target="_blank">https://github.com/fastapi/fastapi</a> **Kaynak Kod**: <a href="https://github.com/fastapi/fastapi" target="_blank">https://github.com/fastapi/fastapi</a>
--- ---
FastAPI, Python 'nin standart <abbr title="Tip Belirteçleri: Type Hints">tip belirteçleri</abbr>ne dayalı, modern ve hızlı (yüksek performanslı) API'lar oluşturmak için kullanılabilecek web framework'tür. FastAPI, Python'un standart type hints'lerine dayalı olarak Python ile API'lar oluşturmak için kullanılan modern ve hızlı (yüksek performanslı) bir web framework'üdür.
Temel özellikleri şunlardır: Temel özellikleri şunlardır:
* **Hızlı**: Çok yüksek performanslı, **NodeJS** ve **Go** ile eşit düzeyde (Starlette ve Pydantic sayesinde). [En hızlı Python framework'lerinden bir tanesidir](#performans). * **Hızlı**: Çok yüksek performanslı, **NodeJS** ve **Go** ile eşit düzeyde (Starlette ve Pydantic sayesinde). [Mevcut en hızlı Python framework'lerinden biri](#performance).
* **Kodlaması Hızlı**: Geliştirme hızını yaklaşık %200 ile %300 aralığında arttırır. * * **Kodlaması Hızlı**: Özellik geliştirme hızını yaklaşık %200 ile %300 aralığında artırır. *
* **Daha az hata**: İnsan (geliştirici) kaynaklı hataları yaklaşık %40 azaltır. * * **Daha az hata**: İnsan (geliştirici) kaynaklı hataları yaklaşık %40 azaltır. *
* **Sezgisel**: Muhteşem bir editör desteği. Her yerde <abbr title="Otomatik Tamamlama: auto-complete, autocompletion, IntelliSense">otomatik tamamlama</abbr>. Hata ayıklama ile daha az zaman harcayacaksınız. * **Sezgisel**: Harika bir editör desteği. Her yerde <abbr title="auto-complete, autocompletion, IntelliSense olarak da bilinir">Completion</abbr>. Hata ayıklamaya daha az zaman.
* **Kolay**: Öğrenmesi ve kullanması kolay olacak şekilde tasarlandı. Doküman okuma ile daha az zaman harcayacaksınız. * **Kolay**: Kullanımı ve öğrenmesi kolay olacak şekilde tasarlandı. Doküman okumaya daha az zaman.
* **Kısa**: Kod tekrarı minimize edildi. Her parametre tanımlamasında birden fazla özellik ve daha az hatayla karşılaşacaksınız. * **Kısa**: Kod tekrarını minimize eder. Her parametre tanımından birden fazla özellik. Daha az hata.
* **Güçlü**: Otomatik ve etkileşimli dokümantasyon ile birlikte, kullanıma hazır kod elde edebilirsiniz. * **Sağlam**: Production'a hazır kod elde edersiniz. Otomatik etkileşimli dokümantasyon ile birlikte.
* **Standard öncelikli**: API'lar için açık standartlara dayalı (ve tamamen uyumlu); <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> (eski adıyla Swagger) ve <a href="https://json-schema.org/" class="external-link" target="_blank">JSON Schema</a>. * **Standardlara dayalı**: API'lar için açık standartlara dayalıdır (ve tamamen uyumludur); <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> (önceden Swagger olarak biliniyordu) ve <a href="https://json-schema.org/" class="external-link" target="_blank">JSON Schema</a>.
<small>* ilgili kanılar, dahili geliştirme ekibinin geliştirdikleri ürünlere yaptıkları testlere dayanmaktadır.</small> <small>* tahmin, production uygulamalar geliştiren dahili bir geliştirme ekibinin yaptığı testlere dayanmaktadır.</small>
## Sponsorlar ## Sponsorlar { #sponsors }
<!-- sponsors --> <!-- sponsors -->
{% if sponsors %} ### Keystone Sponsor { #keystone-sponsor }
{% for sponsor in sponsors.keystone -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor -%}
### Gold and Silver Sponsors { #gold-and-silver-sponsors }
{% for sponsor in sponsors.gold -%} {% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a> <a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor -%} {% endfor -%}
{%- for sponsor in sponsors.silver -%} {%- for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a> <a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor %} {% endfor %}
{% endif %}
<!-- /sponsors --> <!-- /sponsors -->
<a href="https://fastapi.tiangolo.com/tr/fastapi-people/#sponsors" class="external-link" target="_blank">Diğer Sponsorlar</a> <a href="https://fastapi.tiangolo.com/tr/fastapi-people/#sponsors" class="external-link" target="_blank">Diğer sponsorlar</a>
## Görüşler ## Görüşler { #opinions }
"_[...] Bugünlerde **FastAPI**'ı çok fazla kullanıyorum. [...] Aslında bunu ekibimin **Microsoft'taki Machine Learning servislerinin** tamamında kullanmayı planlıyorum. Bunlardan bazıları **Windows**'un ana ürünlerine ve **Office** ürünlerine entegre ediliyor._" "_[...] Bugünlerde **FastAPI**'ı çok fazla kullanıyorum. [...] Aslında bunu ekibimin **Microsoft'taki ML servislerinin** tamamında kullanmayı planlıyorum. Bunlardan bazıları ana **Windows** ürününe ve bazı **Office** ürünlerine entegre ediliyor._"
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26" target="_blank"><small>(ref)</small></a></div> <div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/fastapi/fastapi/pull/26" target="_blank"><small>(ref)</small></a></div>
--- ---
"_**FastAPI**'ı **tahminlerimiz**'i sorgulanabilir hale getirecek bir **REST** sunucu oluşturmak için benimsedik/kullanmaya başladık._" "_**predictions** almak için sorgulanabilecek bir **REST** server oluşturmak amacıyla **FastAPI** kütüphanesini benimsedik. [Ludwig için]_"
<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/" target="_blank"><small>(ref)</small></a></div> <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/" target="_blank"><small>(ref)</small></a></div>
--- ---
"_**Netflix**, **kriz yönetiminde** orkestrasyon yapabilmek için geliştirdiği yeni framework'ü **Dispatch**'in, açık kaynak sürümünü paylaşmaktan gurur duyuyor. [**FastAPI** ile yapıldı.]_" "_**Netflix**, **kriz yönetimi** orkestrasyon framework'ümüz: **Dispatch**'in open-source sürümünü duyurmaktan memnuniyet duyar! [**FastAPI** ile geliştirildi]_"
<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" target="_blank"><small>(ref)</small></a></div> <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" target="_blank"><small>(ref)</small></a></div>
@ -91,70 +97,68 @@ Temel özellikleri şunlardır:
--- ---
"_Dürüst olmak gerekirse, inşa ettiğiniz şey gerçekten sağlam ve profesyonel görünüyor. Birçok açıdan **Hug**'ın olmasını istediğim şey tam da bu - böyle bir şeyi inşa eden birini görmek gerçekten ilham verici._" "_Dürüst olmak gerekirse, inşa ettiğiniz şey gerçekten sağlam ve profesyonel görünüyor. Birçok açıdan, **Hug**'ın olmasını istediğim şey tam da bu - böyle bir şeyi inşa eden birini görmek gerçekten ilham verici._"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong><a href="http://www.hug.rest/" target="_blank">Hug</a>'ın Yaratıcısı</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div> <div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong><a href="https://github.com/hugapi/hug" target="_blank">Hug</a> yaratıcısı</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div>
--- ---
"_Eğer REST API geliştirmek için **modern bir framework** öğrenme arayışında isen, **FastAPI**'a bir göz at [...] Hızlı, kullanımı ve öğrenmesi kolay. [...]_" "_REST API'lar geliştirmek için **modern bir framework** öğrenmek istiyorsanız, **FastAPI**'a bir göz atın [...] Hızlı, kullanımı ve öğrenmesi kolay [...]_"
"_**API** servislerimizi **FastAPI**'a taşıdık [...] Sizin de beğeneceğinizi düşünüyoruz. [...]_" "_**API**'larımız için **FastAPI**'a geçtik [...] Bence hoşunuza gidecek [...]_"
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong><a href="https://explosion.ai" target="_blank">Explosion AI</a> kurucuları - <a href="https://spacy.io" target="_blank">spaCy</a> yaratıcıları</strong> <a href="https://x.com/_inesmontani/status/1144173225322143744" target="_blank"><small>(ref)</small></a> - <a href="https://x.com/honnibal/status/1144031421859655680" target="_blank"><small>(ref)</small></a></div> <div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong><a href="https://explosion.ai" target="_blank">Explosion AI</a> kurucuları - <a href="https://spacy.io" target="_blank">spaCy</a> yaratıcıları</strong> <a href="https://x.com/_inesmontani/status/1144173225322143744" target="_blank"><small>(ref)</small></a> - <a href="https://x.com/honnibal/status/1144031421859655680" target="_blank"><small>(ref)</small></a></div>
--- ---
"_Python ile kullanıma hazır bir API oluşturmak isteyen herhangi biri için, **FastAPI**'ı şiddetle tavsiye ederim. **Harika tasarlanmış**, **kullanımı kolay** ve **yüksek ölçeklenebilir**, API odaklı geliştirme stratejimizin **ana bileşeni** haline geldi ve Virtual TAC Engineer gibi birçok otomasyon ve servisi yönetiyor._" "_Production'da Python API geliştirmek isteyen herkese **FastAPI**'ı şiddetle tavsiye ederim. **Harika tasarlanmış**, **kullanımı kolay** ve **yüksek ölçeklenebilir**; API-first geliştirme stratejimizin **kilit bir bileşeni** haline geldi ve Virtual TAC Engineer gibi birçok otomasyon ve servise güç veriyor._"
<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/" target="_blank"><small>(ref)</small></a></div> <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/" target="_blank"><small>(ref)</small></a></div>
--- ---
## Komut Satırı Uygulamalarının FastAPI'ı: **Typer** ## FastAPI mini belgeseli { #fastapi-mini-documentary }
<a href="https://typer.tiangolo.com" target="_blank"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" style="width: 20%;"></a> 2025'in sonunda yayınlanan bir <a href="https://www.youtube.com/watch?v=mpR8ngthqiE" class="external-link" target="_blank">FastAPI mini belgeseli</a> var, online olarak izleyebilirsiniz:
Eğer API yerine, terminalde kullanılmak üzere bir <abbr title="Komut Satırı: Command Line Interface">komut satırı uygulaması</abbr> geliştiriyorsanız <a href="https://typer.tiangolo.com/" class="external-link" target="_blank">**Typer**</a>'a göz atabilirsiniz. <a href="https://www.youtube.com/watch?v=mpR8ngthqiE" target="_blank"><img src="https://fastapi.tiangolo.com/img/fastapi-documentary.jpg" alt="FastAPI Mini Documentary"></a>
**Typer** kısaca FastAPI'ın küçük kardeşi. Ve hedefi komut satırı uygulamalarının **FastAPI'ı** olmak. ⌨️ 🚀 ## CLI'ların FastAPI'ı: **Typer** { #typer-the-fastapi-of-clis }
## Gereksinimler <a href="https://typer.tiangolo.com" target="_blank"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" style="width: 20%;"></a>
FastAPI iki devin omuzları üstünde duruyor: Web API yerine terminalde kullanılacak bir <abbr title="Command Line Interface">CLI</abbr> uygulaması geliştiriyorsanız <a href="https://typer.tiangolo.com/" class="external-link" target="_blank">**Typer**</a>'a göz atın.
* Web tarafı için <a href="https://www.starlette.dev/" class="external-link" target="_blank">Starlette</a>. **Typer**, FastAPI'ın küçük kardeşi. Ve hedefi CLI'ların **FastAPI'ı** olmak. ⌨️ 🚀
* Data tarafı için <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a>.
## Kurulum ## Gereksinimler { #requirements }
<div class="termy"> FastAPI iki devin omuzları üstünde duruyor:
```console
$ pip install fastapi
---> 100% * Web kısımları için <a href="https://www.starlette.dev/" class="external-link" target="_blank">Starlette</a>.
``` * Data kısımları için <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a>.
</div> ## Kurulum { #installation }
Uygulamamızı kullanılabilir hale getirmek için <a href="http://www.uvicorn.dev" class="external-link" target="_blank">Uvicorn</a> ya da <a href="https://github.com/pgjones/hypercorn" class="external-link" target="_blank">Hypercorn</a> gibi bir ASGI sunucusuna ihtiyacımız olacak. Bir <a href="https://fastapi.tiangolo.com/tr/virtual-environments/" class="external-link" target="_blank">virtual environment</a> oluşturup etkinleştirelim ve ardından FastAPI'ı yükleyelim:
<div class="termy"> <div class="termy">
```console ```console
$ pip install "uvicorn[standard]" $ pip install "fastapi[standard]"
---> 100% ---> 100%
``` ```
</div> </div>
## Örnek **Not**: Tüm terminallerde çalıştığından emin olmak için `"fastapi[standard]"` ifadesini tırnak içinde yazdığınızdan emin olun.
### Kodu Oluşturalım ## Örnek { #example }
* `main.py` adında bir dosya oluşturup içine şu kodu yapıştıralım: ### Oluşturalım { #create-it }
Şu içerikle `main.py` adında bir dosya oluşturalım:
```Python ```Python
from typing import Union from typing import Union
@ -175,9 +179,9 @@ def read_item(item_id: int, q: Union[str, None] = None):
``` ```
<details markdown="1"> <details markdown="1">
<summary>Ya da <code>async def</code>...</summary> <summary>Ya da <code>async def</code> kullanalım...</summary>
Eğer kodunuzda `async` / `await` varsa, `async def` kullanalım: Eğer kodunuz `async` / `await` kullanıyorsa, `async def` kullanın:
```Python hl_lines="9 14" ```Python hl_lines="9 14"
from typing import Union from typing import Union
@ -199,22 +203,35 @@ async def read_item(item_id: int, q: Union[str, None] = None):
**Not**: **Not**:
Eğer bu konu hakkında bilginiz yoksa <a href="https://fastapi.tiangolo.com/tr/async/#in-a-hurry" target="_blank">`async` ve `await`</a> dokümantasyonundaki _"Aceleniz mi var?"_ kısmını kontrol edebilirsiniz. Eğer bilmiyorsanız, dokümanlardaki <a href="https://fastapi.tiangolo.com/tr/async/#in-a-hurry" target="_blank">`async` ve `await`</a> hakkında _"Aceleniz mi var?"_ bölümüne bakın.
</details> </details>
### Kodu Çalıştıralım ### Çalıştıralım { #run-it }
Sunucuyu aşağıdaki komutla çalıştıralım: Sunucuyu şu komutla çalıştıralım:
<div class="termy"> <div class="termy">
```console ```console
$ uvicorn main:app --reload $ fastapi dev main.py
╭────────── FastAPI CLI - Development mode ───────────╮
│ │
│ Serving at: http://127.0.0.1:8000 │
│ │
│ API docs: http://127.0.0.1:8000/docs │
│ │
│ Running in development mode, for production use: │
│ │
│ fastapi run │
│ │
╰─────────────────────────────────────────────────────╯
INFO: Will watch for changes in these directories: ['/home/user/code/awesomeapp']
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [28720] INFO: Started reloader process [2248755] using WatchFiles
INFO: Started server process [28722] INFO: Started server process [2248757]
INFO: Waiting for application startup. INFO: Waiting for application startup.
INFO: Application startup complete. INFO: Application startup complete.
``` ```
@ -222,54 +239,54 @@ INFO: Application startup complete.
</div> </div>
<details markdown="1"> <details markdown="1">
<summary><code>uvicorn main:app --reload</code> komutuyla ilgili...</summary> <summary><code>fastapi dev main.py</code> komutu hakkında...</summary>
`uvicorn main:app` komutunu şu şekilde açıklayabiliriz: `fastapi dev` komutu, `main.py` dosyanızı okur, içindeki **FastAPI** uygulamasını algılar ve <a href="https://www.uvicorn.dev" class="external-link" target="_blank">Uvicorn</a> kullanarak bir server başlatır.
* `main`: dosya olan `main.py` (yani Python "modülü"). Varsayılan olarak `fastapi dev`, local geliştirme için auto-reload etkin şekilde başlar.
* `app`: ise `main.py` dosyasının içerisinde `app = FastAPI()` satırında oluşturduğumuz `FastAPI` nesnesi.
* `--reload`: kod değişikliklerinin ardından sunucuyu otomatik olarak yeniden başlatır. Bu parameteyi sadece geliştirme aşamasında kullanmalıyız. Daha fazla bilgi için <a href="https://fastapi.tiangolo.com/tr/fastapi-cli/" target="_blank">FastAPI CLI dokümantasyonu</a>'nu okuyabilirsiniz.
</details> </details>
### Şimdi de Kontrol Edelim ### Kontrol Edelim { #check-it }
Tarayıcımızda şu bağlantıyı açalım <a href="http://127.0.0.1:8000/items/5?q=somequery" class="external-link" target="_blank">http://127.0.0.1:8000/items/5?q=somequery</a>. Tarayıcınızda şu bağlantıyı açın: <a href="http://127.0.0.1:8000/items/5?q=somequery" class="external-link" target="_blank">http://127.0.0.1:8000/items/5?q=somequery</a>.
Aşağıdaki gibi bir JSON yanıtıyla karşılaşacağız: Şu JSON response'unu göreceksiniz:
```JSON ```JSON
{"item_id": 5, "q": "somequery"} {"item_id": 5, "q": "somequery"}
``` ```
Az önce oluşturduğumuz API: Artık şunları yapan bir API oluşturdunuz:
* `/` ve `/items/{item_id}` <abbr title="Adres / Yol: Path ">_yollarına_</abbr> HTTP isteği alabilir. * `/` ve `/items/{item_id}` _path_'lerinde HTTP request'leri alır.
* İki _yolda_ `GET` <em>operasyonlarını</em> (HTTP _metodları_ olarak da bilinen) kabul ediyor. * Her iki _path_ de `GET` <em>operasyonlarını</em> (HTTP _method_'ları olarak da bilinir) kabul eder.
* `/items/{item_id}` _yolu_ `item_id` adında bir _yol parametresine_ sahip ve bu parametre `int` değer almak zorundadır. * `/items/{item_id}` _path_'i, `int` olması gereken `item_id` adlı bir _path parameter_'a sahiptir.
* `/items/{item_id}` _yolu_ `q` adında bir _yol parametresine_ sahip ve bu parametre opsiyonel olmakla birlikte, `str` değer almak zorundadır. * `/items/{item_id}` _path_'i, opsiyonel `str` bir _query parameter_ olan `q`'ya sahiptir.
### Etkileşimli API Dokümantasyonu ### Etkileşimli API dokümantasyonu { #interactive-api-docs }
Şimdi <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> bağlantısını açalım. Şimdi <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> adresine gidin.
<a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Swagger UI</a> tarafından sağlanan otomatik etkileşimli bir API dokümantasyonu göreceğiz: Otomatik etkileşimli API dokümantasyonunu göreceksiniz (<a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Swagger UI</a> tarafından sağlanır):
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png) ![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
### Alternatif API Dokümantasyonu ### Alternatif API dokümantasyonu { #alternative-api-docs }
Şimdi <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> bağlantısını açalım. Ve şimdi <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> adresine gidin.
<a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a> tarafından sağlanan otomatik dokümantasyonu göreceğiz: Alternatif otomatik dokümantasyonu göreceksiniz (<a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a> tarafından sağlanır):
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png) ![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
## Örneği Güncelleyelim ## Örneği Güncelleyelim { #example-upgrade }
Şimdi `main.py` dosyasını, `PUT` isteğiyle birlikte bir gövde alacak şekilde değiştirelim. Şimdi `main.py` dosyasını, `PUT` request'iyle gelen bir body alacak şekilde değiştirelim.
<abbr title="Gövde: Body">Gövde</abbr>yi Pydantic sayesinde standart python tiplerini kullanarak tanımlayalım. Body'yi Pydantic sayesinde standart Python tiplerini kullanarak tanımlayalım.
```Python hl_lines="4 9-12 25-27" ```Python hl_lines="4 9-12 25-27"
from typing import Union from typing import Union
@ -301,174 +318,248 @@ def update_item(item_id: int, item: Item):
return {"item_name": item.name, "item_id": item_id} return {"item_name": item.name, "item_id": item_id}
``` ```
Sunucu otomatik olarak yeniden başlamış olmalı (çünkü yukarıda `uvicorn` komutuyla birlikte `--reload` parametresini kullandık). `fastapi dev` server'ı otomatik olarak yeniden yüklemelidir.
### Etkileşimli API Dokümantasyonundaki Değişimi Görelim ### Etkileşimli API dokümantasyonu güncellemesi { #interactive-api-docs-upgrade }
Şimdi <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> bağlantısına tekrar gidelim. Şimdi <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> adresine gidin.
* Etkileşimli API dokümantasyonu, yeni gövdede dahil olmak üzere otomatik olarak güncellenmiş olacak: * Etkileşimli API dokümantasyonu, yeni body dahil olacak şekilde otomatik olarak güncellenecek:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png) ![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
* "Try it out" butonuna tıklayalım, bu işlem API parametleri üzerinde değişiklik yapmamıza ve doğrudan API ile etkileşime geçmemize imkan sağlayacak: * "Try it out" butonuna tıklayın; parametreleri doldurmanıza ve API ile doğrudan etkileşime girmenize olanak sağlar:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png) ![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
* Şimdi "Execute" butonuna tıklayalım, kullanıcı arayüzü API'ımız ile bağlantı kurup parametreleri gönderecek ve sonucu ekranımıza getirecek: * Sonra "Execute" butonuna tıklayın; kullanıcı arayüzü API'nız ile iletişim kuracak, parametreleri gönderecek, sonuçları alacak ve ekranda gösterecek:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png) ![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
### Alternatif API Dokümantasyonundaki Değişimi Görelim ### Alternatif API dokümantasyonu güncellemesi { #alternative-api-docs-upgrade }
Şimdi ise <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> bağlantısına tekrar gidelim. Ve şimdi <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> adresine gidin.
* Alternatif dokümantasyonda yaptığımız değişiklikler ile birlikte yeni sorgu parametresi ve gövde bilgisi ile güncelemiş olacak: * Alternatif dokümantasyon da yeni query parameter ve body'yi yansıtacak:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png) ![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### Özet ### Özet { #recap }
Özetlemek gerekirse, parametrelerin, gövdenin, vb. veri tiplerini fonksiyon parametreleri olarak **bir kere** tanımlıyoruz. Özetle, parametrelerin, body'nin vb. type'larını fonksiyon parametreleri olarak **bir kere** tanımlarsınız.
Bu işlemi standart modern Python tipleriyle yapıyoruz. Bunu standart modern Python tipleriyle yaparsınız.
Yeni bir sözdizimi yapısını, bir kütüphane özel metod veya sınıfları öğrenmeye gerek yoktur. Yeni bir syntax, belirli bir kütüphanenin method'larını ya da class'larını vb. öğrenmeniz gerekmez.
Hepsi sadece **Python** standartlarına dayalıdır. Sadece standart **Python**.
Örnek olarak, `int` tanımlamak için: Örneğin bir `int` için:
```Python ```Python
item_id: int item_id: int
``` ```
ya da daha kompleks herhangi bir python modelini tanımlayabiliriz, örneğin `Item` modeli için: ya da daha karmaşık bir `Item` modeli için:
```Python ```Python
item: Item item: Item
``` ```
...ve sadece kısa bir parametre tipi belirterek elde ettiklerimiz: ...ve bu tek tanımla şunları elde edersiniz:
* Editör desteğiyle birlikte: * Şunlar dahil editör desteği:
* Otomatik tamamlama. * Completion.
* Tip kontrolü. * Type kontrolleri.
* Veri Doğrulama: * Verinin doğrulanması:
* Veri geçerli değilse, otomatik olarak açıklayıcı hatalar gösterir. * Veri geçersiz olduğunda otomatik ve anlaşılır hatalar.
* Çok <abbr title="Derin / İç içe: Nested">derin</abbr> JSON nesnelerinde bile doğrulama yapar. * Çok derin iç içe JSON nesneleri için bile doğrulama.
* Gelen verinin <abbr title="Dönüşüm: serialization, parsing, marshalling olarak da biliniyor">dönüşümünü</abbr> aşağıdaki veri tiplerini kullanarak gerçekleştirir: * Girdi verisinin <abbr title="serialization, parsing, marshalling olarak da bilinir">Dönüşümü</abbr>: network'ten gelen veriyi Python verisine ve type'larına çevirir. Şunlardan okur:
* JSON. * JSON.
* Yol parametreleri. * Path parameter'lar.
* Sorgu parametreleri. * Query parameter'lar.
* Çerezler. * Cookie'ler.
* Headers. * Header'lar.
* Formlar. * Form'lar.
* Dosyalar. * File'lar.
* Giden verinin <abbr title="Dönüşüm: serialization, parsing, marshalling olarak da biliniyor">dönüşümünü</abbr> aşağıdaki veri tiplerini kullanarak gerçekleştirir (JSON olarak): * Çıktı verisinin <abbr title="serialization, parsing, marshalling olarak da bilinir">Dönüşümü</abbr>: Python verisini ve type'larını network verisine çevirir (JSON olarak):
* Python tiplerinin (`str`, `int`, `float`, `bool`, `list`, vb) dönüşümü. * Python type'larını dönüştürür (`str`, `int`, `float`, `bool`, `list`, vb.).
* `datetime` nesnesi. * `datetime` nesneleri.
* `UUID` nesnesi. * `UUID` nesneleri.
* Veritabanı modelleri. * Veritabanı modelleri.
* ve çok daha fazlası... * ...ve daha fazlası.
* 2 alternatif kullanıcı arayüzü dahil olmak üzere, otomatik etkileşimli API dokümantasyonu sağlar: * 2 alternatif kullanıcı arayüzü dahil otomatik etkileşimli API dokümantasyonu:
* Swagger UI. * Swagger UI.
* ReDoc. * ReDoc.
--- ---
Az önceki örneğe geri dönelim, **FastAPI**'ın yapacaklarına bir bakış atalım: Önceki kod örneğine dönersek, **FastAPI** şunları yapacaktır:
* `item_id`'nin `GET` ve `PUT` istekleri için, yolda olup olmadığının kontol edecek. * `GET` ve `PUT` request'leri için path'te `item_id` olduğunu doğrular.
* `item_id`'nin `GET` ve `PUT` istekleri için, tipinin `int` olduğunu doğrulayacak. * `GET` ve `PUT` request'leri için `item_id`'nin type'ının `int` olduğunu doğrular.
* Eğer değilse, sebebini belirten bir hata mesajı gösterecek. * Değilse, client faydalı ve anlaşılır bir hata görür.
* Opsiyonel bir `q` parametresinin `GET` isteği içinde (`http://127.0.0.1:8000/items/foo?q=somequery` gibi) olup olmadığını kontrol edecek * `GET` request'leri için `q` adlı opsiyonel bir query parameter olup olmadığını kontrol eder (`http://127.0.0.1:8000/items/foo?q=somequery` örneğindeki gibi).
* `q` parametresini `= None` ile oluşturduğumuz için, opsiyonel bir parametre olacak. * `q` parametresi `= None` ile tanımlandığı için opsiyoneldir.
* Eğer `None` olmasa zorunlu bir parametre olacaktı (`PUT` metodunun gövdesinde olduğu gibi). * `None` olmasaydı zorunlu olurdu (tıpkı `PUT` örneğindeki body gibi).
* `PUT` isteği için `/items/{item_id}`'nin gövdesini, JSON olarak doğrulayıp okuyacak: * `/items/{item_id}`'ye yapılan `PUT` request'leri için body'yi JSON olarak okur:
* `name` adında zorunlu bir parametre olup olmadığını ve varsa tipinin `str` olup olmadığını kontol edecek. * `str` olması gereken, zorunlu `name` alanı olduğunu kontrol eder.
* `price` adında zorunlu bir parametre olup olmadığını ve varsa tipinin `float` olup olmadığını kontol edecek. * `float` olması gereken, zorunlu `price` alanı olduğunu kontrol eder.
* `is_offer` adında opsiyonel bir parametre olup olmadığını ve varsa tipinin `float` olup olmadığını kontol edecek. * Varsa, `bool` olması gereken opsiyonel `is_offer` alanını kontrol eder.
* Bunların hepsi en derin JSON nesnelerinde bile çalışacak. * Bunların hepsi çok derin iç içe JSON nesneleri için de çalışır.
* Verilerin JSON'a ve JSON'ın python nesnesine dönüşümü otomatik olarak yapılacak. * JSON'a ve JSON'dan dönüşümü otomatik yapar.
* Her şeyi OpenAPI ile uyumlu bir şekilde otomatik olarak dokümanlayacak ve bunlarda aşağıdaki gibi kullanılabilecek: * Her şeyi OpenAPI ile dokümante eder; bu dokümantasyon şunlar tarafından kullanılabilir:
* Etkileşimli dokümantasyon sistemleri. * Etkileşimli dokümantasyon sistemleri.
* Bir çok programlama dili için otomatik istemci kodu üretim sistemleri. * Birçok dil için otomatik client kodu üretim sistemleri.
* İki ayrı etkileşimli dokümantasyon arayüzünü doğrudan sağlayacak. * 2 etkileşimli dokümantasyon web arayüzünü doğrudan sunar.
--- ---
Daha yeni başladık ama çalışma mantığını çoktan anlamış oldunuz. Daha yolun başındayız, ama bunun nasıl çalıştığı hakkında fikri kaptınız.
Şimdi aşağıdaki satırı değiştirmeyi deneyin: Şu satırı değiştirmeyi deneyin:
```Python ```Python
return {"item_name": item.name, "item_id": item_id} return {"item_name": item.name, "item_id": item_id}
``` ```
...bundan: ...şundan:
```Python ```Python
... "item_name": item.name ... ... "item_name": item.name ...
``` ```
...buna: ...şuna:
```Python ```Python
... "item_price": item.price ... ... "item_price": item.price ...
``` ```
...ve editörünün veri tiplerini bildiğini ve otomatik tamamladığını göreceksiniz: ...ve editörünüzün alanları otomatik tamamladığını ve type'larını bildiğini görün:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png) ![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
Daha fazal özellik içeren, daha eksiksiz bir örnek için <a href="https://fastapi.tiangolo.com/tr/tutorial/">Öğretici - Kullanıcı Rehberi</a> sayfasını ziyaret edebilirsin. Daha fazla özellik içeren daha kapsamlı bir örnek için <a href="https://fastapi.tiangolo.com/tr/tutorial/">Öğretici - Kullanıcı Rehberi</a>'ne bakın.
**Spoiler**: Öğretici - Kullanıcı rehberi şunları içerir: **Spoiler alert**: öğretici - kullanıcı rehberi şunları içerir:
* **Parameterlerin**, **headers**, **çerezler**, **form alanları** ve **dosyalar** olarak tanımlanması. * **parameter**'ların farklı yerlerden: **header**'lar, **cookie**'ler, **form alanları** ve **file**'lar olarak tanımlanması.
* `maximum_length` ya da `regex` gibi **doğrulama kısıtlamalarının** nasıl yapılabileceği. * `maximum_length` ya da `regex` gibi **doğrulama kısıtlamalarının** nasıl ayarlanacağı.
* Çok güçlü ve kullanımı kolay **<abbr title="Bağımlılık Enjeksiyonu: components, resources, providers, services, injectables olarak da biliniyor.">Bağımlılık Enjeksiyonu</abbr>** sistemi oluşturmayı. * Çok güçlü ve kullanımı kolay bir **<abbr title="components, resources, providers, services, injectables olarak da bilinir">Dependency Injection</abbr>** sistemi.
* Güvenlik ve kimlik doğrulama, **JWT tokenleri** ile **OAuth2** desteği, ve **HTTP Basic** doğrulaması. * **JWT tokens** ve **HTTP Basic** auth ile **OAuth2** desteği dahil güvenlik ve kimlik doğrulama.
* İleri seviye fakat bir o kadarda basit olan **çok derin JSON modelleri** (Pydantic sayesinde). * **Çok derin iç içe JSON modelleri** tanımlamak için daha ileri (ama aynı derecede kolay) teknikler (Pydantic sayesinde).
* **GraphQL** entegrasyonu: <a href="https://strawberry.rocks" class="external-link" target="_blank">Strawberry</a> ve diğer kütüphaneleri kullanarak. * <a href="https://strawberry.rocks" class="external-link" target="_blank">Strawberry</a> ve diğer kütüphaneler ile **GraphQL** entegrasyonu.
* Diğer ekstra özellikler (Starlette sayesinde): * Starlette sayesinde gelen birçok ek özellik:
* **WebSocketler** * **WebSockets**
* HTTPX ve `pytest` sayesinde aşırı kolay testler. * HTTPX ve `pytest` tabanlı aşırı kolay testler
* **CORS** * **CORS**
* **Cookie Sessions** * **Cookie Sessions**
* ...ve daha fazlası. * ...ve daha fazlası.
## Performans ### Uygulamanızı deploy edin (opsiyonel) { #deploy-your-app-optional }
İsterseniz FastAPI uygulamanızı <a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>'a deploy edebilirsiniz; eğer henüz yapmadıysanız gidip bekleme listesine katılın. 🚀
Zaten bir **FastAPI Cloud** hesabınız varsa (bekleme listesinden sizi davet ettiysek 😉), uygulamanızı tek bir komutla deploy edebilirsiniz.
Deploy etmeden önce, giriş yaptığınızdan emin olun:
<div class="termy">
```console
$ fastapi login
You are logged in to FastAPI Cloud 🚀
```
</div>
Sonra uygulamanızı deploy edin:
Bağımsız TechEmpower kıyaslamaları gösteriyor ki, Uvicorn ile çalıştırılan **FastAPI** uygulamaları <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">en hızlı Python framework'lerinden birisi</a>, sadece Starlette ve Uvicorn'dan yavaş, ki FastAPI bunların üzerine kurulu bir kütüphanedir. <div class="termy">
Daha fazla bilgi için, bu bölüme bir göz at <a href="https://fastapi.tiangolo.com/tr/benchmarks/" class="internal-link" target="_blank">Kıyaslamalar</a>. ```console
$ fastapi deploy
## Opsiyonel Gereksinimler Deploying to FastAPI Cloud...
Pydantic tarafında kullanılan: ✅ Deployment successful!
🐔 Ready the chicken! Your app is ready at https://myapp.fastapicloud.dev
```
</div>
Hepsi bu! Artık uygulamanıza bu URL'den erişebilirsiniz. ✨
#### FastAPI Cloud hakkında { #about-fastapi-cloud }
**<a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>**, **FastAPI**'ın arkasındaki aynı yazar ve ekip tarafından geliştirilmiştir.
**Bir API'ı build etmek**, **deploy etmek** ve **erişmek** süreçlerini minimum eforla kolaylaştırır.
FastAPI ile uygulama geliştirmenin sağladığı aynı **developer experience**'ı, onları cloud'a **deploy etmeye** de taşır. 🎉
FastAPI Cloud, *FastAPI and friends* open source projelerinin ana sponsoru ve finansman sağlayıcısıdır. ✨
#### Diğer cloud sağlayıcılarına deploy { #deploy-to-other-cloud-providers }
FastAPI open source'tur ve standartlara dayanır. FastAPI uygulamalarını seçtiğiniz herhangi bir cloud sağlayıcısına deploy edebilirsiniz.
FastAPI uygulamalarını onlarla deploy etmek için cloud sağlayıcınızın rehberlerini takip edin. 🤓
## Performans { #performance }
Bağımsız TechEmpower kıyaslamaları, Uvicorn altında çalışan **FastAPI** uygulamalarının <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">mevcut en hızlı Python framework'lerinden biri</a> olduğunu gösteriyor; sadece Starlette ve Uvicorn'un kendisinin gerisinde (FastAPI tarafından dahili olarak kullanılır). (*)
Daha iyi anlamak için <a href="https://fastapi.tiangolo.com/tr/benchmarks/" class="internal-link" target="_blank">Kıyaslamalar</a> bölümüne bakın.
## Bağımlılıklar { #dependencies }
FastAPI, Pydantic ve Starlette'a bağımlıdır.
### `standard` Bağımlılıkları { #standard-dependencies }
FastAPI'ı `pip install "fastapi[standard]"` ile yüklediğinizde, opsiyonel bağımlılıkların `standard` grubuyla birlikte gelir:
Pydantic tarafından kullanılanlar:
* <a href="https://github.com/JoshData/python-email-validator" target="_blank"><code>email-validator</code></a> - email doğrulaması için. * <a href="https://github.com/JoshData/python-email-validator" target="_blank"><code>email-validator</code></a> - email doğrulaması için.
* <a href="https://docs.pydantic.dev/latest/usage/pydantic_settings/" target="_blank"><code>pydantic-settings</code></a> - ayar yönetimi için.
* <a href="https://docs.pydantic.dev/latest/usage/types/extra_types/extra_types/" target="_blank"><code>pydantic-extra-types</code></a> - Pydantic ile birlikte kullanılabilecek ek tipler için.
Starlette tarafında kullanılan: Starlette tarafından kullanılanlar:
* <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - `TestClient` kullanmak istiyorsanız gereklidir.
* <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - varsayılan template yapılandırmasını kullanmak istiyorsanız gereklidir.
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - `request.form()` ile, form <abbr title="HTTP request'inden gelen string'i Python verisine dönüştürme">"parsing"</abbr> desteği istiyorsanız gereklidir.
FastAPI tarafından kullanılanlar:
* <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - Eğer `TestClient` yapısını kullanacaksanız gereklidir. * <a href="https://www.uvicorn.dev" target="_blank"><code>uvicorn</code></a> - uygulamanızı yükleyen ve servis eden server için. Buna, yüksek performanslı servis için gereken bazı bağımlılıkları (örn. `uvloop`) içeren `uvicorn[standard]` dahildir.
* <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - Eğer varsayılan template konfigürasyonunu kullanacaksanız gereklidir. * `fastapi-cli[standard]` - `fastapi` komutunu sağlamak için.
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - Eğer `request.form()` ile form <abbr title="HTTP isteği ile gelen string veriyi Python nesnesine çevirme.">dönüşümü</abbr> desteğini kullanacaksanız gereklidir. * Buna, FastAPI uygulamanızı <a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>'a deploy etmenizi sağlayan `fastapi-cloud-cli` dahildir.
* <a href="https://pythonhosted.org/itsdangerous/" target="_blank"><code>itsdangerous</code></a> - `SessionMiddleware` desteği için gerekli.
* <a href="https://pyyaml.org/wiki/PyYAMLDocumentation" target="_blank"><code>pyyaml</code></a> - `SchemaGenerator` desteği için gerekli (Muhtemelen FastAPI kullanırken ihtiyacınız olmaz).
Hem FastAPI hem de Starlette tarafından kullanılan: ### `standard` Bağımlılıkları Olmadan { #without-standard-dependencies }
`standard` opsiyonel bağımlılıklarını dahil etmek istemiyorsanız, `pip install "fastapi[standard]"` yerine `pip install fastapi` ile kurabilirsiniz.
### `fastapi-cloud-cli` Olmadan { #without-fastapi-cloud-cli }
FastAPI'ı standard bağımlılıklarla ama `fastapi-cloud-cli` olmadan kurmak istiyorsanız, `pip install "fastapi[standard-no-fastapi-cloud-cli]"` ile yükleyebilirsiniz.
### Ek Opsiyonel Bağımlılıklar { #additional-optional-dependencies }
Yüklemek isteyebileceğiniz bazı ek bağımlılıklar da vardır.
Ek opsiyonel Pydantic bağımlılıkları:
* <a href="https://docs.pydantic.dev/latest/usage/pydantic_settings/" target="_blank"><code>pydantic-settings</code></a> - ayar yönetimi için.
* <a href="https://docs.pydantic.dev/latest/usage/types/extra_types/extra_types/" target="_blank"><code>pydantic-extra-types</code></a> - Pydantic ile kullanılacak ek type'lar için.
* <a href="https://www.uvicorn.dev" target="_blank"><code>uvicorn</code></a> - oluşturduğumuz uygulamayı servis edecek web sunucusu görevini üstlenir. Ek opsiyonel FastAPI bağımlılıkları:
* <a href="https://github.com/ijl/orjson" target="_blank"><code>orjson</code></a> - `ORJSONResponse` kullanacaksanız gereklidir.
* <a href="https://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - `UJSONResponse` kullanacaksanız gerekli.
Bunların hepsini `pip install fastapi[all]` ile yükleyebilirsin. * <a href="https://github.com/ijl/orjson" target="_blank"><code>orjson</code></a> - `ORJSONResponse` kullanmak istiyorsanız gereklidir.
* <a href="https://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - `UJSONResponse` kullanmak istiyorsanız gereklidir.
## Lisans ## Lisans { #license }
Bu proje, MIT lisansı şartları altında lisanslanmıştır. Bu proje MIT lisansı şartları altında lisanslanmıştır.

4
docs/tr/docs/learn/index.md

@ -1,5 +1,5 @@
# Öğren # Öğren { #learn }
**FastAPI** öğrenmek için giriş bölümleri ve öğreticiler burada yer alıyor. **FastAPI** öğrenmek için giriş bölümleri ve öğreticiler burada yer alıyor.
Burayı, bir **kitap**, bir **kurs**, ve FastAPI öğrenmenin **resmi** ve önerilen yolu olarak düşünülebilirsiniz. 😎 Burayı, bir **kitap**, bir **kurs**, FastAPI öğrenmenin **resmi** ve önerilen yolu olarak düşünebilirsiniz. 😎

112
docs/tr/docs/project-generation.md

@ -1,84 +1,28 @@
# Proje oluşturma - Şablonlar # Full Stack FastAPI Şablonu { #full-stack-fastapi-template }
Başlamak için bir proje oluşturucu kullanabilirsiniz, çünkü sizin için önceden yapılmış birçok başlangıç ​​kurulumu, güvenlik, veritabanı ve temel API endpoinlerini içerir. Şablonlar genellikle belirli bir kurulumla gelir, ancak esnek ve özelleştirilebilir olacak şekilde tasarlanırlar. Bu sayede şablonu projenizin gereksinimlerine göre değiştirip uyarlayabilir, çok iyi bir başlangıç noktası olarak kullanabilirsiniz. 🏁
Bir proje oluşturucu, her zaman kendi ihtiyaçlarınıza göre güncellemeniz ve uyarlamanız gereken esnek bir kuruluma sahip olacaktır, ancak bu, projeniz için iyi bir başlangıç ​​noktası olabilir. Bu şablonu başlangıç için kullanabilirsiniz; çünkü ilk kurulumun, güvenliğin, veritabanının ve bazı API endpoint'lerinin önemli bir kısmı sizin için zaten hazırlanmıştır.
## Full Stack FastAPI PostgreSQL GitHub Repository: <a href="https://github.com/tiangolo/full-stack-fastapi-template" class="external-link" target="_blank">Full Stack FastAPI Template</a>
GitHub: <a href="https://github.com/tiangolo/full-stack-fastapi-postgresql" class="external-link" target="_blank">https://github.com/tiangolo/full-stack-fastapi-postgresql</a> ## Full Stack FastAPI Şablonu - Teknoloji Yığını ve Özellikler { #full-stack-fastapi-template-technology-stack-and-features }
### Full Stack FastAPI PostgreSQL - Özellikler - ⚡ Python backend API için [**FastAPI**](https://fastapi.tiangolo.com/tr).
- 🧰 Python SQL veritabanı etkileşimleri (ORM) için [SQLModel](https://sqlmodel.tiangolo.com).
* Full **Docker** entegrasyonu (Docker based). - 🔍 FastAPI'nin kullandığı; veri doğrulama ve ayarlar yönetimi için [Pydantic](https://docs.pydantic.dev).
* Docker Swarm Mode ile deployment. - 💾 SQL veritabanı olarak [PostgreSQL](https://www.postgresql.org).
* **Docker Compose** entegrasyonu ve lokal geliştirme için optimizasyon. - 🚀 frontend için [React](https://react.dev).
* Uvicorn ve Gunicorn ile **Production ready** Python web server'ı. - 💃 TypeScript, hooks, Vite ve modern bir frontend stack'inin diğer parçalarını kullanır.
* Python <a href="https://github.com/fastapi/fastapi" class="external-link" target="_blank">**FastAPI**</a> backend: - 🎨 frontend component'leri için [Tailwind CSS](https://tailwindcss.com) ve [shadcn/ui](https://ui.shadcn.com).
* **Hızlı**: **NodeJS** ve **Go** ile eşit, çok yüksek performans (Starlette ve Pydantic'e teşekkürler). - 🤖 Otomatik üretilen bir frontend client.
* **Sezgisel**: Editor desteğı. <abbr title="auto-complete, IntelliSense gibi isimlerle de bilinir">Otomatik tamamlama</abbr>. Daha az debugging. - 🧪 End-to-End testleri için [Playwright](https://playwright.dev).
* **Kolay**: Kolay öğrenip kolay kullanmak için tasarlandı. Daha az döküman okuma daha çok iş. - 🦇 Dark mode desteği.
* **Kısa**: Minimum kod tekrarı. Her parametre bildiriminde birden çok özellik. - 🐋 Geliştirme ve production için [Docker Compose](https://www.docker.com).
* **Güçlü**: Production-ready. Otomatik interaktif dökümantasyon. - 🔒 Varsayılan olarak güvenli password hashing.
* **Standartlara dayalı**: API'ler için açık standartlara dayanır (ve tamamen uyumludur): <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> ve <a href="https://json-schema.org/" class="external-link" target="_blank">JSON Şeması</a>. - 🔑 JWT (JSON Web Token) authentication.
* <a href="https://fastapi.tiangolo.com/features/" class="external-link" target="_blank">**Birçok diger özelliği**</a> dahili otomatik doğrulama, serialization, interaktif dokümantasyon, OAuth2 JWT token ile authentication, vb. - 📫 E-posta tabanlı şifre kurtarma.
* **Güvenli şifreleme** . - ✅ [Pytest](https://pytest.org) ile testler.
* **JWT token** kimlik doğrulama. - 📞 Reverse proxy / load balancer olarak [Traefik](https://traefik.io).
* **SQLAlchemy** models (Flask dan bağımsızdır. Celery worker'ları ile kullanılabilir). - 🚢 Docker Compose kullanarak deployment talimatları; otomatik HTTPS sertifikalarını yönetmek için bir frontend Traefik proxy'sini nasıl kuracağınız dahil.
* Kullanıcılar için temel başlangıç ​​modeli (gerektiği gibi değiştirin ve kaldırın). - 🏭 GitHub Actions tabanlı CI (continuous integration) ve CD (continuous deployment).
* **Alembic** migration.
* **CORS** (Cross Origin Resource Sharing).
* **Celery** worker'ları ile backend içerisinden seçilen işleri çalıştırabilirsiniz.
* **Pytest**'e dayalı, Docker ile entegre REST backend testleri ile veritabanından bağımsız olarak tam API etkileşimini test edebilirsiniz. Docker'da çalıştığı için her seferinde sıfırdan yeni bir veri deposu oluşturabilir (böylece ElasticSearch, MongoDB, CouchDB veya ne istersen kullanabilirsin ve sadece API'nin çalışıp çalışmadığını test edebilirsin).
* Atom Hydrogen veya Visual Studio Code Jupyter gibi uzantılarla uzaktan veya Docker içi geliştirme için **Jupyter Çekirdekleri** ile kolay Python entegrasyonu.
* **Vue** ile frontend:
* Vue CLI ile oluşturulmuş.
* Dahili **JWT kimlik doğrulama**.
* Dahili Login.
* Login sonrası, Kontrol paneli.
* Kullanıcı oluşturma ve düzenleme kontrol paneli
* Kendi kendine kullanıcı sürümü.
* **Vuex**.
* **Vue-router**.
* **Vuetify** güzel material design kompanentleri için.
* **TypeScript**.
* **Nginx** tabanlı Docker sunucusu (Vue-router için yapılandırılmış).
* Docker ile multi-stage yapı, böylece kodu derlemeniz, kaydetmeniz veya işlemeniz gerekmez.
* Derleme zamanında Frontend testi (devre dışı bırakılabilir).
* Mümkün olduğu kadar modüler yapılmıştır, bu nedenle kutudan çıktığı gibi çalışır, ancak Vue CLI ile yeniden oluşturabilir veya ihtiyaç duyduğunuz şekilde oluşturabilir ve istediğinizi yeniden kullanabilirsiniz.
* **PGAdmin** PostgreSQL database admin tool'u, PHPMyAdmin ve MySQL ile kolayca değiştirilebilir.
* **Flower** ile Celery job'larını monitörleme.
* **Traefik** ile backend ve frontend arasında yük dengeleme, böylece her ikisini de aynı domain altında, path ile ayrılmış, ancak farklı kapsayıcılar tarafından sunulabilirsiniz.
* Let's Encrypt **HTTPS** sertifikalarının otomatik oluşturulması dahil olmak üzere Traefik entegrasyonu.
* GitLab **CI** (sürekli entegrasyon), backend ve frontend testi dahil.
## Full Stack FastAPI Couchbase
GitHub: <a href="https://github.com/tiangolo/full-stack-fastapi-couchbase" class="external-link" target="_blank">https://github.com/tiangolo/full-stack-fastapi-couchbase</a>
⚠️ **UYARI** ⚠️
Sıfırdan bir projeye başlıyorsanız alternatiflerine bakın.
Örneğin, <a href="https://github.com/tiangolo/full-stack-fastapi-postgresql" class="external-link" target="_blank">Full Stack FastAPI PostgreSQL</a> daha iyi bir alternatif olabilir, aktif olarak geliştiriliyor ve kullanılıyor. Ve yeni özellik ve ilerlemelere sahip.
İsterseniz Couchbase tabanlı generator'ı kullanmakta özgürsünüz, hala iyi çalışıyor olmalı ve onunla oluşturulmuş bir projeniz varsa bu da sorun değil (ve muhtemelen zaten ihtiyaçlarınıza göre güncellediniz).
Bununla ilgili daha fazla bilgiyi repo belgelerinde okuyabilirsiniz.
## Full Stack FastAPI MongoDB
... müsaitliğime ve diğer faktörlere bağlı olarak daha sonra gelebilir. 😅 🎉
## Machine Learning modelleri, spaCy ve FastAPI
GitHub: <a href="https://github.com/microsoft/cookiecutter-spacy-fastapi" class="external-link" target="_blank">https://github.com/microsoft/cookiecutter-spacy-fastapi</a>
### Machine Learning modelleri, spaCy ve FastAPI - Features
* **spaCy** NER model entegrasyonu.
* **Azure Cognitive Search** yerleşik istek biçimi.
* Uvicorn ve Gunicorn ile **Production ready** Python web server'ı.
* Dahili **Azure DevOps** Kubernetes (AKS) CI/CD deployment.
* **Multilingual**, Proje kurulumu sırasında spaCy'nin yerleşik dillerinden birini kolayca seçin.
* **Esnetilebilir** diğer frameworkler (Pytorch, Tensorflow) ile de çalışır sadece spaCy değil.

421
docs/tr/docs/python-types.md

@ -1,76 +1,74 @@
# Python Veri Tiplerine Giriş # Python Tiplerine Giriş { #python-types-intro }
Python isteğe bağlı olarak "tip belirteçlerini" destekler. Python, isteğe bağlı "type hints" (diğer adıyla "type annotations") desteğine sahiptir.
**"Tip belirteçleri"** bir değişkenin <abbr title="örneğin: str, int, float, bool">tipinin</abbr> belirtilmesine olanak sağlayan özel bir sözdizimidir. Bu **"type hints"** veya annotations, bir değişkenin <abbr title="örneğin: str, int, float, bool">type</abbr>'ını bildirmeye yarayan özel bir sözdizimidir.
Değişkenlerin tiplerini belirterek editör ve araçlardan daha fazla destek alabilirsiniz. Değişkenleriniz için type bildirerek, editörler ve araçlar size daha iyi destek sağlayabilir.
Bu pythonda tip belirteçleri için **hızlı bir başlangıç / bilgi tazeleme** rehberidir . Bu rehber **FastAPI** kullanmak için gereken minimum konuyu kapsar ki bu da çok az bir miktardır. Bu, Python type hints hakkında sadece **hızlı bir eğitim / bilgi tazeleme** dokümanıdır. **FastAPI** ile kullanmak için gereken minimum bilgiyi kapsar... ki aslında bu çok azdır.
**FastAPI' nin** tamamı bu tür tip belirteçleri ile donatılmıştır ve birçok avantaj sağlamaktadır. **FastAPI** tamamen bu type hints üzerine kuruludur; bunlar ona birçok avantaj ve fayda sağlar.
**FastAPI** kullanmayacak olsanız bile tür belirteçleri hakkında bilgi edinmenizde fayda var. Ancak hiç **FastAPI** kullanmasanız bile, bunlar hakkında biraz öğrenmeniz size fayda sağlayacaktır.
/// note | Not /// note | Not
Python uzmanıysanız ve tip belirteçleri ilgili her şeyi zaten biliyorsanız, sonraki bölüme geçin. Eğer bir Python uzmanıysanız ve type hints hakkında her şeyi zaten biliyorsanız, sonraki bölüme geçin.
/// ///
## Motivasyon ## Motivasyon { #motivation }
Basit bir örnek ile başlayalım: Basit bir örnekle başlayalım:
{* ../../docs_src/python_types/tutorial001.py *} {* ../../docs_src/python_types/tutorial001_py39.py *}
Bu programı çalıştırınca şu çıktıyı alırsınız:
Programın çıktısı:
``` ```
John Doe John Doe
``` ```
Fonksiyon sırayla şunları yapar: Fonksiyon şunları yapar:
* `first_name` ve `last_name` değerlerini alır. * `first_name` ve `last_name` değerlerini alır.
* `title()` ile değişkenlerin ilk karakterlerini büyütür. * `title()` ile her birinin ilk harfini büyük harfe çevirir.
* Değişkenleri aralarında bir boşlukla beraber <abbr title="Onları bir bütün olarak sırayla birleştirir.">Birleştirir</abbr>. * Ortada bir boşluk olacak şekilde <abbr title="Hepsini, tek bir bütün olacak şekilde bir araya koyar. İçerikler ardışık şekilde yer alır.">Concatenates</abbr> eder.
{* ../../docs_src/python_types/tutorial001.py hl[2] *}
{* ../../docs_src/python_types/tutorial001_py39.py hl[2] *}
### Düzenle ### Düzenleyelim { #edit-it }
Bu çok basit bir program. Bu çok basit bir program.
Ama şimdi sıfırdan yazdığınızı hayal edin. Ama şimdi bunu sıfırdan yazdığınızı hayal edin.
Bir noktada fonksiyonun tanımına başlayacaktınız, parametreleri hazır hale getirdiniz... Bir noktada fonksiyon tanımını yazmaya başlamış olacaktınız, parametreler hazır...
Ama sonra "ilk harfi büyük harfe dönüştüren yöntemi" çağırmanız gerekir. Ama sonra "ilk harfi büyük harfe çeviren method"u çağırmanız gerekiyor.
`upper` mıydı ? Yoksa `uppercase`' mi? `first_uppercase`? `capitalize`? `upper` mıydı? `uppercase` miydi? `first_uppercase`? `capitalize`?
Ardından, programcıların en iyi arkadaşı olan otomatik tamamlama ile denediniz. Sonra eski programcı dostuyla denersiniz: editör autocomplete.
'first_name', ardından bir nokta ('.') yazıp otomatik tamamlamayı tetiklemek için 'Ctrl+Space' tuşlarına bastınız. Fonksiyonun ilk parametresi olan `first_name`'i yazarsınız, sonra bir nokta (`.`) ve ardından autocomplete'i tetiklemek için `Ctrl+Space`'e basarsınız.
Ancak, ne yazık ki, yararlı hiçbir şey elde edemediniz: Ama ne yazık ki, işe yarar bir şey göremezsiniz:
<img src="/img/python-types/image01.png"> <img src="/img/python-types/image01.png">
### Tipleri ekle ### Tipleri ekleyelim { #add-types }
Önceki sürümden sadece bir satırı değiştirelim. Önceki sürümden tek bir satırı değiştirelim.
Tam olarak bu parçayı, işlevin parametrelerini değiştireceğiz: Fonksiyonun parametreleri olan şu parçayı:
```Python ```Python
first_name, last_name first_name, last_name
``` ```
ve bu hale getireceğiz: şuna çevireceğiz:
```Python ```Python
first_name: str, last_name: str first_name: str, last_name: str
@ -78,58 +76,55 @@ ve bu hale getireceğiz:
Bu kadar. Bu kadar.
İşte bunlar "tip belirteçleri": Bunlar "type hints":
{* ../../docs_src/python_types/tutorial002.py hl[1] *}
{* ../../docs_src/python_types/tutorial002_py39.py hl[1] *}
Bu, aşağıdaki gibi varsayılan değerleri bildirmekle aynı şey değildir: Bu, aşağıdaki gibi default değerler bildirmekle aynı şey değildir:
```Python ```Python
first_name="john", last_name="doe" first_name="john", last_name="doe"
``` ```
Bu tamamen farklı birşey Bu farklı bir şey.
İki nokta üst üste (`:`) kullanıyoruz , eşittir (`=`) değil. Eşittir (`=`) değil, iki nokta (`:`) kullanıyoruz.
Normalde tip belirteçleri eklemek, kod üzerinde olacakları değiştirmez. Ve type hints eklemek, normalde onlarsız ne oluyorsa onu değiştirmez.
Şimdi programı sıfırdan birdaha yazdığınızı hayal edin. Ama şimdi, type hints ile o fonksiyonu oluşturmanın ortasında olduğunuzu tekrar hayal edin.
Aynı noktada, `Ctrl+Space` ile otomatik tamamlamayı tetiklediniz ve şunu görüyorsunuz: Aynı noktada, `Ctrl+Space` ile autocomplete'i tetiklemeye çalışırsınız ve şunu görürsünüz:
<img src="/img/python-types/image02.png"> <img src="/img/python-types/image02.png">
Aradığınızı bulana kadar seçenekleri kaydırabilirsiniz: Bununla birlikte, seçenekleri görerek kaydırabilirsiniz; ta ki "tanıdık gelen" seçeneği bulana kadar:
<img src="/img/python-types/image03.png"> <img src="/img/python-types/image03.png">
## Daha fazla motivasyon ## Daha fazla motivasyon { #more-motivation }
Bu fonksiyon, zaten tür belirteçlerine sahip: Şu fonksiyona bakın, zaten type hints içeriyor:
{* ../../docs_src/python_types/tutorial003.py hl[1] *} {* ../../docs_src/python_types/tutorial003_py39.py hl[1] *}
Editör değişkenlerin tiplerini bildiği için, sadece completion değil, aynı zamanda hata kontrolleri de alırsınız:
Editör değişkenlerin tiplerini bildiğinden, yalnızca otomatik tamamlama değil, hata kontrolleri de sağlar:
<img src="/img/python-types/image04.png"> <img src="/img/python-types/image04.png">
Artık `age` değişkenini `str(age)` olarak kullanmanız gerektiğini biliyorsunuz: Artık bunu düzeltmeniz gerektiğini, `age`'i `str(age)` ile string'e çevirmeniz gerektiğini biliyorsunuz:
{* ../../docs_src/python_types/tutorial004.py hl[2] *}
{* ../../docs_src/python_types/tutorial004_py39.py hl[2] *}
## Tip bildirme ## Tipleri bildirmek { #declaring-types }
Az önce tip belirteçlerinin en çok kullanıldığı yeri gördünüz. Type hints bildirmek için ana yeri az önce gördünüz: fonksiyon parametreleri.
**FastAPI**ile çalışırken tip belirteçlerini en çok kullanacağımız yer yine fonksiyonlardır. Bu, **FastAPI** ile kullanırken de onları en çok kullanacağınız yerdir.
### Basit tipler ### Basit tipler { #simple-types }
Yalnızca `str` değil, tüm standart Python tiplerinin bildirebilirsiniz. Sadece `str` değil, tüm standart Python tiplerini bildirebilirsiniz.
Örneğin şunları kullanabilirsiniz: Örneğin şunları kullanabilirsiniz:
@ -138,176 +133,332 @@ Yalnızca `str` değil, tüm standart Python tiplerinin bildirebilirsiniz.
* `bool` * `bool`
* `bytes` * `bytes`
{* ../../docs_src/python_types/tutorial005.py hl[1] *} {* ../../docs_src/python_types/tutorial005_py39.py hl[1] *}
### Tip parametreleri ile Generic tipler { #generic-types-with-type-parameters }
`dict`, `list`, `set` ve `tuple` gibi, başka değerler içerebilen bazı veri yapıları vardır. Ve iç değerlerin kendi tipi de olabilir.
### Tip parametreleri ile Generic tipler İç tipleri olan bu tiplere "**generic**" tipler denir. Ve bunları, iç tipleriyle birlikte bildirmek mümkündür.
"dict", "list", "set" ve "tuple" gibi diğer değerleri içerebilen bazı veri yapıları vardır. Ve dahili değerlerinin de tip belirtecleri olabilir. Bu tipleri ve iç tipleri bildirmek için standart Python modülü `typing`'i kullanabilirsiniz. Bu modül, özellikle bu type hints desteği için vardır.
Bu tipleri ve dahili tpileri bildirmek için standart Python modülünü "typing" kullanabilirsiniz. #### Python'un daha yeni sürümleri { #newer-versions-of-python }
Bu tür tip belirteçlerini desteklemek için özel olarak mevcuttur. `typing` kullanan sözdizimi, Python 3.6'dan en yeni sürümlere kadar (Python 3.9, Python 3.10, vb. dahil) tüm sürümlerle **uyumludur**.
#### `List` Python geliştikçe, **daha yeni sürümler** bu type annotations için daha iyi destekle gelir ve çoğu durumda type annotations bildirmek için `typing` modülünü import edip kullanmanız bile gerekmez.
Örneğin `str` değerlerden oluşan bir `list` tanımlayalım. Projeniz için daha yeni bir Python sürümü seçebiliyorsanız, bu ek sadelikten yararlanabilirsiniz.
From `typing`, import `List` (büyük harf olan `L` ile): Tüm dokümanlarda her Python sürümüyle uyumlu örnekler vardır (fark olduğunda).
{* ../../docs_src/python_types/tutorial006.py hl[1] *} Örneğin "**Python 3.6+**", Python 3.6 veya üstüyle (3.7, 3.8, 3.9, 3.10, vb. dahil) uyumludur. "**Python 3.9+**" ise Python 3.9 veya üstüyle (3.10 vb. dahil) uyumludur.
Eğer **Python'un en güncel sürümlerini** kullanabiliyorsanız, en güncel sürüme ait örnekleri kullanın; bunlar **en iyi ve en basit sözdizimine** sahip olur, örneğin "**Python 3.10+**".
Değişkenin tipini yine iki nokta üstüste (`:`) ile belirleyin. #### List { #list }
tip olarak `List` kullanın. Örneğin, `str`'lerden oluşan bir `list` olan bir değişken tanımlayalım.
Liste, bazı dahili tipleri içeren bir tür olduğundan, bunları köşeli parantez içine alırsınız: Değişkeni, aynı iki nokta (`:`) sözdizimiyle bildirin.
{* ../../docs_src/python_types/tutorial006.py hl[4] *} Type olarak `list` yazın.
`list`, bazı iç tipleri barındıran bir tip olduğundan, bunları köşeli parantez içine yazarsınız:
/// tip | Ipucu {* ../../docs_src/python_types/tutorial006_py39.py hl[1] *}
Köşeli parantez içindeki bu dahili tiplere "tip parametreleri" denir. /// info | Bilgi
Bu durumda `str`, `List`e iletilen tür parametresidir. Köşeli parantez içindeki bu iç tiplere "type parameters" denir.
Bu durumda `str`, `list`'e verilen type parameter'dır.
/// ///
Bunun anlamı şudur: "`items` değişkeni bir `list`tir ve bu listedeki öğelerin her biri bir `str`dir". Bu şu demektir: "`items` değişkeni bir `list` ve bu listedeki her bir öğe `str`".
Bunu yaparak, düzenleyicinizin listedeki öğeleri işlerken bile destek sağlamasını sağlayabilirsiniz: Bunu yaparak, editörünüz listeden öğeleri işlerken bile destek sağlayabilir:
<img src="/img/python-types/image05.png"> <img src="/img/python-types/image05.png">
Tip belirteçleri olmadan, bunu başarmak neredeyse imkansızdır. Tipler olmadan, bunu başarmak neredeyse imkansızdır.
`item` değişkeninin `items` listesindeki öğelerden biri olduğuna dikkat edin. `item` değişkeninin, `items` listesindeki elemanlardan biri olduğuna dikkat edin.
Ve yine, editör bunun bir `str` ​​olduğunu biliyor ve bunun için destek sağlıyor. Ve yine de editör bunun bir `str` olduğunu bilir ve buna göre destek sağlar.
#### `Tuple` ve `Set` #### Tuple ve Set { #tuple-and-set }
`Tuple` ve `set`lerin tiplerini bildirmek için de aynısını yapıyoruz: `tuple`'ları ve `set`'leri bildirmek için de aynısını yaparsınız:
{* ../../docs_src/python_types/tutorial007.py hl[1,4] *} {* ../../docs_src/python_types/tutorial007_py39.py hl[1] *}
Bu şu anlama gelir:
Bu şu anlama geliyor: * `items_t` değişkeni 3 öğeli bir `tuple`'dır: bir `int`, bir başka `int` ve bir `str`.
* `items_s` değişkeni bir `set`'tir ve her bir öğesi `bytes` tipindedir.
* `items_t` değişkeni sırasıyla `int`, `int`, ve `str` tiplerinden oluşan bir `tuple` türündedir . #### Dict { #dict }
* `items_s` ise her öğesi `bytes` türünde olan bir `set` örneğidir.
#### `Dict` Bir `dict` tanımlamak için, virgülle ayrılmış 2 type parameter verirsiniz.
Bir `dict` tanımlamak için virgülle ayrılmış iki parametre verebilirsiniz. İlk type parameter, `dict`'in key'leri içindir.
İlk tip parametresi `dict` değerinin `key` değeri içindir. İkinci type parameter, `dict`'in value'ları içindir:
İkinci parametre ise `dict` değerinin `value` değeri içindir: {* ../../docs_src/python_types/tutorial008_py39.py hl[1] *}
{* ../../docs_src/python_types/tutorial008.py hl[1,4] *} Bu şu anlama gelir:
* `prices` değişkeni bir `dict`'tir:
* Bu `dict`'in key'leri `str` tipindedir (örneğin her bir öğenin adı).
* Bu `dict`'in value'ları `float` tipindedir (örneğin her bir öğenin fiyatı).
Bu şu anlama gelir: #### Union { #union }
Bir değişkenin **birkaç tipten herhangi biri** olabileceğini bildirebilirsiniz; örneğin bir `int` veya bir `str`.
Python 3.6 ve üzeri sürümlerde (Python 3.10 dahil), `typing` içinden `Union` tipini kullanabilir ve köşeli parantez içine kabul edilecek olası tipleri yazabilirsiniz.
Python 3.10'da ayrıca, olası tipleri <abbr title='also called "bitwise or operator", but that meaning is not relevant here'>vertical bar (`|`)</abbr> ile ayırabildiğiniz **yeni bir sözdizimi** de vardır.
//// tab | Python 3.10+
```Python hl_lines="1"
{!> ../../docs_src/python_types/tutorial008b_py310.py!}
```
////
//// tab | Python 3.9+
```Python hl_lines="1 4"
{!> ../../docs_src/python_types/tutorial008b_py39.py!}
```
////
* `prices` değişkeni `dict` tipindedir: Her iki durumda da bu, `item`'ın `int` veya `str` olabileceği anlamına gelir.
* `dict` değişkeninin `key` değeri `str` tipindedir (herbir item'ın "name" değeri).
* `dict` değişkeninin `value` değeri `float` tipindedir (lherbir item'ın "price" değeri).
#### `Optional` #### Muhtemelen `None` { #possibly-none }
`Optional` bir değişkenin `str`gibi bir tipi olabileceğini ama isteğe bağlı olarak tipinin `None` olabileceğini belirtir: Bir değerin `str` gibi bir tipi olabileceğini ama aynı zamanda `None` da olabileceğini bildirebilirsiniz.
Python 3.6 ve üzeri sürümlerde (Python 3.10 dahil), `typing` modülünden `Optional` import edip kullanarak bunu bildirebilirsiniz.
```Python hl_lines="1 4"
{!../../docs_src/python_types/tutorial009_py39.py!}
```
Sadece `str` yerine `Optional[str]` kullanmak, aslında değer `None` olabilecekken her zaman `str` olduğunu varsaydığınız hataları editörün yakalamanıza yardımcı olmasını sağlar.
`Optional[Something]`, aslında `Union[Something, None]` için bir kısayoldur; eşdeğerdirler.
Bu aynı zamanda Python 3.10'da `Something | None` kullanabileceğiniz anlamına gelir:
//// tab | Python 3.10+
```Python hl_lines="1"
{!> ../../docs_src/python_types/tutorial009_py310.py!}
```
////
//// tab | Python 3.9+
```Python hl_lines="1 4"
{!> ../../docs_src/python_types/tutorial009_py39.py!}
```
////
//// tab | Python 3.9+ alternatif
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!../../docs_src/python_types/tutorial009.py!} {!> ../../docs_src/python_types/tutorial009b_py39.py!}
```
////
#### `Union` veya `Optional` kullanmak { #using-union-or-optional }
Python sürümünüz 3.10'un altındaysa, benim oldukça **öznel** bakış açıma göre küçük bir ipucu:
* 🚨 `Optional[SomeType]` kullanmaktan kaçının
* Bunun yerine ✨ **`Union[SomeType, None]` kullanın** ✨.
İkisi eşdeğerdir ve altta aynı şeydir; ama ben `Optional` yerine `Union` önermeyi tercih ederim. Çünkü "**optional**" kelimesi değerin optional olduğunu ima ediyor gibi durur; ama gerçekte anlamı "değer `None` olabilir"dir. Değer optional olmasa ve hâlâ required olsa bile.
Bence `Union[SomeType, None]` ne anlama geldiğini daha açık şekilde ifade ediyor.
Bu, tamamen kelimeler ve isimlendirmelerle ilgili. Ancak bu kelimeler, sizin ve ekip arkadaşlarınızın kod hakkında nasıl düşündüğünü etkileyebilir.
Örnek olarak şu fonksiyonu ele alalım:
{* ../../docs_src/python_types/tutorial009c_py39.py hl[1,4] *}
`name` parametresi `Optional[str]` olarak tanımlanmış, ama **optional değil**; parametre olmadan fonksiyonu çağıramazsınız:
```Python
say_hi() # Oh, no, this throws an error! 😱
```
`name` parametresi **hâlâ required**'dır (*optional* değildir) çünkü bir default değeri yoktur. Yine de `name`, değer olarak `None` kabul eder:
```Python
say_hi(name=None) # This works, None is valid 🎉
``` ```
`str` yerine `Optional[str]` kullanmak editorün bu değerin her zaman `str` tipinde değil bazen `None` tipinde de olabileceğini belirtir ve hataları tespit etmemizde yardımcı olur. İyi haber şu ki, Python 3.10'a geçtiğinizde bununla uğraşmanız gerekmeyecek; çünkü tiplerin union'larını tanımlamak için doğrudan `|` kullanabileceksiniz:
{* ../../docs_src/python_types/tutorial009c_py310.py hl[1,4] *}
Ve böylece `Optional` ve `Union` gibi isimlerle de uğraşmanız gerekmeyecek. 😎
#### Generic tipler { #generic-types }
Köşeli parantez içinde type parameter alan bu tiplere **Generic types** veya **Generics** denir, örneğin:
//// tab | Python 3.10+
#### Generic tipler Aynı builtin tipleri generics olarak kullanabilirsiniz (köşeli parantez ve içindeki tiplerle):
Köşeli parantez içinde tip parametreleri alan bu türler, örneğin: * `list`
* `tuple`
* `set`
* `dict`
* `List` Ve önceki Python sürümlerinde olduğu gibi `typing` modülünden:
* `Tuple`
* `Set` * `Union`
* `Dict`
* `Optional` * `Optional`
* ...and others. * ...and others.
**Generic types** yada **Generics** olarak adlandırılır. Python 3.10'da, `Union` ve `Optional` generics'lerini kullanmaya alternatif olarak, tip union'larını bildirmek için <abbr title='also called "bitwise or operator", but that meaning is not relevant here'>vertical bar (`|`)</abbr> kullanabilirsiniz; bu çok daha iyi ve daha basittir.
////
//// tab | Python 3.9+
Aynı builtin tipleri generics olarak kullanabilirsiniz (köşeli parantez ve içindeki tiplerle):
* `list`
* `tuple`
* `set`
* `dict`
### Tip olarak Sınıflar Ve `typing` modülünden gelen generics:
Bir değişkenin tipini bir sınıf ile bildirebilirsiniz. * `Union`
* `Optional`
* ...and others.
////
Diyelim ki `name` değerine sahip `Person` sınıfınız var: ### Tip olarak sınıflar { #classes-as-types }
{* ../../docs_src/python_types/tutorial010.py hl[1:3] *} Bir sınıfı da bir değişkenin tipi olarak bildirebilirsiniz.
Örneğin, adı olan bir `Person` sınıfınız olsun:
Sonra bir değişkeni 'Person' tipinde tanımlayabilirsiniz: {* ../../docs_src/python_types/tutorial010_py39.py hl[1:3] *}
{* ../../docs_src/python_types/tutorial010.py hl[6] *} Sonra bir değişkeni `Person` tipinde olacak şekilde bildirebilirsiniz:
{* ../../docs_src/python_types/tutorial010_py39.py hl[6] *}
Ve yine bütün editör desteğini alırsınız: Ve sonra, yine tüm editör desteğini alırsınız:
<img src="/img/python-types/image06.png"> <img src="/img/python-types/image06.png">
## Pydantic modelleri Bunun "`one_person`, `Person` sınıfının bir **instance**'ıdır" anlamına geldiğine dikkat edin.
<a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a> veri doğrulaması yapmak için bir Python kütüphanesidir. "`one_person`, `Person` adlı **class**'tır" anlamına gelmez.
Verilerin "biçimini" niteliklere sahip sınıflar olarak düzenlersiniz. ## Pydantic modelleri { #pydantic-models }
Ve her niteliğin bir türü vardır. <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a>, data validation yapmak için bir Python kütüphanesidir.
Sınıfın bazı değerlerle bir örneğini oluşturursunuz ve değerleri doğrular, bunları uygun türe dönüştürür ve size tüm verileri içeren bir nesne verir. Verinin "shape"'ini attribute'lara sahip sınıflar olarak tanımlarsınız.
Ve ortaya çıkan nesne üzerindeki bütün editör desteğini alırsınız. Ve her attribute'un bir tipi vardır.
Resmi Pydantic dokümanlarından alınmıştır: Ardından o sınıfın bir instance'ını bazı değerlerle oluşturursunuz; bu değerleri doğrular, uygun tipe dönüştürür (gerekliyse) ve size tüm veriyi içeren bir nesne verir.
{* ../../docs_src/python_types/tutorial011.py *} Ve bu ortaya çıkan nesne ile tüm editör desteğini alırsınız.
Resmî Pydantic dokümanlarından bir örnek:
/// info {* ../../docs_src/python_types/tutorial011_py310.py *}
Daha fazla şey öğrenmek için <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic'i takip edin</a>. /// info | Bilgi
Daha fazlasını öğrenmek için <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic'in dokümanlarına bakın</a>.
/// ///
**FastAPI** tamamen Pydantic'e dayanmaktadır. **FastAPI** tamamen Pydantic üzerine kuruludur.
Bunların pratikte nasıl çalıştığını [Tutorial - User Guide](tutorial/index.md){.internal-link target=_blank} içinde çok daha fazla göreceksiniz.
/// tip | İpucu
Pydantic, default value olmadan `Optional` veya `Union[Something, None]` kullandığınızda özel bir davranışa sahiptir; bununla ilgili daha fazla bilgiyi Pydantic dokümanlarında <a href="https://docs.pydantic.dev/2.3/usage/models/#required-fields" class="external-link" target="_blank">Required Optional fields</a> bölümünde okuyabilirsiniz.
///
## Metadata Annotations ile Type Hints { #type-hints-with-metadata-annotations }
Python'da ayrıca, `Annotated` kullanarak bu type hints içine **ek <abbr title="Veri hakkında veri; bu durumda type hakkında bilgi, örneğin bir açıklama.">metadata</abbr>** koymayı sağlayan bir özellik de vardır.
Daha fazlasini görmek için [Tutorial - User Guide](tutorial/index.md){.internal-link target=_blank}. Python 3.9'dan itibaren `Annotated`, standart kütüphanenin bir parçasıdır; bu yüzden `typing` içinden import edebilirsiniz.
{* ../../docs_src/python_types/tutorial013_py39.py hl[1,4] *}
Python'un kendisi bu `Annotated` ile bir şey yapmaz. Editörler ve diğer araçlar için tip hâlâ `str`'dir.
Ama **FastAPI**'ye uygulamanızın nasıl davranmasını istediğinize dair ek metadata sağlamak için `Annotated` içindeki bu alanı kullanabilirsiniz.
Hatırlanması gereken önemli nokta: `Annotated`'a verdiğiniz **ilk *type parameter***, **gerçek tip**tir. Geri kalanı ise diğer araçlar için metadatadır.
Şimdilik, sadece `Annotated`'ın var olduğunu ve bunun standart Python olduğunu bilmeniz yeterli. 😎
İleride bunun ne kadar **güçlü** olabildiğini göreceksiniz.
/// tip | İpucu
Bunun **standart Python** olması, editörünüzde mümkün olan **en iyi developer experience**'ı almaya devam edeceğiniz anlamına gelir; kodu analiz etmek ve refactor etmek için kullandığınız araçlarla da, vb. ✨
Ayrıca kodunuzun pek çok başka Python aracı ve kütüphanesiyle çok uyumlu olacağı anlamına gelir. 🚀
///
## **FastAPI** tip belirteçleri ## **FastAPI**'de type hints { #type-hints-in-fastapi }
**FastAPI** birkaç şey yapmak için bu tür tip belirteçlerinden faydalanır. **FastAPI**, birkaç şey yapmak için bu type hints'ten faydalanır.
**FastAPI** ile parametre tiplerini bildirirsiniz ve şunları elde edersiniz: **FastAPI** ile type hints kullanarak parametreleri bildirirsiniz ve şunları elde edersiniz:
* **Editor desteği**. * **Editör desteği**.
* **Tip kontrolü**. * **Tip kontrolleri**.
...ve **FastAPI** aynı belirteçleri şunlar için de kullanıyor: ...ve **FastAPI** aynı bildirimleri şunlar için de kullanır:
* **Gereksinimleri tanımlama**: request path parameters, query parameters, headers, bodies, dependencies, ve benzeri gereksinimlerden * **Gereksinimleri tanımlamak**: request path parameters, query parameters, headers, bodies, dependencies, vb.
* **Verileri çevirme**: Gönderilen veri tipinden istenilen veri tipine çevirme. * **Veriyi dönüştürmek**: request'ten gerekli tipe.
* **Verileri doğrulama**: Her gönderilen verinin: * **Veriyi doğrulamak**: her request'ten gelen veriyi:
* doğrulanması ve geçersiz olduğunda **otomatik hata** oluşturma. * Veri geçersiz olduğunda client'a dönen **otomatik hatalar** üretmek.
* OpenAPI kullanarak apinizi **Belgeleyin** : * OpenAPI kullanarak API'yi **dokümante etmek**:
* bu daha sonra otomatik etkileşimli dokümantasyon kullanıcı arayüzü tarafından kullanılır. * bu, daha sonra otomatik etkileşimli dokümantasyon kullanıcı arayüzleri tarafından kullanılır.
Bütün bunlar kulağa soyut gelebilir. Merak etme. Tüm bunları çalışırken göreceksiniz. [Tutorial - User Guide](tutorial/index.md){.internal-link target=_blank}. Bunların hepsi kulağa soyut gelebilir. Merak etmeyin. Tüm bunları [Tutorial - User Guide](tutorial/index.md){.internal-link target=_blank} içinde çalışırken göreceksiniz.
Önemli olan, standart Python türlerini tek bir yerde kullanarak (daha fazla sınıf, dekoratör vb. eklemek yerine), **FastAPI**'nin bizim için işi yapmasını sağlamak. Önemli olan, standart Python tiplerini tek bir yerde kullanarak (daha fazla sınıf, decorator vb. eklemek yerine), **FastAPI**'nin sizin için işin büyük kısmını yapmasıdır.
/// info /// info | Bilgi
Tüm öğreticiyi zaten okuduysanız ve türler hakkında daha fazla bilgi için geri döndüyseniz, iyi bir kaynak:<a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" class="external-link" target="_blank"> the "cheat sheet" from `mypy`</a>. Tüm tutorial'ı zaten bitirdiyseniz ve tipler hakkında daha fazlasını görmek için geri döndüyseniz, iyi bir kaynak: <a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" class="external-link" target="_blank">`mypy`'nin "cheat sheet"i</a>.
/// ///

4
docs/tr/docs/resources/index.md

@ -1,3 +1,3 @@
# Kaynaklar # Kaynaklar { #resources }
Ek kaynaklar, dış bağlantılar, makaleler ve daha fazlası. ✈️ Ek kaynaklar, dış bağlantılar ve daha fazlası. ✈️

34
docs/tr/docs/tutorial/cookie-params.md

@ -1,35 +1,45 @@
# Çerez (Cookie) Parametreleri # Çerez (Cookie) Parametreleri { #cookie-parameters }
`Query` (Sorgu) ve `Path` (Yol) parametrelerini tanımladığınız şekilde çerez parametreleri tanımlayabilirsiniz. `Query` ve `Path` parametrelerini tanımladığınız şekilde Cookie parametreleri tanımlayabilirsiniz.
## Import `Cookie` ## `Cookie`'yi Import Edin { #import-cookie }
Öncelikle, `Cookie`'yi projenize dahil edin: Öncelikle, `Cookie`'yi import edin:
{* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *} {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *}
## `Cookie` Parametrelerini Tanımlayın ## `Cookie` Parametrelerini Tanımlayın { #declare-cookie-parameters }
Çerez parametrelerini `Path` veya `Query` tanımlaması yapar gibi tanımlayın. Ardından, `Path` ve `Query` ile aynı yapıyı kullanarak Cookie parametrelerini tanımlayın.
İlk değer varsayılan değerdir; tüm ekstra doğrulama veya belirteç parametrelerini kullanabilirsiniz: Varsayılan değeri ve tüm ekstra doğrulama veya annotation parametrelerini tanımlayabilirsiniz:
{* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[9] *} {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[9] *}
/// note | Teknik Detaylar /// note | Teknik Detaylar
`Cookie` sınıfı `Path` ve `Query` sınıflarının kardeşidir. Diğerleri gibi `Param` sınıfını miras alan bir sınıftır. `Cookie`, `Path` ve `Query`'nin "kardeş" sınıfıdır. O da aynı ortak `Param` sınıfından miras alır.
Ancak `fastapi`'dan projenize dahil ettiğiniz `Query`, `Path`, `Cookie` ve diğerleri aslında özel sınıflar döndüren birer fonksiyondur. Ancak `fastapi`'dan `Query`, `Path`, `Cookie` ve diğerlerini import ettiğinizde, bunlar aslında özel sınıflar döndüren fonksiyonlardır, bunu unutmayın.
/// ///
/// info | Bilgi /// info | Bilgi
Çerez tanımlamak için `Cookie` sınıfını kullanmanız gerekmektedir, aksi taktirde parametreler sorgu parametreleri olarak yorumlanır. Çerezleri tanımlamak için `Cookie` kullanmanız gerekir, aksi halde parametreler query parametreleri olarak yorumlanır.
/// ///
## Özet /// info | Bilgi
**Tarayıcılar çerezleri** özel şekillerde ve arka planda işlediği için, **JavaScript**'in onlara dokunmasına kolayca izin **vermezler**.
`/docs` adresindeki **API docs UI**'a giderseniz, *path operation*'larınız için çerezlerin **dokümantasyonunu** görebilirsiniz.
Ancak **veriyi doldurup** "Execute" düğmesine tıklasanız bile, docs UI **JavaScript** ile çalıştığı için çerezler gönderilmez ve herhangi bir değer yazmamışsınız gibi bir **hata** mesajı görürsünüz.
///
## Özet { #recap }
Çerez tanımlamalarını `Cookie` sınıfını kullanarak `Query` ve `Path` tanımlar gibi tanımlayın. `Query` ve `Path` ile aynı ortak deseni kullanarak, çerezleri `Cookie` ile tanımlayın.

311
docs/tr/docs/tutorial/first-steps.md

@ -1,102 +1,118 @@
# İlk Adımlar # İlk Adımlar { #first-steps }
En sade FastAPI dosyası şu şekilde görünür: En sade FastAPI dosyası şu şekilde görünür:
{* ../../docs_src/first_steps/tutorial001.py *} {* ../../docs_src/first_steps/tutorial001_py39.py *}
Yukarıdaki içeriği bir `main.py` dosyasına kopyalayalım. Yukarıdakini `main.py` adlı bir dosyaya kopyalayın.
Uygulamayı çalıştıralım: Canlı sunucuyu çalıştırın:
<div class="termy"> <div class="termy">
```console ```console
$ uvicorn main:app --reload $ <font color="#4E9A06">fastapi</font> dev <u style="text-decoration-style:solid">main.py</u>
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) <span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting development server 🚀
<span style="color: green;">INFO</span>: Started reloader process [28720]
<span style="color: green;">INFO</span>: Started server process [28722]
<span style="color: green;">INFO</span>: Waiting for application startup.
<span style="color: green;">INFO</span>: Application startup complete.
```
</div> Searching for package file structure from directories
with <font color="#3465A4">__init__.py</font> files
Importing from <font color="#75507B">/home/user/code/</font><font color="#AD7FA8">awesomeapp</font>
/// note | Not <span style="background-color:#007166"><font color="#D3D7CF"> module </font></span> 🐍 main.py
`uvicorn main:app` komutunu şu şekilde açıklayabiliriz: <span style="background-color:#007166"><font color="#D3D7CF"> code </font></span> Importing the FastAPI app object from the module with
the following code:
* `main`: dosya olan `main.py` (yani Python "modülü"). <u style="text-decoration-style:solid">from </u><u style="text-decoration-style:solid"><b>main</b></u><u style="text-decoration-style:solid"> import </u><u style="text-decoration-style:solid"><b>app</b></u>
* `app`: ise `main.py` dosyasının içerisinde `app = FastAPI()` satırında oluşturduğumuz `FastAPI` nesnesi.
* `--reload`: kod değişikliklerinin ardından sunucuyu otomatik olarak yeniden başlatır. Bu parameteyi sadece geliştirme aşamasında kullanmalıyız.
/// <span style="background-color:#007166"><font color="#D3D7CF"> app </font></span> Using import string: <font color="#3465A4">main:app</font>
<span style="background-color:#007166"><font color="#D3D7CF"> server </font></span> Server started at <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000</u></font>
<span style="background-color:#007166"><font color="#D3D7CF"> server </font></span> Documentation at <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000/docs</u></font>
<span style="background-color:#007166"><font color="#D3D7CF"> tip </font></span> Running in development mode, for production use:
<b>fastapi run</b>
Çıktı olarak şöyle bir satır ile karşılaşacaksınız: Logs:
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Will watch for changes in these directories:
<b>[</b><font color="#4E9A06">&apos;/home/user/code/awesomeapp&apos;</font><b>]</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Uvicorn running on <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000</u></font> <b>(</b>Press CTRL+C
to quit<b>)</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started reloader process <b>[</b><font color="#34E2E2"><b>383138</b></font><b>]</b> using WatchFiles
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>383153</b></font><b>]</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
```
</div>
Çıktıda, şuna benzer bir satır göreceksiniz:
```hl_lines="4" ```hl_lines="4"
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
``` ```
Bu satır, yerel makinenizde uygulamanızın çalıştığı bağlantıyı gösterir. Bu satır, uygulamanızın yerel makinenizde hangi URL'de sunulduğunu gösterir.
### Kontrol Edelim ### Kontrol Edelim { #check-it }
Tarayıcınızı açıp <a href="http://127.0.0.1:8000" class="external-link" target="_blank">http://127.0.0.1:8000</a> bağlantısına gidin. Tarayıcınızı açıp <a href="http://127.0.0.1:8000" class="external-link" target="_blank">http://127.0.0.1:8000</a> adresine gidin.
Şu şekilde bir JSON yanıtı ile karşılaşacağız: Şu şekilde bir JSON response göreceksiniz:
```JSON ```JSON
{"message": "Hello World"} {"message": "Hello World"}
``` ```
### Etkileşimli API Dokümantasyonu ### Etkileşimli API Dokümantasyonu { #interactive-api-docs }
Şimdi <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> bağlantısını açalım. Şimdi <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> adresine gidin.
<a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Swagger UI</a> tarafından sağlanan otomatik etkileşimli bir API dokümantasyonu göreceğiz: Otomatik etkileşimli API dokümantasyonunu ( <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Swagger UI</a> tarafından sağlanan) göreceksiniz:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png) ![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
### Alternatif API Dokümantasyonu ### Alternatif API Dokümantasyonu { #alternative-api-docs }
Şimdi <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> bağlantısını açalım. Ve şimdi <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> adresine gidin.
<a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a> tarafından sağlanan otomatik dokümantasyonu göreceğiz: Alternatif otomatik dokümantasyonu ( <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a> tarafından sağlanan) göreceksiniz:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png) ![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
### OpenAPI ### OpenAPI { #openapi }
**FastAPI**, **OpenAPI** standardını kullanarak tüm API'ınızın tamamını tanımlayan bir "şema" oluşturur. **FastAPI**, API'ları tanımlamak için **OpenAPI** standardını kullanarak tüm API'nızın tamamını içeren bir "şema" üretir.
#### "Şema" #### "Şema" { #schema }
"Şema", bir şeyin tanımı veya açıklamasıdır. Geliştirilen koddan ziyade soyut bir açıklamadır. "Şema", bir şeyin tanımı veya açıklamasıdır. Onu uygulayan kod değil, sadece soyut bir açıklamadır.
#### API "Şeması" #### API "şeması" { #api-schema }
Bu durumda, <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a>, API şemasını nasıl tanımlayacağınızı belirten bir şartnamedir. Bu durumda, <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a>, API'nızın şemasını nasıl tanımlayacağınızı belirleyen bir şartnamedir.
Bu şema tanımı, API yollarınızla birlikte yollarınızın aldığı olası parametreler gibi tanımlamaları içerir. Bu şema tanımı, API path'leriniz, alabilecekleri olası parametreler vb. şeyleri içerir.
#### Veri "Şeması" #### Veri "şeması" { #data-schema }
"Şema" terimi, JSON içeriği gibi bazı verilerin şeklini de ifade edebilir. "Şema" terimi, JSON içeriği gibi bazı verilerin şeklini de ifade edebilir.
Bu durumda, JSON özellikleri ve sahip oldukları veri türleri gibi anlamlarına gelir. Bu durumda, JSON attribute'ları ve sahip oldukları veri türleri vb. anlamına gelir.
#### OpenAPI ve JSON Şema #### OpenAPI ve JSON Schema { #openapi-and-json-schema }
OpenAPI, API'niz için bir API şeması tanımlar. Ve bu şema, JSON veri şemaları standardı olan **JSON Şema** kullanılarak API'niz tarafından gönderilen ve alınan verilerin tanımlarını (veya "şemalarını") içerir. OpenAPI, API'nız için bir API şeması tanımlar. Ve bu şema, JSON veri şemaları standardı olan **JSON Schema** kullanılarak API'nız tarafından gönderilen ve alınan verilerin tanımlarını (veya "şemalarını") içerir.
#### `openapi.json` Dosyasına Göz At #### `openapi.json` Dosyasına Göz At { #check-the-openapi-json }
Ham OpenAPI şemasının nasıl göründüğünü merak ediyorsanız, FastAPI otomatik olarak tüm API'ınızın tanımlamalarını içeren bir JSON (şeması) oluşturur. Ham OpenAPI şemasının nasıl göründüğünü merak ediyorsanız, FastAPI otomatik olarak tüm API'nızın açıklamalarını içeren bir JSON (şema) üretir.
Bu şemayı direkt olarak <a href="http://127.0.0.1:8000/openapi.json" class="external-link" target="_blank">http://127.0.0.1:8000/openapi.json</a> bağlantısından görüntüleyebilirsiniz. Bunu doğrudan şuradan görebilirsiniz: <a href="http://127.0.0.1:8000/openapi.json" class="external-link" target="_blank">http://127.0.0.1:8000/openapi.json</a>.
Aşağıdaki gibi başlayan bir JSON ile karşılaşacaksınız: Şuna benzer bir şekilde başlayan bir JSON gösterecektir:
```JSON ```JSON
{ {
@ -119,79 +135,87 @@ Aşağıdaki gibi başlayan bir JSON ile karşılaşacaksınız:
... ...
``` ```
#### OpenAPI Ne İşe Yarar? #### OpenAPI Ne İşe Yarar? { #what-is-openapi-for }
OpenAPI şeması, FastAPI projesinde bulunan iki etkileşimli dokümantasyon sistemine güç veren şeydir.
OpenAPI'ya dayalı düzinelerce alternatif etkileşimli dokümantasyon aracı mevcuttur. **FastAPI** ile oluşturulmuş uygulamanıza bu alternatiflerden herhangi birini kolayca ekleyebilirsiniz. OpenAPI şeması, dahil edilen iki etkileşimli dokümantasyon sistemine güç veren şeydir.
Ayrıca, API'ınızla iletişim kuracak önyüz, mobil veya IoT uygulamaları gibi istemciler için otomatik olarak kod oluşturabilirsiniz. Ve OpenAPI tabanlı düzinelerce alternatif vardır. **FastAPI** ile oluşturulmuş uygulamanıza bu alternatiflerden herhangi birini kolayca ekleyebilirsiniz.
## Adım Adım Özetleyelim Ayrıca, API'nızla iletişim kuran istemciler için otomatik olarak kod üretmekte de kullanabilirsiniz. Örneğin frontend, mobil veya IoT uygulamaları.
### Adım 1: `FastAPI`yı Projemize Dahil Edelim ### Uygulamanızı Yayınlayın (opsiyonel) { #deploy-your-app-optional }
{* ../../docs_src/first_steps/tutorial001.py hl[1] *} İsterseniz FastAPI uygulamanızı <a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>'a deploy edebilirsiniz; henüz katılmadıysanız gidip bekleme listesine yazılın. 🚀
`FastAPI`, API'niz için tüm işlevselliği sağlayan bir Python sınıfıdır. Zaten bir **FastAPI Cloud** hesabınız varsa (bekleme listesinden sizi davet ettiysek 😉), uygulamanızı tek komutla deploy edebilirsiniz.
/// note | Teknik Detaylar Deploy etmeden önce giriş yaptığınızdan emin olun:
`FastAPI` doğrudan `Starlette`'i miras alan bir sınıftır.
<a href="https://www.starlette.dev/" class="external-link" target="_blank">Starlette</a>'in tüm işlevselliğini `FastAPI` ile de kullanabilirsiniz.
///
### Adım 2: Bir `FastAPI` "Örneği" Oluşturalım <div class="termy">
{* ../../docs_src/first_steps/tutorial001.py hl[3] *} ```console
$ fastapi login
Burada `app` değişkeni `FastAPI` sınıfının bir örneği olacaktır. You are logged in to FastAPI Cloud 🚀
```
Bu, tüm API'yı oluşturmak için ana etkileşim noktası olacaktır. </div>
Bu `app` değişkeni, `uvicorn` komutunda atıfta bulunulan değişkenin ta kendisidir. Ardından uygulamanızı deploy edin:
<div class="termy"> <div class="termy">
```console ```console
$ uvicorn main:app --reload $ fastapi deploy
Deploying to FastAPI Cloud...
✅ Deployment successful!
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) 🐔 Ready the chicken! Your app is ready at https://myapp.fastapicloud.dev
``` ```
</div> </div>
Uygulamanızı aşağıdaki gibi oluşturursanız: Bu kadar! Artık uygulamanıza o URL üzerinden erişebilirsiniz. ✨
{* ../../docs_src/first_steps/tutorial002.py hl[3] *} ## Adım Adım Özetleyelim { #recap-step-by-step }
Ve bunu `main.py` dosyasına yerleştirirseniz eğer `uvicorn` komutunu şu şekilde çalıştırabilirsiniz: ### Adım 1: `FastAPI` import edin { #step-1-import-fastapi }
<div class="termy"> {* ../../docs_src/first_steps/tutorial001_py39.py hl[1] *}
```console `FastAPI`, API'nız için tüm işlevselliği sağlayan bir Python class'ıdır.
$ uvicorn main:my_awesome_api --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) /// note | Teknik Detaylar
```
</div> `FastAPI`, doğrudan `Starlette`'ten miras alan bir class'tır.
<a href="https://www.starlette.dev/" class="external-link" target="_blank">Starlette</a>'in tüm işlevselliğini `FastAPI` ile de kullanabilirsiniz.
///
### Adım 2: bir `FastAPI` "instance"ı oluşturun { #step-2-create-a-fastapi-instance }
{* ../../docs_src/first_steps/tutorial001_py39.py hl[3] *}
Burada `app` değişkeni `FastAPI` class'ının bir "instance"ı olacaktır.
### Adım 3: Bir *Yol Operasyonu* Oluşturalım Bu, tüm API'nızı oluşturmak için ana etkileşim noktası olacaktır.
#### <abbr title="Yol: Path">Yol</abbr> ### Adım 3: bir *path operation* oluşturun { #step-3-create-a-path-operation }
Burada "yol" bağlantıda bulunan ilk `/` ile başlayan ve sonrasında gelen kısmı ifade eder. #### Path { #path }
Yani, şu şekilde bir bağlantıda: Buradaki "Path", URL'in ilk `/` işaretinden başlayarak son kısmını ifade eder.
Yani, şu şekilde bir URL'de:
``` ```
https://example.com/items/foo https://example.com/items/foo
``` ```
... yol şöyle olur: ...path şöyle olur:
``` ```
/items/foo /items/foo
@ -199,77 +223,77 @@ https://example.com/items/foo
/// info | Bilgi /// info | Bilgi
"Yol" genellikle "<abbr title="Endpoint: Bitim Noktası">endpoint</abbr>" veya "<abbr title="Route: Yönlendirme/Yön">route</abbr>" olarak adlandırılır. Bir "path" genellikle "endpoint" veya "route" olarak da adlandırılır.
/// ///
Bir API oluştururken, "yol", "kaynaklar" ile "endişeleri" ayırmanın ana yöntemidir. Bir API oluştururken, "path", "concerns" ve "resources" ayrımını yapmanın ana yoludur.
#### Operasyonlar #### Operation { #operation }
Burada "operasyon" HTTP "metodlarından" birini ifade eder. Burada "Operation", HTTP "method"larından birini ifade eder.
Bunlardan biri: Şunlardan biri:
* `POST` * `POST`
* `GET` * `GET`
* `PUT` * `PUT`
* `DELETE` * `DELETE`
...veya daha az kullanılan diğerleri: ...ve daha egzotik olanlar:
* `OPTIONS` * `OPTIONS`
* `HEAD` * `HEAD`
* `PATCH` * `PATCH`
* `TRACE` * `TRACE`
HTTP protokolünde, bu "metodlardan" birini (veya daha fazlasını) kullanarak her bir yol ile iletişim kurabilirsiniz. HTTP protokolünde, her bir path ile bu "method"lardan biri (veya birden fazlası) ile iletişim kurabilirsiniz.
--- ---
API oluştururkan, belirli bir amaca hizmet eden belirli HTTP metodlarını kullanırsınız. API oluştururken, normalde belirli bir aksiyon için bu spesifik HTTP method'larını kullanırsınız.
Normalde kullanılan: Normalde şunları kullanırsınız:
* `POST`: veri oluşturmak. * `POST`: veri oluşturmak için.
* `GET`: veri okumak. * `GET`: veri okumak için.
* `PUT`: veriyi güncellemek. * `PUT`: veriyi güncellemek için.
* `DELETE`: veriyi silmek. * `DELETE`: veriyi silmek için.
Bu nedenle, OpenAPI'da HTTP metodlarından her birine "operasyon" denir. Bu nedenle, OpenAPI'da HTTP method'larının her birine "operation" denir.
Biz de onları "**operasyonlar**" olarak adlandıracağız. Biz de bunlara "**operation**" diyeceğiz.
#### Bir *Yol Operasyonu Dekoratörü* Tanımlayalım #### Bir *path operation decorator* tanımlayın { #define-a-path-operation-decorator }
{* ../../docs_src/first_steps/tutorial001.py hl[6] *} {* ../../docs_src/first_steps/tutorial001_py39.py hl[6] *}
`@app.get("/")` dekoratörü, **FastAPI**'a hemen altındaki fonksiyonun aşağıdaki durumlardan sorumlu olduğunu söyler: `@app.get("/")`, **FastAPI**'a hemen altındaki fonksiyonun şuraya giden request'leri ele almakla sorumlu olduğunu söyler:
* <abbr title="Bir HTTP GET metodu"><code>get</code> operasyonu</abbr> ile * path `/`
* `/` yoluna gelen istekler * <abbr title="bir HTTP GET method'u"><code>get</code> operation</abbr> kullanarak
/// info | `@decorator` Bilgisi /// info | `@decorator` Bilgisi
Python'da `@something` sözdizimi "<abbr title="Decorator">dekoratör</abbr>" olarak adlandırılır. Python'daki `@something` söz dizimi "decorator" olarak adlandırılır.
Dekoratörler, dekoratif bir şapka gibi (sanırım terim buradan geliyor) fonksiyonların üzerlerine yerleştirilirler. Onu bir fonksiyonun üstüne koyarsınız. Güzel, dekoratif bir şapka gibi (sanırım terim de buradan geliyor).
Bir "dekoratör" hemen altında bulunan fonksiyonu alır ve o fonksiyon ile bazı işlemler gerçekleştirir. Bir "decorator", altındaki fonksiyonu alır ve onunla bir şey yapar.
Bizim durumumuzda, kullandığımız dekoratör, **FastAPI**'a altındaki fonksiyonun `/` yoluna gelen `get` metodlu isteklerden sorumlu olduğunu söyler. Bizim durumumuzda bu decorator, **FastAPI**'a altındaki fonksiyonun **path** `/` ile **operation** `get`'e karşılık geldiğini söyler.
Bu bir **yol operasyonu dekoratörüdür**. Bu, "**path operation decorator**"dır.
/// ///
Ayrıca diğer operasyonları da kullanabilirsiniz: Diğer operation'ları da kullanabilirsiniz:
* `@app.post()` * `@app.post()`
* `@app.put()` * `@app.put()`
* `@app.delete()` * `@app.delete()`
Daha az kullanılanları da kullanabilirsiniz: Ve daha egzotik olanları:
* `@app.options()` * `@app.options()`
* `@app.head()` * `@app.head()`
@ -278,58 +302,79 @@ Daha az kullanılanları da kullanabilirsiniz:
/// tip | İpucu /// tip | İpucu
Her işlemi (HTTP metod) istediğiniz gibi kullanmakta özgürsünüz. Her bir operation'ı (HTTP method'unu) istediğiniz gibi kullanmakta özgürsünüz.
**FastAPI** herhangi bir özel amacı veya anlamı olması konusunda ısrarcı olmaz. **FastAPI** herhangi bir özel anlamı zorunlu kılmaz.
Buradaki bilgiler bir gereklilik değil, bir kılavuz olarak sunulmaktadır. Buradaki bilgiler bir gereklilik değil, bir kılavuz olarak sunulmaktadır.
Mesela GraphQL kullanırkan genelde tüm işlemleri yalnızca `POST` operasyonunu kullanarak gerçekleştirirsiniz. Örneğin GraphQL kullanırken, normalde tüm aksiyonları yalnızca `POST` operation'ları kullanarak gerçekleştirirsiniz.
/// ///
### Adım 4: **Yol Operasyonu Fonksiyonunu** Tanımlayın ### Adım 4: **path operation function**'ı tanımlayın { #step-4-define-the-path-operation-function }
Aşağıdaki, bizim **yol operasyonu fonksiyonumuzdur**: Bu bizim "**path operation function**"ımız:
* **yol**: `/` * **path**: `/`.
* **operasyon**: `get` * **operation**: `get`.
* **fonksiyon**: "dekoratör"ün (`@app.get("/")`'in) altındaki fonksiyondur. * **function**: "decorator"ün altındaki fonksiyondur (`@app.get("/")`'in altındaki).
{* ../../docs_src/first_steps/tutorial001.py hl[7] *} {* ../../docs_src/first_steps/tutorial001_py39.py hl[7] *}
Bu bir Python fonksiyonudur. Bu bir Python fonksiyonudur.
Bu fonksiyon bir `GET` işlemi kullanılarak "`/`" bağlantısına bir istek geldiğinde **FastAPI** tarafından çağrılır. **FastAPI**, "`/`" URL'ine `GET` operation kullanarak bir request aldığında bu fonksiyonu çağıracaktır.
Bu durumda bu fonksiyon bir `async` fonksiyondur. Bu durumda, bu bir `async` fonksiyondur.
--- ---
Bu fonksiyonu `async def` yerine normal bir fonksiyon olarak da tanımlayabilirsiniz. Bunu `async def` yerine normal bir fonksiyon olarak da tanımlayabilirsiniz:
{* ../../docs_src/first_steps/tutorial003.py hl[7] *} {* ../../docs_src/first_steps/tutorial003_py39.py hl[7] *}
/// note | Not /// note | Not
Eğer farkı bilmiyorsanız, [Async: *"Aceleniz mi var?"*](../async.md#in-a-hurry){.internal-link target=_blank} sayfasını kontrol edebilirsiniz. Eğer farkı bilmiyorsanız, [Async: *"Aceleniz mi var?"*](../async.md#in-a-hurry){.internal-link target=_blank} sayfasına bakın.
/// ///
### Adım 5: İçeriği Geri Döndürün ### Adım 5: içeriği döndürün { #step-5-return-the-content }
{* ../../docs_src/first_steps/tutorial001_py39.py hl[8] *}
Bir `dict`, `list`, `str`, `int` vb. tekil değerler döndürebilirsiniz.
Ayrıca Pydantic modelleri de döndürebilirsiniz (bununla ilgili daha fazlasını ileride göreceksiniz).
Otomatik olarak JSON'a dönüştürülecek (ORM'ler vb. dahil) başka birçok nesne ve model vardır. En sevdiğiniz nesne/model'leri kullanmayı deneyin; büyük ihtimalle zaten destekleniyordur.
### Adım 6: Deploy edin { #step-6-deploy-it }
Uygulamanızı tek komutla **<a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>**'a deploy edin: `fastapi deploy`. 🎉
#### FastAPI Cloud Hakkında { #about-fastapi-cloud }
**<a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>**, **FastAPI**'ın arkasındaki aynı yazar ve ekip tarafından geliştirilmiştir.
Minimum eforla bir API'ı **oluşturma**, **deploy etme** ve **erişme** sürecini sadeleştirir.
FastAPI ile uygulama geliştirirken yaşadığınız aynı **developer experience**'ı, onları buluta **deploy etme** aşamasına da taşır. 🎉
{* ../../docs_src/first_steps/tutorial001.py hl[8] *} FastAPI Cloud, *FastAPI and friends* açık kaynak projelerinin birincil sponsoru ve finansman sağlayıcısıdır. ✨
Bir `dict`, `list` veya `str`, `int` gibi tekil değerler döndürebilirsiniz. #### Diğer cloud sağlayıcılarına deploy edin { #deploy-to-other-cloud-providers }
Ayrıca, Pydantic modelleri de döndürebilirsiniz (bu konu ileriki aşamalarda irdelenecektir). FastAPI açık kaynaklıdır ve standartlara dayanır. FastAPI uygulamalarını seçtiğiniz herhangi bir cloud sağlayıcısına deploy edebilirsiniz.
Otomatik olarak JSON'a dönüştürülecek (ORM'ler vb. dahil) başka birçok nesne ve model vardır. En beğendiklerinizi kullanmayı deneyin, yüksek ihtimalle destekleniyordur. FastAPI uygulamalarını onlarla deploy etmek için cloud sağlayıcınızın kılavuzlarını takip edin. 🤓
## Özet ## Özet { #recap }
* `FastAPI`'yı projemize dahil ettik. * `FastAPI` import edin.
* Bir `app` örneği oluşturduk. * Bir `app` instance'ı oluşturun.
* Bir **yol operasyonu dekoratörü** (`@app.get("/")` gibi) yazdık. * `@app.get("/")` gibi decorator'ları kullanarak bir **path operation decorator** yazın.
* Bir **yol operasyonu fonksiyonu** (`def root(): ...` gibi) yazdık. * Bir **path operation function** tanımlayın; örneğin `def root(): ...`.
* Geliştirme sunucumuzu (`uvicorn main:app --reload` gibi) çalıştırdık. * `fastapi dev` komutunu kullanarak geliştirme sunucusunu çalıştırın.
* İsterseniz `fastapi deploy` ile uygulamanızı deploy edin.

190
docs/tr/docs/tutorial/path-params.md

@ -1,34 +1,34 @@
# Yol Parametreleri # Yol Parametreleri { #path-parameters }
Yol "parametrelerini" veya "değişkenlerini" Python <abbr title="String Biçimleme: Format String">string biçimlemede</abbr> kullanılan sözdizimi ile tanımlayabilirsiniz. Python <abbr title="String Biçimleme: Format String">string biçimlemede</abbr> kullanılan sözdizimiyle path "parametreleri"ni veya "değişkenleri"ni tanımlayabilirsiniz:
{* ../../docs_src/path_params/tutorial001.py hl[6:7] *} {* ../../docs_src/path_params/tutorial001_py39.py hl[6:7] *}
Yol parametresi olan `item_id`'nin değeri, fonksiyonunuza `item_id` argümanı olarak aktarılacaktır. Path parametresi `item_id`'nin değeri, fonksiyonunuza `item_id` argümanı olarak aktarılacaktır.
Eğer bu örneği çalıştırıp <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a> sayfasına giderseniz, şöyle bir çıktı ile karşılaşırsınız: Yani, bu örneği çalıştırıp <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a> adresine giderseniz, şöyle bir response görürsünüz:
```JSON ```JSON
{"item_id":"foo"} {"item_id":"foo"}
``` ```
## Tip İçeren Yol Parametreleri ## Tip İçeren Yol Parametreleri { #path-parameters-with-types }
Standart Python tip belirteçlerini kullanarak yol parametresinin tipini fonksiyonun içerisinde tanımlayabilirsiniz. Standart Python tip belirteçlerini kullanarak path parametresinin tipini fonksiyonun içinde tanımlayabilirsiniz:
{* ../../docs_src/path_params/tutorial002.py hl[7] *} {* ../../docs_src/path_params/tutorial002_py39.py hl[7] *}
Bu durumda, `item_id` bir `int` olarak tanımlanacaktır. Bu durumda, `item_id` bir `int` olarak tanımlanır.
/// check | Ek bilgi /// check | Ek bilgi
Bu sayede, fonksiyon içerisinde hata denetimi, kod tamamlama gibi konularda editör desteğine kavuşacaksınız. Bu sayede, fonksiyon içinde hata denetimi, kod tamamlama vb. konularda editör desteğine kavuşursunuz.
/// ///
## Veri <abbr title="Dönüşüm: serialization, parsing ve marshalling olarak da biliniyor">Dönüşümü</abbr> ## Veri <abbr title="also known as: endpoints, routes">conversion</abbr> { #data-conversion }
Eğer bu örneği çalıştırıp tarayıcınızda <a href="http://127.0.0.1:8000/items/3" class="external-link" target="_blank">http://127.0.0.1:8000/items/3</a> sayfasını açarsanız, şöyle bir yanıt ile karşılaşırsınız: Bu örneği çalıştırıp tarayıcınızda <a href="http://127.0.0.1:8000/items/3" class="external-link" target="_blank">http://127.0.0.1:8000/items/3</a> adresini açarsanız, şöyle bir response görürsünüz:
```JSON ```JSON
{"item_id":3} {"item_id":3}
@ -36,15 +36,15 @@ Eğer bu örneği çalıştırıp tarayıcınızda <a href="http://127.0.0.1:800
/// check | Ek bilgi /// check | Ek bilgi
Dikkatinizi çekerim ki, fonksiyonunuzun aldığı (ve döndürdüğü) değer olan `3` bir string `"3"` değil aksine bir Python `int`'idir. Dikkat edin: fonksiyonunuzun aldığı (ve döndürdüğü) değer olan `3`, string `"3"` değil, bir Python `int`'idir.
Bu tanımlamayla birlikte, **FastAPI** size otomatik istek <abbr title="HTTP isteği ile birlikte gelen string'i Python verisine dönüştürme">"ayrıştırma"</abbr> özelliği sağlar. Yani, bu tip tanımıyla birlikte **FastAPI** size otomatik request <abbr title="HTTP isteği ile birlikte gelen string'i Python verisine dönüştürme">"parsing"</abbr> sağlar.
/// ///
## Veri Doğrulama ## Veri Doğrulama { #data-validation }
Eğer tarayıcınızda <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a> sayfasını açarsanız, şuna benzer güzel bir HTTP hatası ile karşılaşırsınız: Ancak tarayıcınızda <a href="http://127.0.0.1:8000/items/foo" class="external-link" target="_blank">http://127.0.0.1:8000/items/foo</a> adresine giderseniz, şuna benzer güzel bir HTTP hatası görürsünüz:
```JSON ```JSON
{ {
@ -62,141 +62,135 @@ Eğer tarayıcınızda <a href="http://127.0.0.1:8000/items/foo" class="external
} }
``` ```
Çünkü burada `item_id` yol parametresi `int` tipinde bir değer beklerken `"foo"` yani `string` tipinde bir değer almıştı. çünkü path parametresi `item_id`, `int` olmayan `"foo"` değerine sahipti.
Aynı hata <a href="http://127.0.0.1:8000/items/4.2" class="external-link" target="_blank">http://127.0.0.1:8000/items/4.2</a> sayfasında olduğu gibi `int` yerine `float` bir değer verseydik de ortaya çıkardı. Aynı hata, şu örnekte olduğu gibi `int` yerine `float` verirseniz de ortaya çıkar: <a href="http://127.0.0.1:8000/items/4.2" class="external-link" target="_blank">http://127.0.0.1:8000/items/4.2</a>
/// check | Ek bilgi /// check | Ek bilgi
Böylece, aynı Python tip tanımlaması ile birlikte, **FastAPI** veri doğrulama özelliği sağlar. Yani, aynı Python tip tanımıyla birlikte **FastAPI** size veri doğrulama sağlar.
Dikkatinizi çekerim ki, karşılaştığınız hata, doğrulamanın geçersiz olduğu mutlak noktayı da açık bir şekilde belirtiyor. Dikkat edin: hata ayrıca doğrulamanın geçmediği noktayı da açıkça belirtir.
Bu özellik, API'ınızla iletişime geçen kodu geliştirirken ve ayıklarken inanılmaz derecede yararlı olacaktır. Bu, API'ınızla etkileşime giren kodu geliştirirken ve debug ederken inanılmaz derecede faydalıdır.
/// ///
## Dokümantasyon ## Dokümantasyon { #documentation }
Ayrıca, tarayıcınızı <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> adresinde açarsanız, aşağıdaki gibi otomatik ve interaktif bir API dökümantasyonu ile karşılaşırsınız: Tarayıcınızı <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> adresinde açtığınızda, aşağıdaki gibi otomatik ve interaktif bir API dokümantasyonu görürsünüz:
<img src="/img/tutorial/path-params/image01.png"> <img src="/img/tutorial/path-params/image01.png">
/// check | Ek bilgi /// check | Ek bilgi
Üstelik, sadece aynı Python tip tanımlaması ile, **FastAPI** size otomatik ve interaktif (Swagger UI ile entegre) bir dokümantasyon sağlar. Yine, sadece aynı Python tip tanımıyla **FastAPI** size otomatik ve interaktif dokümantasyon (Swagger UI entegrasyonuyla) sağlar.
Dikkatinizi çekerim ki, yol parametresi integer olarak tanımlanmıştır. Dikkat edin: path parametresi integer olarak tanımlanmıştır.
/// ///
## Standartlara Dayalı Avantajlar, Alternatif Dokümantasyon ## Standartlara Dayalı Avantajlar, Alternatif Dokümantasyon { #standards-based-benefits-alternative-documentation }
Oluşturulan şema <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md" class="external-link" target="_blank">OpenAPI</a> standardına uygun olduğu için birçok uyumlu araç mevcuttur. Üretilen şema <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md" class="external-link" target="_blank">OpenAPI</a> standardından geldiği için birçok uyumlu araç vardır.
Bu sayede, **FastAPI**'ın bizzat kendisi <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> sayfasından erişebileceğiniz alternatif (ReDoc kullanan) bir API dokümantasyonu sağlar: Bu nedenle **FastAPI**'ın kendisi, <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> adresinden erişebileceğiniz alternatif bir API dokümantasyonu (ReDoc kullanarak) sağlar:
<img src="/img/tutorial/path-params/image02.png"> <img src="/img/tutorial/path-params/image02.png">
Aynı şekilde, farklı diller için kod türetme araçları da dahil olmak üzere çok sayıda uyumlu araç bulunur. Aynı şekilde, birçok uyumlu araç vardır. Birçok dil için kod üretme araçları da buna dahildir.
## Pydantic ## Pydantic { #pydantic }
Tüm veri doğrulamaları <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a> tarafından arka planda gerçekleştirilir, bu sayede tüm avantajlardan faydalanabilirsiniz. Böylece, emin ellerde olduğunuzu hissedebilirsiniz. Tüm veri doğrulamaları, arka planda <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a> tarafından gerçekleştirilir; böylece onun tüm avantajlarından faydalanırsınız. Ve emin ellerde olduğunuzu bilirsiniz.
Aynı tip tanımlamalarını `str`, `float`, `bool` ve diğer karmaşık veri tipleri ile kullanma imkanınız vardır. Aynı tip tanımlarını `str`, `float`, `bool` ve daha birçok karmaşık veri tipiyle kullanabilirsiniz.
Bunlardan birkaçı, bu eğitimin ileriki bölümlerinde irdelenmiştir. Bunların birkaçı, eğitimin sonraki bölümlerinde ele alınacaktır.
## Sıralama Önem Arz Eder ## Sıralama Önemlidir { #order-matters }
*Yol operasyonları* tasarlarken sabit yol barındıran durumlar ile karşılaşabilirsiniz. *Path operation*'lar oluştururken sabit bir path'e sahip olduğunuz durumlarla karşılaşabilirsiniz.
Farz edelim ki `/users/me` yolu geçerli kullanıcı hakkında bilgi almak için kullanılıyor olsun. Örneğin `/users/me`'nin, geçerli kullanıcı hakkında veri almak için kullanıldığını varsayalım.
Benzer şekilde `/users/{user_id}` gibi tanımlanmış ve belirli bir kullanıcı hakkında veri almak için kullanıcının ID bilgisini kullanan bir yolunuz da mevcut olabilir. Sonra belirli bir kullanıcı hakkında, kullanıcı ID'si ile veri almak için `/users/{user_id}` şeklinde bir path'iniz de olabilir.
*Yol operasyonları* sıralı bir şekilde gözden geçirildiğinden dolayı `/users/me` yolunun `/users/{user_id}` yolundan önce tanımlanmış olmasından emin olmanız gerekmektedir: *Path operation*'lar sırayla değerlendirildiği için, `/users/me` için olan path'in `/users/{user_id}` olandan önce tanımlandığından emin olmanız gerekir:
{* ../../docs_src/path_params/tutorial003.py hl[6,11] *} {* ../../docs_src/path_params/tutorial003_py39.py hl[6,11] *}
Aksi halde, `/users/{user_id}` yolu `"me"` değerinin `user_id` parametresi için gönderildiğini "düşünerek" `/users/me` ile de eşleşir. Aksi halde, `/users/{user_id}` için olan path, `"me"` değerini `user_id` parametresi olarak aldığını "düşünerek" `/users/me` için de eşleşir.
Benzer şekilde, bir yol operasyonunu yeniden tanımlamanız mümkün değildir: Benzer şekilde, bir path operation'ı yeniden tanımlayamazsınız:
{* ../../docs_src/path_params/tutorial003b.py hl[6,11] *} {* ../../docs_src/path_params/tutorial003b_py39.py hl[6,11] *}
Yol, ilk kısım ile eşleştiğinden dolayı her koşulda ilk yol operasyonu kullanılacaktır. Path önce eşleştiği için her zaman ilk olan kullanılır.
## Ön Tanımlı Değerler ## Ön Tanımlı Değerler { #predefined-values }
Eğer *yol parametresi* alan bir *yol operasyonunuz* varsa ve alabileceği *yol parametresi* değerlerinin ön tanımlı olmasını istiyorsanız, standart Python <abbr title="Enumeration">`Enum`</abbr> tipini kullanabilirsiniz. Bir *path operation*'ınız *path parameter* alıyorsa ama olası geçerli *path parameter* değerlerinin önceden tanımlı olmasını istiyorsanız, standart bir Python <abbr title="Enumeration">`Enum`</abbr> kullanabilirsiniz.
### Bir `Enum` Sınıfı Oluşturalım ### Bir `Enum` Sınıfı Oluşturalım { #create-an-enum-class }
`Enum` sınıfını projemize dahil edip `str` ile `Enum` sınıflarını miras alan bir alt sınıf yaratalım. `Enum`'u import edin ve `str` ile `Enum`'dan miras alan bir alt sınıf oluşturun.
`str` sınıfı miras alındığından dolayı, API dokümanı, değerlerin `string` tipinde olması gerektiğini anlayabilecek ve doğru bir şekilde işlenecektir. `str`'den miras aldığınızda API dokümanları değerlerin `string` tipinde olması gerektiğini anlayabilir ve doğru şekilde render edebilir.
Sonrasında, sınıf içerisinde, mevcut ve geçerli değerler olacak olan sabit değerli özelliklerini oluşturalım: Sonra, kullanılabilir geçerli değerler olacak sabit değerli class attribute'ları oluşturun:
{* ../../docs_src/path_params/tutorial005.py hl[1,6:9] *} {* ../../docs_src/path_params/tutorial005_py39.py hl[1,6:9] *}
/// info | Bilgi
3.4 sürümünden beri <a href="https://docs.python.org/3/library/enum.html" class="external-link" target="_blank">enumerationlar (ya da enumlar) Python'da mevcuttur</a>.
///
/// tip | İpucu /// tip | İpucu
Merak ediyorsanız söyleyeyim, "AlexNet", "ResNet" ve "LeNet" isimleri Makine Öğrenmesi <abbr title="Teknik olarak, Derin Öğrenme model mimarileri">modellerini</abbr> temsil eder. Merak ediyorsanız: "AlexNet", "ResNet" ve "LeNet", Makine Öğrenmesi <abbr title="Technically, Deep Learning model architectures">modelleri</abbr>nin sadece isimleridir.
/// ///
### Bir *Yol Parametresi* Tanımlayalım ### Bir *Path Parameter* Tanımlayalım { #declare-a-path-parameter }
Sonrasında, yarattığımız enum sınıfını (`ModelName`) kullanarak tip belirteci aracılığıyla bir *yol parametresi* oluşturalım: Ardından oluşturduğunuz enum sınıfını (`ModelName`) kullanarak tip belirteciyle bir *path parameter* oluşturun:
{* ../../docs_src/path_params/tutorial005.py hl[16] *} {* ../../docs_src/path_params/tutorial005_py39.py hl[16] *}
### Dokümana Göz Atalım ### Dokümana Göz Atalım { #check-the-docs }
*Yol parametresi* için mevcut değerler ön tanımlı olduğundan dolayı, interaktif döküman onları güzel bir şekilde gösterebilir: *Path parameter* için kullanılabilir değerler ön tanımlı olduğu için, interaktif dokümanlar bunları güzelce gösterebilir:
<img src="/img/tutorial/path-params/image03.png"> <img src="/img/tutorial/path-params/image03.png">
### Python *Enumerationları* ile Çalışmak ### Python *Enumeration*'ları ile Çalışmak { #working-with-python-enumerations }
*Yol parametresinin* değeri bir *enumeration üyesi* olacaktır. *Path parameter*'ın değeri bir *enumeration member* olacaktır.
#### *Enumeration Üyelerini* Karşılaştıralım #### *Enumeration Member*'ları Karşılaştıralım { #compare-enumeration-members }
Parametreyi, yarattığınız enum olan `ModelName` içerisindeki *enumeration üyesi* ile karşılaştırabilirsiniz: Bunu, oluşturduğunuz enum `ModelName` içindeki *enumeration member* ile karşılaştırabilirsiniz:
{* ../../docs_src/path_params/tutorial005.py hl[17] *} {* ../../docs_src/path_params/tutorial005_py39.py hl[17] *}
#### *Enumeration Değerini* Edinelim #### *Enumeration Value*'yu Alalım { #get-the-enumeration-value }
`model_name.value` veya genel olarak `your_enum_member.value` tanımlarını kullanarak (bu durumda bir `str` olan) gerçek değere ulaşabilirsiniz: Gerçek değeri (bu durumda bir `str`) `model_name.value` ile veya genel olarak `your_enum_member.value` ile alabilirsiniz:
{* ../../docs_src/path_params/tutorial005.py hl[20] *} {* ../../docs_src/path_params/tutorial005_py39.py hl[20] *}
/// tip | İpucu /// tip | İpucu
`"lenet"` değerine `ModelName.lenet.value` tanımı ile de ulaşabilirsiniz. `"lenet"` değerine `ModelName.lenet.value` ile de erişebilirsiniz.
/// ///
#### *Enumeration Üyelerini* Döndürelim #### *Enumeration Member*'ları Döndürelim { #return-enumeration-members }
JSON gövdesine (örneğin bir `dict`) gömülü olsalar bile *yol operasyonundaki* *enum üyelerini* döndürebilirsiniz. *Path operation*'ınızdan, bir JSON body'nin içine gömülü olsalar bile (ör. bir `dict`) *enum member*'ları döndürebilirsiniz.
Bu üyeler istemciye iletilmeden önce kendilerine karşılık gelen değerlerine (bu durumda string) dönüştürüleceklerdir: İstemciye dönmeden önce, karşılık gelen değerlerine (bu durumda string) dönüştürülürler:
{* ../../docs_src/path_params/tutorial005.py hl[18,21,23] *} {* ../../docs_src/path_params/tutorial005_py39.py hl[18,21,23] *}
İstemci tarafında şuna benzer bir JSON yanıtı ile karşılaşırsınız: İstemcinizde şöyle bir JSON response alırsınız:
```JSON ```JSON
{ {
@ -205,53 +199,53 @@ Bu üyeler istemciye iletilmeden önce kendilerine karşılık gelen değerlerin
} }
``` ```
## Yol İçeren Yol Parametreleri ## Path İçeren Path Parametreleri { #path-parameters-containing-paths }
Farz edelim ki elinizde `/files/{file_path}` isminde bir *yol operasyonu* var. Diyelim ki `/files/{file_path}` path'ine sahip bir *path operation*'ınız var.
Fakat `file_path` değerinin `home/johndoe/myfile.txt` gibi bir *yol* barındırmasını istiyorsunuz. Ama `file_path`'in kendisinin `home/johndoe/myfile.txt` gibi bir *path* içermesi gerekiyor.
Sonuç olarak, oluşturmak istediğin URL `/files/home/johndoe/myfile.txt` gibi bir şey olacaktır. Böylece, o dosyanın URL'si şu şekilde olur: `/files/home/johndoe/myfile.txt`.
### OpenAPI Desteği ### OpenAPI Desteği { #openapi-support }
Test etmesi ve tanımlaması zor senaryolara sebebiyet vereceğinden dolayı OpenAPI, *yol* barındıran *yol parametrelerini* tanımlayacak bir çözüm sunmuyor. OpenAPI, içinde bir *path* barındıracak bir *path parameter* tanımlamak için bir yöntem desteklemez; çünkü bu, test etmesi ve tanımlaması zor senaryolara yol açabilir.
Ancak bunu, Starlette kütüphanesinin dahili araçlarından birini kullanarak **FastAPI**'da gerçekleştirebilirsiniz. Yine de, Starlette'in dahili araçlarından birini kullanarak bunu **FastAPI**'da yapabilirsiniz.
Parametrenin bir yol içermesi gerektiğini belirten herhangi bir doküman eklemememize rağmen dokümanlar yine de çalışacaktır. Ve dokümanlar, parametrenin bir path içermesi gerektiğini söyleyen herhangi bir dokümantasyon eklemese bile çalışmaya devam eder.
### Yol Dönüştürücü ### Path Dönüştürücü { #path-convertor }
Direkt olarak Starlette kütüphanesinden gelen bir opsiyon sayesinde aşağıdaki gibi *yol* içeren bir *yol parametresi* bağlantısı tanımlayabilirsiniz: Starlette'ten doğrudan gelen bir seçenekle, *path* içeren bir *path parameter*'ı şu URL ile tanımlayabilirsiniz:
``` ```
/files/{file_path:path} /files/{file_path:path}
``` ```
Bu durumda, parametrenin adı `file_path` olacaktır ve son kısım olan `:path` kısmı, parametrenin herhangi bir *yol* ile eşleşmesi gerektiğini belirtecektir. Bu durumda parametrenin adı `file_path`'tir ve son kısım olan `:path`, parametrenin herhangi bir *path* ile eşleşmesi gerektiğini söyler.
Böylece şunun gibi bir kullanım yapabilirsiniz: Yani şununla kullanabilirsiniz:
{* ../../docs_src/path_params/tutorial004.py hl[6] *} {* ../../docs_src/path_params/tutorial004_py39.py hl[6] *}
/// tip | İpucu /// tip | İpucu
Parametrenin başında `/home/johndoe/myfile.txt` yolunda olduğu gibi (`/`) işareti ile birlikte kullanmanız gerektiği durumlar olabilir. Parametrenin başında `/home/johndoe/myfile.txt` örneğinde olduğu gibi bir eğik çizgi (`/`) ile başlaması gerekebilir.
Bu durumda, URL, `files` ile `home` arasında iki eğik çizgiye (`//`) sahip olup `/files//home/johndoe/myfile.txt` gibi gözükecektir. Bu durumda URL, `files` ile `home` arasında çift eğik çizgi (`//`) olacak şekilde `/files//home/johndoe/myfile.txt` olur.
/// ///
## Özet ## Özet { #recap }
**FastAPI** ile kısa, sezgisel ve standart Python tip tanımlamaları kullanarak şunları elde edersiniz: **FastAPI** ile kısa, sezgisel ve standart Python tip tanımlarını kullanarak şunları elde edersiniz:
* Editör desteği: hata denetimi, otomatik tamamlama, vb. * Editör desteği: hata denetimleri, otomatik tamamlama vb.
* Veri "<abbr title="HTTP isteği ile birlikte gelen string'i Python verisine dönüştürme">dönüştürme</abbr>" * Veri "<abbr title="HTTP isteği ile birlikte gelen string'i Python verisine dönüştürme">parsing</abbr>"
* Veri doğrulama * Veri doğrulama
* API tanımlamaları ve otomatik dokümantasyon * API annotation ve otomatik dokümantasyon
Ve sadece, bunları bir kez tanımlamanız yeterli. Ve bunları sadece bir kez tanımlamanız yeterlidir.
Diğer frameworkler ile karşılaştırıldığında (ham performans dışında), üstte anlatılan durum muhtemelen **FastAPI**'ın göze çarpan başlıca avantajıdır. Bu, (ham performans dışında) **FastAPI**'ın alternatif framework'lere kıyasla muhtemelen en görünür ana avantajıdır.

94
docs/tr/docs/tutorial/query-params.md

@ -1,83 +1,83 @@
# Sorgu Parametreleri # Sorgu Parametreleri { #query-parameters }
Fonksiyonda yol parametrelerinin parçası olmayan diğer tanımlamalar otomatik olarak "sorgu" parametresi olarak yorumlanır. Fonksiyonda path parametrelerinin parçası olmayan diğer parametreleri tanımladığınızda, bunlar otomatik olarak "query" parametreleri olarak yorumlanır.
{* ../../docs_src/query_params/tutorial001.py hl[9] *} {* ../../docs_src/query_params/tutorial001_py39.py hl[9] *}
Sorgu, bağlantıdaki `?` kısmından sonra gelen ve `&` işareti ile ayrılan anahtar-değer çiftlerinin oluşturduğu bir kümedir. Query, bir URL'de `?` işaretinden sonra gelen ve `&` karakterleriyle ayrılan anahtar-değer çiftlerinin kümesidir.
Örneğin, aşağıdaki bağlantıda: Örneğin, şu URL'de:
``` ```
http://127.0.0.1:8000/items/?skip=0&limit=10 http://127.0.0.1:8000/items/?skip=0&limit=10
``` ```
...sorgu parametreleri şunlardır: ...query parametreleri şunlardır:
* `skip`: değeri `0`'dır * `skip`: değeri `0`
* `limit`: değeri `10`'dır * `limit`: değeri `10`
Parametreler bağlantının bir parçası oldukları için doğal olarak string olarak değerlendirilirler. URL'nin bir parçası oldukları için "doğal olarak" string'tirler.
Fakat, Python tipleri ile tanımlandıkları zaman (yukarıdaki örnekte `int` oldukları gibi), parametreler o tiplere dönüştürülür ve o tipler çerçevesinde doğrulanırlar. Ancak, bunları Python tipleriyle (yukarıdaki örnekte `int` olarak) tanımladığınızda, o tipe dönüştürülürler ve o tipe göre doğrulanırlar.
Yol parametreleri için geçerli olan her türlü işlem aynı şekilde sorgu parametreleri için de geçerlidir: Path parametreleri için geçerli olan aynı süreç query parametreleri için de geçerlidir:
* Editör desteği (şüphesiz) * Editör desteği (tabii ki)
* Veri "<abbr title="HTTP isteği ile birlikte gelen string'i Python verisine dönüştürme">ayrıştırma</abbr>" * Veri <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>
* Veri doğrulama * Veri doğrulama
* Otomatik dokümantasyon * Otomatik dokümantasyon
## Varsayılanlar ## Varsayılanlar { #defaults }
Sorgu parametreleri, adres yolunun sabit bir parçası olmadıklarından dolayı isteğe bağlı ve varsayılan değere sahip olabilirler. Query parametreleri path'in sabit bir parçası olmadığından, opsiyonel olabilir ve varsayılan değerlere sahip olabilir.
Yukarıdaki örnekte `skip=0` ve `limit=10` varsayılan değere sahiplerdir. Yukarıdaki örnekte varsayılan değerleri `skip=0` ve `limit=10`'dur.
Yani, aşağıdaki bağlantıya gitmek: Yani şu URL'ye gitmek:
``` ```
http://127.0.0.1:8000/items/ http://127.0.0.1:8000/items/
``` ```
şu adrese gitmek ile aynı etkiye sahiptir: şuraya gitmekle aynı olur:
``` ```
http://127.0.0.1:8000/items/?skip=0&limit=10 http://127.0.0.1:8000/items/?skip=0&limit=10
``` ```
Ancak, mesela şöyle bir adresi ziyaret ederseniz: Ancak örneğin şuraya giderseniz:
``` ```
http://127.0.0.1:8000/items/?skip=20 http://127.0.0.1:8000/items/?skip=20
``` ```
Fonksiyonunuzdaki parametre değerleri aşağıdaki gibi olacaktır: Fonksiyonunuzdaki parametre değerleri şöyle olacaktır:
* `skip=20`: çünkü bağlantıda böyle tanımlandı. * `skip=20`: çünkü URL'de siz ayarladınız
* `limit=10`: çünkü varsayılan değer buydu. * `limit=10`: çünkü varsayılan değer oydu
## İsteğe Bağlı Parametreler ## İsteğe bağlı parametreler { #optional-parameters }
Aynı şekilde, varsayılan değerlerini `None` olarak atayarak isteğe bağlı parametreler tanımlayabilirsiniz: Aynı şekilde, varsayılan değerlerini `None` yaparak isteğe bağlı query parametreleri tanımlayabilirsiniz:
{* ../../docs_src/query_params/tutorial002_py310.py hl[7] *} {* ../../docs_src/query_params/tutorial002_py310.py hl[7] *}
Bu durumda, `q` fonksiyon parametresi isteğe bağlı olacak ve varsayılan değer olarak `None` alacaktır. Bu durumda, fonksiyon parametresi `q` isteğe bağlı olur ve varsayılan olarak `None` olur.
/// check | Ek bilgi /// check | Ek bilgi
Ayrıca, dikkatinizi çekerim ki; **FastAPI**, `item_id` parametresinin bir yol parametresi olduğunu ve `q` parametresinin yol değil bir sorgu parametresi olduğunu fark edecek kadar beceriklidir. Ayrıca, **FastAPI** path parametresi olan `item_id`'nin bir path parametresi olduğunu ve `q`'nun path olmadığını fark edecek kadar akıllıdır; dolayısıyla bu bir query parametresidir.
/// ///
## Sorgu Parametresi Tip Dönüşümü ## Sorgu parametresi tip dönüşümü { #query-parameter-type-conversion }
Aşağıda görüldüğü gibi dönüştürülmek üzere `bool` tipleri de tanımlayabilirsiniz: `bool` tipleri de tanımlayabilirsiniz, ve bunlar dönüştürülür:
{* ../../docs_src/query_params/tutorial003_py310.py hl[7] *} {* ../../docs_src/query_params/tutorial003_py310.py hl[7] *}
Bu durumda, eğer şu adrese giderseniz: Bu durumda, şuraya giderseniz:
``` ```
http://127.0.0.1:8000/items/foo?short=1 http://127.0.0.1:8000/items/foo?short=1
@ -107,38 +107,38 @@ veya
http://127.0.0.1:8000/items/foo?short=yes http://127.0.0.1:8000/items/foo?short=yes
``` ```
veya adres, herhangi farklı bir harf varyasyonu içermesi durumuna rağmen (büyük harf, sadece baş harfi büyük kelime, vb.) fonksiyonunuz, `bool` tipli `short` parametresini `True` olarak algılayacaktır. Aksi halde `False` olarak algılanacaktır. veya başka herhangi bir büyük/küçük harf varyasyonunda (tamamı büyük, ilk harf büyük, vb.), fonksiyonunuz `short` parametresini `bool` değeri `True` olarak görecektir. Aksi halde `False` olarak görür.
## Çoklu Yol ve Sorgu Parametreleri ## Çoklu path ve query parametreleri { #multiple-path-and-query-parameters }
**FastAPI** neyin ne olduğunu ayırt edebileceğinden dolayı aynı anda birden fazla yol ve sorgu parametresi tanımlayabilirsiniz. Aynı anda birden fazla path parametresi ve query parametresi tanımlayabilirsiniz; **FastAPI** hangisinin hangisi olduğunu bilir.
Ve parametreleri, herhangi bir sıraya koymanıza da gerek yoktur. Ayrıca bunları belirli bir sırayla tanımlamanız gerekmez.
İsimlerine göre belirleneceklerdir: İsme göre tespit edilirler:
{* ../../docs_src/query_params/tutorial004_py310.py hl[6,8] *} {* ../../docs_src/query_params/tutorial004_py310.py hl[6,8] *}
## Zorunlu Sorgu Parametreleri ## Zorunlu query parametreleri { #required-query-parameters }
Türü yol olmayan bir parametre (şu ana kadar sadece sorgu parametrelerini gördük) için varsayılan değer tanımlarsanız o parametre zorunlu olmayacaktır. Path olmayan parametreler (şimdilik sadece query parametrelerini gördük) için varsayılan değer tanımladığınızda, bu parametre zorunlu olmaz.
Parametre için belirli bir değer atamak istemeyip parametrenin sadece isteğe bağlı olmasını istiyorsanız değerini `None` olarak atayabilirsiniz. Belirli bir değer eklemek istemiyor ama sadece opsiyonel olmasını istiyorsanız, varsayılanı `None` olarak ayarlayın.
Fakat, bir sorgu parametresini zorunlu yapmak istiyorsanız varsayılan bir değer atamamanız yeterli olacaktır: Ancak bir query parametresini zorunlu yapmak istediğinizde, herhangi bir varsayılan değer tanımlamamanız yeterlidir:
{* ../../docs_src/query_params/tutorial005.py hl[6:7] *} {* ../../docs_src/query_params/tutorial005_py39.py hl[6:7] *}
Burada `needy` parametresi `str` tipinden oluşan zorunlu bir sorgu parametresidir. Burada query parametresi `needy`, `str` tipinde zorunlu bir query parametresidir.
Eğer tarayıcınızda şu bağlantıyı: Tarayıcınızda şöyle bir URL açarsanız:
``` ```
http://127.0.0.1:8000/items/foo-item http://127.0.0.1:8000/items/foo-item
``` ```
...`needy` parametresini eklemeden açarsanız şuna benzer bir hata ile karşılaşırsınız: ...zorunlu `needy` parametresini eklemeden, şuna benzer bir hata görürsünüz:
```JSON ```JSON
{ {
@ -156,13 +156,13 @@ http://127.0.0.1:8000/items/foo-item
} }
``` ```
`needy` zorunlu bir parametre olduğundan dolayı bağlantıda tanımlanması gerekir: `needy` zorunlu bir parametre olduğundan, URL'de ayarlamanız gerekir:
``` ```
http://127.0.0.1:8000/items/foo-item?needy=sooooneedy http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
``` ```
...bu iş görür: ...bu çalışır:
```JSON ```JSON
{ {
@ -171,11 +171,11 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
} }
``` ```
Ve elbette, bazı parametreleri zorunlu, bazılarını varsayılan değerli ve bazılarını tamamen opsiyonel olarak tanımlayabilirsiniz: Ve elbette, bazı parametreleri zorunlu, bazılarını varsayılan değerli, bazılarını da tamamen isteğe bağlı olarak tanımlayabilirsiniz:
{* ../../docs_src/query_params/tutorial006_py310.py hl[8] *} {* ../../docs_src/query_params/tutorial006_py310.py hl[8] *}
Bu durumda, 3 tane sorgu parametresi var olacaktır: Bu durumda, 3 tane query parametresi vardır:
* `needy`, zorunlu bir `str`. * `needy`, zorunlu bir `str`.
* `skip`, varsayılan değeri `0` olan bir `int`. * `skip`, varsayılan değeri `0` olan bir `int`.
@ -183,6 +183,6 @@ Bu durumda, 3 tane sorgu parametresi var olacaktır:
/// tip | İpucu /// tip | İpucu
Ayrıca, [Yol Parametrelerinde](path-params.md#on-tanml-degerler){.internal-link target=_blank} de kullanıldığı şekilde `Enum` sınıfından faydalanabilirsiniz. [Path Parametreleri](path-params.md#predefined-values){.internal-link target=_blank} ile aynı şekilde `Enum`'ları da kullanabilirsiniz.
/// ///

48
docs/tr/docs/tutorial/request-forms.md

@ -1,69 +1,73 @@
# Form Verisi # Form Verisi { #form-data }
İstek gövdesinde JSON verisi yerine form alanlarını karşılamanız gerketiğinde `Form` sınıfını kullanabilirsiniz. JSON yerine form alanlarını almanız gerektiğinde `Form` kullanabilirsiniz.
/// info | Bilgi /// info | Bilgi
Formları kullanmak için öncelikle <a href="https://github.com/Kludex/python-multipart" class="external-link" target="_blank">`python-multipart`</a> paketini indirmeniz gerekmektedir. Formları kullanmak için önce <a href="https://github.com/Kludex/python-multipart" class="external-link" target="_blank">`python-multipart`</a> paketini kurun.
Örneğin `pip install python-multipart`. Bir [virtual environment](../virtual-environments.md){.internal-link target=_blank} oluşturduğunuzdan, onu etkinleştirdiğinizden emin olun ve ardından örneğin şöyle kurun:
```console
$ pip install python-multipart
```
/// ///
## `Form` Sınıfını Projenize Dahil Edin ## `Form`'u Import Edin { #import-form }
`Form` sınıfını `fastapi`'den projenize dahil edin: `Form`'u `fastapi`'den import edin:
{* ../../docs_src/request_forms/tutorial001_an_py39.py hl[3] *} {* ../../docs_src/request_forms/tutorial001_an_py39.py hl[3] *}
## `Form` Parametrelerini Tanımlayın ## `Form` Parametrelerini Tanımlayın { #define-form-parameters }
Form parametrelerini `Body` veya `Query` için yaptığınız gibi oluşturun: Form parametrelerini `Body` veya `Query` için yaptığınız gibi oluşturun:
{* ../../docs_src/request_forms/tutorial001_an_py39.py hl[9] *} {* ../../docs_src/request_forms/tutorial001_an_py39.py hl[9] *}
Örneğin, OAuth2 spesifikasyonunun kullanılabileceği ("şifre akışı" olarak adlandırılan) yollardan birinde, form alanları olarak <abbr title="Kullanıcı Adı: Username">"username"</abbr> ve <abbr title="Şifre: Password">"password"</abbr> gönderilmesi gerekir. Örneğin OAuth2 spesifikasyonunun kullanılabileceği ("password flow" olarak adlandırılan) yollardan birinde, form alanları olarak bir `username` ve `password` göndermek zorunludur.
Bu <abbr title="Spesifikasyon: Specification">spesifikasyon</abbr> form alanlarını adlandırırken isimlerinin birebir `username` ve `password` olmasını ve JSON verisi yerine form verisi olarak gönderilmesini gerektirir. <abbr title="specification - spesifikasyon">spec</abbr>, alanların adının tam olarak `username` ve `password` olmasını ve JSON değil form alanları olarak gönderilmesini gerektirir.
`Form` sınıfıyla tanımlama yaparken `Body`, `Query`, `Path` ve `Cookie` sınıflarında kullandığınız aynı validasyon, örnekler, isimlendirme (örneğin `username` yerine `user-name` kullanımı) ve daha fazla konfigurasyonu kullanabilirsiniz. `Form` ile `Body` (ve `Query`, `Path`, `Cookie`) ile yaptığınız aynı konfigürasyonları tanımlayabilirsiniz; validasyon, örnekler, alias (örn. `username` yerine `user-name`) vb. dahil.
/// info | Bilgi /// info | Bilgi
`Form` doğrudan `Body` sınıfını miras alan bir sınıftır. `Form`, doğrudan `Body`'den miras alan bir sınıftır.
/// ///
/// tip | İpucu /// tip | İpucu
Form gövdelerini tanımlamak için `Form` sınıfını kullanmanız gerekir; çünkü bu olmadan parametreler sorgu parametreleri veya gövde (JSON) parametreleri olarak yorumlanır. Form gövdelerini tanımlamak için `Form`'u açıkça kullanmanız gerekir; çünkü bunu yapmazsanız parametreler query parametreleri veya body (JSON) parametreleri olarak yorumlanır.
/// ///
## "Form Alanları" Hakkında ## "Form Alanları" Hakkında { #about-form-fields }
HTML formlarının (`<form></form>`) verileri sunucuya gönderirken JSON'dan farklı özel bir kodlama kullanır. HTML formlarının (`<form></form>`) verileri sunucuya gönderme şekli normalde bu veri için JSON'dan farklı "özel" bir encoding kullanır.
**FastAPI** bu verilerin JSON yerine doğru şekilde okunmasını sağlayacaktır. **FastAPI** bu veriyi JSON yerine doğru yerden okuyacaktır.
/// note | Teknik Detaylar /// note | Teknik Detaylar
Form verileri normalde `application/x-www-form-urlencoded` medya tipiyle kodlanır. Formlardan gelen veri normalde "media type" `application/x-www-form-urlencoded` kullanılarak encode edilir.
Ancak form içerisinde dosyalar yer aldığında `multipart/form-data` olarak kodlanır. Bir sonraki bölümde dosyaların işlenmesi hakkında bilgi edineceksiniz. Ancak form dosyalar içerdiğinde `multipart/form-data` olarak encode edilir. Dosyaları ele almayı bir sonraki bölümde okuyacaksınız.
Form kodlama türleri ve form alanları hakkında daha fazla bilgi edinmek istiyorsanız <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST" class="external-link" target="_blank"><abbr title="Mozilla Developer Network">MDN</abbr> web docs for <code>POST</code></a> sayfasını ziyaret edebilirsiniz. Bu encoding'ler ve form alanları hakkında daha fazla okumak isterseniz, <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST" class="external-link" target="_blank"><abbr title="Mozilla Developer Network">MDN</abbr> web docs for <code>POST</code></a> sayfasına gidin.
/// ///
/// warning | Uyarı /// warning | Uyarı
*Yol operasyonları* içerisinde birden fazla `Form` parametresi tanımlayabilirsiniz ancak bunlarla birlikte JSON verisi kabul eden `Body` alanları tanımlayamazsınız çünkü bu durumda istek gövdesi `application/json` yerine `application/x-www-form-urlencoded` ile kodlanmış olur. Bir *path operation* içinde birden fazla `Form` parametresi tanımlayabilirsiniz, ancak JSON olarak almayı beklediğiniz `Body` alanlarını da ayrıca tanımlayamazsınız; çünkü bu durumda request'in body'si `application/json` yerine `application/x-www-form-urlencoded` ile encode edilmiş olur.
Bu **FastAPI**'ın getirdiği bir kısıtlama değildir, HTTP protokolünün bir parçasıdır. Bu **FastAPI**'ın bir kısıtlama değildir, HTTP protokolünün bir parçasıdır.
/// ///
## Özet ## Özet { #recap }
Form verisi girdi parametreleri tanımlamak için `Form` sınıfını kullanın. Form verisi girdi parametrelerini tanımlamak için `Form` kullanın.

38
docs/tr/docs/tutorial/static-files.md

@ -1,40 +1,40 @@
# Statik Dosyalar # Statik Dosyalar { #static-files }
`StaticFiles`'ı kullanarak statik dosyaları bir yol altında sunabilirsiniz. `StaticFiles` kullanarak bir dizindeki statik dosyaları otomatik olarak sunabilirsiniz.
## `StaticFiles` Kullanımı ## `StaticFiles` Kullanımı { #use-staticfiles }
* `StaticFiles` sınıfını projenize dahil edin. * `StaticFiles`'ı import edin.
* Bir `StaticFiles()` örneğini belirli bir yola bağlayın. * Belirli bir path'te bir `StaticFiles()` örneğini "mount" edin.
{* ../../docs_src/static_files/tutorial001.py hl[2,6] *} {* ../../docs_src/static_files/tutorial001_py39.py hl[2,6] *}
/// note | Teknik Detaylar /// note | Teknik Detaylar
Projenize dahil etmek için `from starlette.staticfiles import StaticFiles` kullanabilirsiniz. `from starlette.staticfiles import StaticFiles` da kullanabilirsiniz.
**FastAPI**, geliştiricilere kolaylık sağlamak amacıyla `starlette.staticfiles``fastapi.staticfiles` olarak sağlar. Ancak `StaticFiles` sınıfı aslında doğrudan Starlette'den gelir. **FastAPI**, geliştirici olarak size kolaylık olsun diye `starlette.staticfiles``fastapi.staticfiles` olarak da sağlar. Ancak aslında doğrudan Starlette'den gelir.
/// ///
### Bağlama (Mounting) Nedir? ### "Mounting" Nedir { #what-is-mounting }
"Bağlamak", belirli bir yola tamamen "bağımsız" bir uygulama eklemek anlamına gelir ve ardından tüm alt yollara gelen istekler bu uygulama tarafından işlenir. "Mounting", belirli bir path'te tamamen "bağımsız" bir uygulama eklemek ve sonrasında tüm alt path'leri handle etmesini sağlamak demektir.
Bu, bir `APIRouter` kullanmaktan farklıdır çünkü bağlanmış bir uygulama tamamen bağımsızdır. Ana uygulamanızın OpenAPI ve dokümanlar, bağlanmış uygulamadan hiçbir şey içermez, vb. Bu, bir `APIRouter` kullanmaktan farklıdır; çünkü mount edilen uygulama tamamen bağımsızdır. Ana uygulamanızın OpenAPI ve docs'ları, mount edilen uygulamadan hiçbir şey içermez, vb.
[Advanced User Guide](../advanced/index.md){.internal-link target=_blank} bölümünde daha fazla bilgi edinebilirsiniz. Bununla ilgili daha fazla bilgiyi [Advanced User Guide](../advanced/index.md){.internal-link target=_blank} içinde okuyabilirsiniz.
## Detaylar ## Detaylar { #details }
`"/static"` ifadesi, bu "alt uygulamanın" "bağlanacağı" alt yolu belirtir. Bu nedenle, `"/static"` ile başlayan her yol, bu uygulama tarafından işlenir. İlk `"/static"`, bu "alt uygulamanın" "mount" edileceği alt path'i ifade eder. Dolayısıyla `"/static"` ile başlayan herhangi bir path bunun tarafından handle edilir.
`directory="static"` ifadesi, statik dosyalarınızı içeren dizinin adını belirtir. `directory="static"`, statik dosyalarınızı içeren dizinin adını ifade eder.
`name="static"` ifadesi, alt uygulamanın **FastAPI** tarafından kullanılacak ismini belirtir. `name="static"`, **FastAPI**'nin dahili olarak kullanabileceği bir isim verir.
Bu parametrelerin hepsi "`static`"den farklı olabilir, bunları kendi uygulamanızın ihtiyaçlarına göre belirleyebilirsiniz. Bu parametrelerin hepsi "`static`" ile aynı olmak zorunda değildir; kendi uygulamanızın ihtiyaçlarına ve özel detaylarına göre ayarlayın.
## Daha Fazla Bilgi ## Daha Fazla Bilgi { #more-info }
Daha fazla detay ve seçenek için <a href="https://www.starlette.dev/staticfiles/" class="external-link" target="_blank">Starlette'in Statik Dosyalar hakkındaki dokümantasyonunu</a> incelleyin. Daha fazla detay ve seçenek için <a href="https://www.starlette.dev/staticfiles/" class="external-link" target="_blank">Starlette'in Statik Dosyalar hakkındaki dokümanlarını</a> inceleyin.

80
docs/uk/docs/alternatives.md

@ -1,8 +1,8 @@
# Альтернативи, натхнення та порівняння # Альтернативи, натхнення та порівняння { #alternatives-inspiration-and-comparisons }
Що надихнуло на створення **FastAPI**, який він у порінянні з іншими альтернативами та чого він у них навчився. Що надихнуло **FastAPI**, як він порівнюється з альтернативами та чого він у них навчився.
## Вступ ## Вступ { #intro }
**FastAPI** не існувало б, якби не попередні роботи інших. **FastAPI** не існувало б, якби не попередні роботи інших.
@ -12,17 +12,17 @@
Але в якийсь момент не було іншого виходу, окрім створення чогось, що надавало б усі ці функції, взявши найкращі ідеї з попередніх інструментів і поєднавши їх найкращим чином, використовуючи мовні функції, які навіть не були доступні раніше (Python 3.6+ підказки типів). Але в якийсь момент не було іншого виходу, окрім створення чогось, що надавало б усі ці функції, взявши найкращі ідеї з попередніх інструментів і поєднавши їх найкращим чином, використовуючи мовні функції, які навіть не були доступні раніше (Python 3.6+ підказки типів).
## Попередні інструменти ## Попередні інструменти { #previous-tools }
### <a href="https://www.djangoproject.com/" class="external-link" target="_blank">Django</a> ### <a href="https://www.djangoproject.com/" class="external-link" target="_blank">Django</a> { #django }
Це найпопулярніший фреймворк Python, який користується широкою довірою. Він використовується для створення таких систем, як Instagram. Це найпопулярніший фреймворк Python, який користується широкою довірою. Він використовується для створення таких систем, як Instagram.
Він відносно тісно пов’язаний з реляційними базами даних (наприклад, MySQL або PostgreSQL), тому мати базу даних NoSQL (наприклад, Couchbase, MongoDB, Cassandra тощо) як основний механізм зберігання не дуже просто. Він відносно тісно пов’язаний з реляційними базами даних (наприклад, MySQL або PostgreSQL), тому мати базу даних NoSQL (наприклад, Couchbase, MongoDB, Cassandra тощо) як основний механізм зберігання не дуже просто.
Він був створений для створення HTML у серверній частині, а не для створення API, які використовуються сучасним інтерфейсом (як-от React, Vue.js і Angular) або іншими системами (як-от <abbr title="Internet of Things">IoT</abbr > пристрої), які спілкуються з ним. Він був створений для створення HTML у серверній частині, а не для створення API, які використовуються сучасним інтерфейсом (як-от React, Vue.js і Angular) або іншими системами (як-от <abbr title="Internet of Things - Інтернет речей">IoT</abbr> пристрої), які спілкуються з ним.
### <a href="https://www.django-rest-framework.org/" class="external-link" target="_blank">Django REST Framework</a> ### <a href="https://www.django-rest-framework.org/" class="external-link" target="_blank">Django REST Framework</a> { #django-rest-framework }
Фреймворк Django REST був створений як гнучкий інструментарій для створення веб-інтерфейсів API використовуючи Django в основі, щоб покращити його можливості API. Фреймворк Django REST був створений як гнучкий інструментарій для створення веб-інтерфейсів API використовуючи Django в основі, щоб покращити його можливості API.
@ -42,7 +42,7 @@ Django REST Framework створив Том Крісті. Той самий тв
/// ///
### <a href="https://flask.palletsprojects.com" class="external-link" target="_blank">Flask</a> ### <a href="https://flask.palletsprojects.com" class="external-link" target="_blank">Flask</a> { #flask }
Flask — це «мікрофреймворк», він не включає інтеграцію бази даних, а також багато речей, які за замовчуванням є в Django. Flask — це «мікрофреймворк», він не включає інтеграцію бази даних, а також багато речей, які за замовчуванням є в Django.
@ -64,7 +64,7 @@ Flask — це «мікрофреймворк», він не включає ін
/// ///
### <a href="https://requests.readthedocs.io" class="external-link" target="_blank">Requests</a> ### <a href="https://requests.readthedocs.io" class="external-link" target="_blank">Requests</a> { #requests }
**FastAPI** насправді не є альтернативою **Requests**. Сфера їх застосування дуже різна. **FastAPI** насправді не є альтернативою **Requests**. Сфера їх застосування дуже різна.
@ -88,12 +88,12 @@ Requests мають дуже простий та інтуїтивно зрозу
response = requests.get("http://example.com/some/url") response = requests.get("http://example.com/some/url")
``` ```
Відповідна операція *роуту* API FastAPI може виглядати так: Відповідна операція шляху API FastAPI може виглядати так:
```Python hl_lines="1" ```Python hl_lines="1"
@app.get("/some/url") @app.get("/some/url")
def read_url(): def read_url():
return {"message": "Hello World"} return {"message": "Hello World"}
``` ```
Зверніть увагу на схожість у `requests.get(...)` і `@app.get(...)`. Зверніть увагу на схожість у `requests.get(...)` і `@app.get(...)`.
@ -101,12 +101,12 @@ def read_url():
/// check | Надихнуло **FastAPI** на /// check | Надихнуло **FastAPI** на
* Майте простий та інтуїтивно зрозумілий API. * Майте простий та інтуїтивно зрозумілий API.
* Використовуйте імена (операції) методів HTTP безпосередньо, простим та інтуїтивно зрозумілим способом. * Використовуйте імена (операції) методів HTTP безпосередньо, простим та інтуїтивно зрозумілим способом.
* Розумні параметри за замовчуванням, але потужні налаштування. * Розумні параметри за замовчуванням, але потужні налаштування.
/// ///
### <a href="https://swagger.io/" class="external-link" target="_blank">Swagger</a> / <a href="https://github.com/OAI /OpenAPI-Specification/" class="external-link" target="_blank">OpenAPI</a> ### <a href="https://swagger.io/" class="external-link" target="_blank">Swagger</a> / <a href="https://github.com/OAI/OpenAPI-Specification/" class="external-link" target="_blank">OpenAPI</a> { #swagger-openapi }
Головною функцією, яку я хотів від Django REST Framework, була автоматична API документація. Головною функцією, яку я хотів від Django REST Framework, була автоматична API документація.
@ -124,18 +124,18 @@ def read_url():
Інтегрувати інструменти інтерфейсу на основі стандартів: Інтегрувати інструменти інтерфейсу на основі стандартів:
* <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Інтерфейс Swagger</a> * <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Інтерфейс Swagger</a>
* <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a> * <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a>
Ці два було обрано через те, що вони досить популярні та стабільні, але, виконавши швидкий пошук, ви можете знайти десятки додаткових альтернативних інтерфейсів для OpenAPI (які можна використовувати з **FastAPI**). Ці два було обрано через те, що вони досить популярні та стабільні, але, виконавши швидкий пошук, ви можете знайти десятки додаткових альтернативних інтерфейсів для OpenAPI (які можна використовувати з **FastAPI**).
/// ///
### Фреймворки REST для Flask ### Фреймворки REST для Flask { #flask-rest-frameworks }
Існує кілька фреймворків Flask REST, але, витративши час і роботу на їх дослідження, я виявив, що багато з них припинено або залишено, з кількома постійними проблемами, які зробили їх непридатними. Існує кілька фреймворків Flask REST, але, витративши час і роботу на їх дослідження, я виявив, що багато з них припинено або залишено, з кількома постійними проблемами, які зробили їх непридатними.
### <a href="https://marshmallow.readthedocs.io/en/stable/" class="external-link" target="_blank">Marshmallow</a> ### <a href="https://marshmallow.readthedocs.io/en/stable/" class="external-link" target="_blank">Marshmallow</a> { #marshmallow }
Однією з головних функцій, необхідних для систем API, є "<abbr title="також звана marshalling, conversion">серіалізація</abbr>", яка бере дані з коду (Python) і перетворює їх на щось, що можна надіслати через мережу. Наприклад, перетворення об’єкта, що містить дані з бази даних, на об’єкт JSON. Перетворення об’єктів `datetime` на строки тощо. Однією з головних функцій, необхідних для систем API, є "<abbr title="також звана marshalling, conversion">серіалізація</abbr>", яка бере дані з коду (Python) і перетворює їх на щось, що можна надіслати через мережу. Наприклад, перетворення об’єкта, що містить дані з бази даних, на об’єкт JSON. Перетворення об’єктів `datetime` на строки тощо.
@ -153,7 +153,7 @@ Marshmallow створено для забезпечення цих функці
/// ///
### <a href="https://webargs.readthedocs.io/en/latest/" class="external-link" target="_blank">Webargs</a> ### <a href="https://webargs.readthedocs.io/en/latest/" class="external-link" target="_blank">Webargs</a> { #webargs }
Іншою важливою функцією, необхідною для API, є <abbr title="читання та перетворення даних Python">аналіз</abbr> даних із вхідних запитів. Іншою важливою функцією, необхідною для API, є <abbr title="читання та перетворення даних Python">аналіз</abbr> даних із вхідних запитів.
@ -175,7 +175,7 @@ Webargs був створений тими ж розробниками Marshmall
/// ///
### <a href="https://apispec.readthedocs.io/en/stable/" class="external-link" target="_blank">APISpec</a> ### <a href="https://apispec.readthedocs.io/en/stable/" class="external-link" target="_blank">APISpec</a> { #apispec }
Marshmallow і Webargs забезпечують перевірку, аналіз і серіалізацію як плагіни. Marshmallow і Webargs забезпечують перевірку, аналіз і серіалізацію як плагіни.
@ -205,7 +205,7 @@ APISpec був створений тими ж розробниками Marshmall
/// ///
### <a href="https://flask-apispec.readthedocs.io/en/latest/" class="external-link" target="_blank">Flask-apispec</a> ### <a href="https://flask-apispec.readthedocs.io/en/latest/" class="external-link" target="_blank">Flask-apispec</a> { #flask-apispec }
Це плагін Flask, який об’єднує Webargs, Marshmallow і APISpec. Це плагін Flask, який об’єднує Webargs, Marshmallow і APISpec.
@ -237,13 +237,13 @@ Flask-apispec був створений тими ж розробниками Mar
/// ///
### <a href="https://nestjs.com/" class="external-link" target="_blank">NestJS</a> (та <a href="https://angular.io/ " class="external-link" target="_blank">Angular</a>) ### <a href="https://nestjs.com/" class="external-link" target="_blank">NestJS</a> (та <a href="https://angular.io/" class="external-link" target="_blank">Angular</a>) { #nestjs-and-angular }
Це навіть не Python, NestJS — це фреймворк NodeJS JavaScript (TypeScript), натхненний Angular. Це навіть не Python, NestJS — це фреймворк NodeJS JavaScript (TypeScript), натхненний Angular.
Це досягає чогось подібного до того, що можна зробити з Flask-apispec. Це досягає чогось подібного до того, що можна зробити з Flask-apispec.
Він має інтегровану систему впровадження залежностей, натхненну Angular two. Він потребує попередньої реєстрації «injectables» (як і всі інші системи впровадження залежностей, які я знаю), тому це збільшує багатослівність та повторення коду. Він має інтегровану систему впровадження залежностей, натхненну Angular 2. Він потребує попередньої реєстрації «injectables» (як і всі інші системи впровадження залежностей, які я знаю), тому це збільшує багатослівність та повторення коду.
Оскільки параметри описані за допомогою типів TypeScript (подібно до підказок типу Python), підтримка редактора досить хороша. Оскільки параметри описані за допомогою типів TypeScript (подібно до підказок типу Python), підтримка редактора досить хороша.
@ -259,7 +259,7 @@ Flask-apispec був створений тими ж розробниками Mar
/// ///
### <a href="https://sanic.readthedocs.io/en/latest/" class="external-link" target="_blank">Sanic</a> ### <a href="https://sanic.readthedocs.io/en/latest/" class="external-link" target="_blank">Sanic</a> { #sanic }
Це був один із перших надзвичайно швидких фреймворків Python на основі `asyncio`. Він був дуже схожий на Flask. Це був один із перших надзвичайно швидких фреймворків Python на основі `asyncio`. Він був дуже схожий на Flask.
@ -279,7 +279,7 @@ Flask-apispec був створений тими ж розробниками Mar
/// ///
### <a href="https://falconframework.org/" class="external-link" target="_blank">Falcon</a> ### <a href="https://falconframework.org/" class="external-link" target="_blank">Falcon</a> { #falcon }
Falcon — ще один високопродуктивний фреймворк Python, він розроблений як мінімальний і працює як основа інших фреймворків, таких як Hug. Falcon — ще один високопродуктивний фреймворк Python, він розроблений як мінімальний і працює як основа інших фреймворків, таких як Hug.
@ -297,7 +297,7 @@ Falcon — ще один високопродуктивний фреймворк
/// ///
### <a href="https://moltenframework.com/" class="external-link" target="_blank">Molten</a> ### <a href="https://moltenframework.com/" class="external-link" target="_blank">Molten</a> { #molten }
Я відкрив для себе Molten на перших етапах створення **FastAPI**. І він має досить схожі ідеї: Я відкрив для себе Molten на перших етапах створення **FastAPI**. І він має досить схожі ідеї:
@ -321,7 +321,7 @@ Falcon — ще один високопродуктивний фреймворк
/// ///
### <a href="https://github.com/hugapi/hug" class="external-link" target="_blank">Hug</a> ### <a href="https://github.com/hugapi/hug" class="external-link" target="_blank">Hug</a> { #hug }
Hug був одним із перших фреймворків, який реалізував оголошення типів параметрів API за допомогою підказок типу Python. Це була чудова ідея, яка надихнула інші інструменти зробити те саме. Hug був одним із перших фреймворків, який реалізував оголошення типів параметрів API за допомогою підказок типу Python. Це була чудова ідея, яка надихнула інші інструменти зробити те саме.
@ -351,7 +351,7 @@ Hug надихнув частину APIStar і був одним із найбі
/// ///
### <a href="https://github.com/encode/apistar" class="external-link" target="_blank">APIStar</a> (<= 0,5) ### <a href="https://github.com/encode/apistar" class="external-link" target="_blank">APIStar</a> (<= 0,5) { #apistar-0-5 }
Безпосередньо перед тим, як вирішити створити **FastAPI**, я знайшов сервер **APIStar**. Він мав майже все, що я шукав, і мав чудовий дизайн. Безпосередньо перед тим, як вирішити створити **FastAPI**, я знайшов сервер **APIStar**. Він мав майже все, що я шукав, і мав чудовий дизайн.
@ -379,9 +379,9 @@ Hug надихнув частину APIStar і був одним із найбі
APIStar створив Том Крісті. Той самий хлопець, який створив: APIStar створив Том Крісті. Той самий хлопець, який створив:
* Django REST Framework * Django REST Framework
* Starlette (на якому базується **FastAPI**) * Starlette (на якому базується **FastAPI**)
* Uvicorn (використовується Starlette і **FastAPI**) * Uvicorn (використовується Starlette і **FastAPI**)
/// ///
@ -393,13 +393,15 @@ APIStar створив Том Крісті. Той самий хлопець, я
І після тривалого пошуку подібної структури та тестування багатьох різних альтернатив, APIStar став найкращим доступним варіантом. І після тривалого пошуку подібної структури та тестування багатьох різних альтернатив, APIStar став найкращим доступним варіантом.
Потім APIStar перестав існувати як сервер, і було створено Starlette, який став новою кращою основою для такої системи. Це стало останнім джерелом натхнення для створення **FastAPI**. Я вважаю **FastAPI** «духовним спадкоємцем» APIStar, удосконалюючи та розширюючи функції, систему введення тексту та інші частини на основі досвіду, отриманого від усіх цих попередніх інструментів. Потім APIStar перестав існувати як сервер, і було створено Starlette, який став новою кращою основою для такої системи. Це стало останнім джерелом натхнення для створення **FastAPI**.
Я вважаю **FastAPI** «духовним спадкоємцем» APIStar, удосконалюючи та розширюючи функції, систему типізації та інші частини на основі досвіду, отриманого від усіх цих попередніх інструментів.
/// ///
## Використовується **FastAPI** ## Використовується **FastAPI** { #used-by-fastapi }
### <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a> ### <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a> { #pydantic }
Pydantic — це бібліотека для визначення перевірки даних, серіалізації та документації (за допомогою схеми JSON) на основі підказок типу Python. Pydantic — це бібліотека для визначення перевірки даних, серіалізації та документації (за допомогою схеми JSON) на основі підказок типу Python.
@ -415,9 +417,9 @@ Pydantic — це бібліотека для визначення переві
/// ///
### <a href="https://www.starlette.dev/" class="external-link" target="_blank">Starlette</a> ### <a href="https://www.starlette.dev/" class="external-link" target="_blank">Starlette</a> { #starlette }
Starlette — це легкий фреймворк/набір інструментів <abbr title="The new standard for build asynchronous Python web">ASGI</abbr>, який ідеально підходить для створення високопродуктивних asyncio сервісів. Starlette — це легкий фреймворк/набір інструментів <abbr title="Новий стандарт для створення асинхронних Python вебзастосунків">ASGI</abbr>, який ідеально підходить для створення високопродуктивних asyncio сервісів.
Він дуже простий та інтуїтивно зрозумілий. Його розроблено таким чином, щоб його можна було легко розширювати та мати модульні компоненти. Він дуже простий та інтуїтивно зрозумілий. Його розроблено таким чином, щоб його можна було легко розширювати та мати модульні компоненти.
@ -460,7 +462,7 @@ ASGI — це новий «стандарт», який розробляєтьс
/// ///
### <a href="https://www.uvicorn.dev/" class="external-link" target="_blank">Uvicorn</a> ### <a href="https://www.uvicorn.dev/" class="external-link" target="_blank">Uvicorn</a> { #uvicorn }
Uvicorn — це блискавичний сервер ASGI, побудований на uvloop і httptools. Uvicorn — це блискавичний сервер ASGI, побудований на uvloop і httptools.
@ -472,12 +474,12 @@ Uvicorn — це блискавичний сервер ASGI, побудован
Основний веб-сервер для запуску програм **FastAPI**. Основний веб-сервер для запуску програм **FastAPI**.
Ви можете поєднати його з Gunicorn, щоб мати асинхронний багатопроцесний сервер. Ви також можете використати параметр командного рядка `--workers`, щоб мати асинхронний багатопроцесний сервер.
Додаткову інформацію див. у розділі [Розгортання](deployment/index.md){.internal-link target=_blank}. Додаткову інформацію див. у розділі [Розгортання](deployment/index.md){.internal-link target=_blank}.
/// ///
## Орієнтири та швидкість ## Орієнтири та швидкість { #benchmarks-and-speed }
Щоб зрозуміти, порівняти та побачити різницю між Uvicorn, Starlette і FastAPI, перегляньте розділ про [Бенчмарки](benchmarks.md){.internal-link target=_blank}. Щоб зрозуміти, порівняти та побачити різницю між Uvicorn, Starlette і FastAPI, перегляньте розділ про [Бенчмарки](benchmarks.md){.internal-link target=_blank}.

108
docs/uk/docs/fastapi-cli.md

@ -1,83 +1,75 @@
# FastAPI CLI # FastAPI CLI { #fastapi-cli }
**FastAPI CLI** це програма командного рядка, яку Ви можете використовувати, щоб обслуговувати Ваш додаток FastAPI, керувати Вашими FastApi проектами, тощо. **FastAPI CLI** це програма командного рядка, яку ви можете використовувати, щоб обслуговувати ваш застосунок FastAPI, керувати вашим проєктом FastAPI тощо.
Коли Ви встановлюєте FastApi (тобто виконуєте `pip install "fastapi[standard]"`), Ви також встановлюєте пакунок `fastapi-cli`, цей пакунок надає команду `fastapi` в терміналі. Коли ви встановлюєте FastAPI (наприклад, за допомогою `pip install "fastapi[standard]"`), він включає пакет під назвою `fastapi-cli`, цей пакет надає команду `fastapi` у терміналі.
Для запуску Вашого FastAPI проекту для розробки, Ви можете скористатись командою `fastapi dev`: Щоб запустити ваш застосунок FastAPI для розробки, ви можете використати команду `fastapi dev`:
<div class="termy"> <div class="termy">
```console ```console
$ <font color="#4E9A06">fastapi</font> dev <u style="text-decoration-style:single">main.py</u> $ <font color="#4E9A06">fastapi</font> dev <u style="text-decoration-style:solid">main.py</u>
<font color="#3465A4">INFO </font> Using path <font color="#3465A4">main.py</font>
<font color="#3465A4">INFO </font> Resolved absolute path <font color="#75507B">/home/user/code/awesomeapp/</font><font color="#AD7FA8">main.py</font> <span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting development server 🚀
<font color="#3465A4">INFO </font> Searching for package file structure from directories with <font color="#3465A4">__init__.py</font> files
<font color="#3465A4">INFO </font> Importing from <font color="#75507B">/home/user/code/</font><font color="#AD7FA8">awesomeapp</font> Searching for package file structure from directories with
<font color="#3465A4">__init__.py</font> files
╭─ <font color="#8AE234"><b>Python module file</b></font> ─╮ Importing from <font color="#75507B">/home/user/code/</font><font color="#AD7FA8">awesomeapp</font>
│ │
│ 🐍 main.py │ <span style="background-color:#007166"><font color="#D3D7CF"> module </font></span> 🐍 main.py
│ │
╰──────────────────────╯ <span style="background-color:#007166"><font color="#D3D7CF"> code </font></span> Importing the FastAPI app object from the module with the
following code:
<font color="#3465A4">INFO </font> Importing module <font color="#4E9A06">main</font>
<font color="#3465A4">INFO </font> Found importable FastAPI app <u style="text-decoration-style:solid">from </u><u style="text-decoration-style:solid"><b>main</b></u><u style="text-decoration-style:solid"> import </u><u style="text-decoration-style:solid"><b>app</b></u>
╭─ <font color="#8AE234"><b>Importable FastAPI app</b></font> ─╮ <span style="background-color:#007166"><font color="#D3D7CF"> app </font></span> Using import string: <font color="#3465A4">main:app</font>
│ │
<span style="background-color:#272822"><font color="#FF4689">from</font></span><span style="background-color:#272822"><font color="#F8F8F2"> main </font></span><span style="background-color:#272822"><font color="#FF4689">import</font></span><span style="background-color:#272822"><font color="#F8F8F2"> app</font></span><span style="background-color:#272822"> </span> <span style="background-color:#007166"><font color="#D3D7CF"> server </font></span> Server started at <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000</u></font>
│ │ <span style="background-color:#007166"><font color="#D3D7CF"> server </font></span> Documentation at <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000/docs</u></font>
╰──────────────────────────╯
<span style="background-color:#007166"><font color="#D3D7CF"> tip </font></span> Running in development mode, for production use:
<font color="#3465A4">INFO </font> Using import string <font color="#8AE234"><b>main:app</b></font> <b>fastapi run</b>
<span style="background-color:#C4A000"><font color="#2E3436">╭────────── FastAPI CLI - Development mode ───────────╮</font></span> Logs:
<span style="background-color:#C4A000"><font color="#2E3436">│ │</font></span>
<span style="background-color:#C4A000"><font color="#2E3436">│ Serving at: http://127.0.0.1:8000 │</font></span> <span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Will watch for changes in these directories:
<span style="background-color:#C4A000"><font color="#2E3436">│ │</font></span> <b>[</b><font color="#4E9A06">&apos;/home/user/code/awesomeapp&apos;</font><b>]</b>
<span style="background-color:#C4A000"><font color="#2E3436">│ API docs: http://127.0.0.1:8000/docs │</font></span> <span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Uvicorn running on <font color="#729FCF"><u style="text-decoration-style:solid">http://127.0.0.1:8000</u></font> <b>(</b>Press CTRL+C to
<span style="background-color:#C4A000"><font color="#2E3436">│ │</font></span> quit<b>)</b>
<span style="background-color:#C4A000"><font color="#2E3436">│ Running in development mode, for production use: │</font></span> <span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started reloader process <b>[</b><font color="#34E2E2"><b>383138</b></font><b>]</b> using WatchFiles
<span style="background-color:#C4A000"><font color="#2E3436">│ │</font></span> <span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>383153</b></font><b>]</b>
<span style="background-color:#C4A000"><font color="#2E3436"></font></span><span style="background-color:#C4A000"><font color="#555753"><b>fastapi run</b></font></span><span style="background-color:#C4A000"><font color="#2E3436"></font></span> <span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color:#C4A000"><font color="#2E3436">│ │</font></span> <span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
<span style="background-color:#C4A000"><font color="#2E3436">╰─────────────────────────────────────────────────────╯</font></span>
<font color="#4E9A06">INFO</font>: Will watch for changes in these directories: [&apos;/home/user/code/awesomeapp&apos;]
<font color="#4E9A06">INFO</font>: Uvicorn running on <b>http://127.0.0.1:8000</b> (Press CTRL+C to quit)
<font color="#4E9A06">INFO</font>: Started reloader process [<font color="#34E2E2"><b>2265862</b></font>] using <font color="#34E2E2"><b>WatchFiles</b></font>
<font color="#4E9A06">INFO</font>: Started server process [<font color="#06989A">2265873</font>]
<font color="#4E9A06">INFO</font>: Waiting for application startup.
<font color="#4E9A06">INFO</font>: Application startup complete.
``` ```
</div> </div>
Програма командного рядка `fastapi` це **FastAPI CLI**. Програма командного рядка під назвою `fastapi` — це **FastAPI CLI**.
FastAPI CLI приймає шлях до Вашої Python програми (напр. `main.py`) і автоматично виявляє екземпляр `FastAPI` (зазвичай названий `app`), обирає коректний процес імпорту, а потім обслуговує його. FastAPI CLI бере шлях до вашої Python-програми (наприклад, `main.py`) і автоматично виявляє екземпляр `FastAPI` (зазвичай з назвою `app`), визначає правильний процес імпорту, а потім обслуговує його.
Натомість, для запуску у продакшн використовуйте `fastapi run`. 🚀 Натомість, для продакшн ви використали б `fastapi run`. 🚀
Всередині **FastAPI CLI** використовує <a href="https://www.uvicorn.dev" class="external-link" target="_blank">Uvicorn</a>, високопродуктивний, production-ready, ASGI cервер. 😎 Внутрішньо **FastAPI CLI** використовує <a href="https://www.uvicorn.dev" class="external-link" target="_blank">Uvicorn</a>, високопродуктивний, production-ready, ASGI сервер. 😎
## `fastapi dev` ## `fastapi dev` { #fastapi-dev }
Використання `fastapi dev` ініціює режим розробки. Запуск `fastapi dev` ініціює режим розробки.
За замовчуванням, **автоматичне перезавантаження** увімкнене, автоматично перезавантажуючи сервер кожного разу, коли Ви змінюєте Ваш код. Це ресурсо-затратно, та може бути менш стабільним, ніж коли воно вимкнене. Ви повинні використовувати його тільки під час розробки. Воно також слухає IP-адресу `127.0.0.1`, що є IP Вашого девайсу для самостійної комунікації з самим собою (`localhost`). За замовчуванням **auto-reload** увімкнено, і сервер автоматично перезавантажується, коли ви вносите зміни у ваш код. Це ресурсоємно та може бути менш стабільним, ніж коли його вимкнено. Вам слід використовувати це лише для розробки. Також він слухає IP-адресу `127.0.0.1`, яка є IP-адресою для того, щоб ваша машина могла взаємодіяти лише сама з собою (`localhost`).
## `fastapi run` ## `fastapi run` { #fastapi-run }
Виконання `fastapi run` запустить FastAPI у продакшн-режимі за замовчуванням. Виконання `fastapi run` за замовчуванням запускає FastAPI у продакшн-режимі.
За замовчуванням, **автоматичне перезавантаження** вимкнене. Воно також прослуховує IP-адресу `0.0.0.0`, що означає всі доступні IP адреси, тим самим даючи змогу будь-кому комунікувати з девайсом. Так Ви зазвичай будете запускати його у продакшн, наприклад у контейнері. За замовчуванням **auto-reload** вимкнено. Також він слухає IP-адресу `0.0.0.0`, що означає всі доступні IP-адреси, таким чином він буде публічно доступним для будь-кого, хто може взаємодіяти з машиною. Зазвичай саме так ви запускатимете його в продакшн, наприклад у контейнері.
В більшості випадків Ви можете (і маєте) мати "termination proxy", який обробляє HTTPS для Вас, це залежить від способу розгортання вашого додатку, Ваш провайдер може зробити це для Вас, або Вам потрібно налаштувати його самостійно. У більшості випадків ви (і вам слід) матимете «termination proxy», який обробляє HTTPS для вас зверху; це залежатиме від того, як ви розгортаєте ваш застосунок: ваш провайдер може зробити це за вас, або вам може знадобитися налаштувати це самостійно.
/// tip /// tip | Порада
Ви можете дізнатись більше про це у [документації про розгортування](deployment/index.md){.internal-link target=_blank}. Ви можете дізнатися більше про це в [документації з розгортання](deployment/index.md){.internal-link target=_blank}.
/// ///

138
docs/uk/docs/features.md

@ -1,21 +1,21 @@
# Функціональні можливості # Функціональні можливості { #features }
## Функціональні можливості FastAPI ## Функціональні можливості FastAPI { #fastapi-features }
**FastAPI** надає вам такі можливості: **FastAPI** надає вам такі можливості:
### Використання відкритих стандартів ### На основі відкритих стандартів { #based-on-open-standards }
* <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank"><strong>OpenAPI</strong></a> для створення API, включаючи оголошення <abbr title="також відомі як: endpoints, маршрути">шляхів</abbr>, <abbr title="також відомі як HTTP-методи, наприклад, POST, GET, PUT, DELETE">операцій</abbr>, параметрів, тіл запитів, безпеки тощо. * <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank"><strong>OpenAPI</strong></a> для створення API, включаючи оголошення <abbr title="також відомі як: endpoints, маршрути">шляхів</abbr>, <abbr title="також відомі як HTTP-методи, наприклад, POST, GET, PUT, DELETE">операцій</abbr>, параметрів, тіл запитів, безпеки тощо.
* Автоматична документація моделей даних за допомогою <a href="https://json-schema.org/" class="external-link" target="_blank"><strong>JSON Schema</strong></a> (оскільки OpenAPI базується саме на JSON Schema). * Автоматична документація моделей даних за допомогою <a href="https://json-schema.org/" class="external-link" target="_blank"><strong>JSON Schema</strong></a> (оскільки OpenAPI базується саме на JSON Schema).
* Розроблено на основі цих стандартів після ретельного аналізу, а не як додатковий рівень поверх основної архітектури. * Розроблено на основі цих стандартів після ретельного аналізу, а не як додатковий рівень поверх основної архітектури.
* Це також дає змогу автоматично **генерувати код клієнта** багатьма мовами. * Це також дає змогу використовувати автоматичну **генерацію клієнтського коду** багатьма мовами.
### Автоматична генерація документації ### Автоматична документація { #automatic-docs }
Інтерактивна документація API та вебінтерфейс для його дослідження. Оскільки фреймворк базується на OpenAPI, є кілька варіантів, два з яких включені за замовчуванням. Інтерактивна документація API та вебінтерфейси для його дослідження. Оскільки фреймворк базується на OpenAPI, є кілька варіантів, 2 з яких включені за замовчуванням.
* <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank"><strong>Swagger UI</strong></a>дозволяє інтерактивно переглядати API, викликати та тестувати його прямо у браузері. * <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank"><strong>Swagger UI</strong></a>з інтерактивним дослідженням, викликом і тестуванням вашого API прямо з браузера.
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png) ![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
@ -23,23 +23,25 @@
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png) ![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### Тільки сучасний Python ### Лише сучасний Python { #just-modern-python }
FastAPI використовує стандартні **типи Python** (завдяки Pydantic). Вам не потрібно вивчати новий синтаксис — лише стандартний сучасний Python. Усе базується на стандартних оголошеннях **типів Python** (завдяки Pydantic). Жодного нового синтаксису для вивчення. Лише стандартний сучасний Python.
Якщо вам потрібне коротке нагадування про використання типів у Python (навіть якщо ви не використовуєте FastAPI), перегляньте короткий підручник: [Вступ до типів Python](python-types.md){.internal-link target=_blank}. Якщо вам потрібно 2-хвилинне нагадування про те, як використовувати типи Python (навіть якщо ви не використовуєте FastAPI), перегляньте короткий підручник: [Типи Python](python-types.md){.internal-link target=_blank}.
Ось приклад стандартного Python-коду з типами: Ви пишете стандартний Python з типами:
```Python ```Python
from datetime import date from datetime import date
from pydantic import BaseModel from pydantic import BaseModel
# Оголошення змінної як str # Оголосіть змінну як str
# з підтримкою автодоповнення у редакторі # та отримайте підтримку редактора всередині функції
def main(user_id: str): def main(user_id: str):
return user_id return user_id
# Модель Pydantic # Модель Pydantic
class User(BaseModel): class User(BaseModel):
id: int id: int
@ -47,7 +49,7 @@ class User(BaseModel):
joined: date joined: date
``` ```
Приклад використання цієї моделі: Далі це можна використовувати так:
```Python ```Python
my_user: User = User(id=3, name="John Doe", joined="2018-07-19") my_user: User = User(id=3, name="John Doe", joined="2018-07-19")
@ -65,19 +67,21 @@ my_second_user: User = User(**second_user_data)
`**second_user_data` означає: `**second_user_data` означає:
Передати ключі та значення словника `second_user_data` як аргументи у вигляді "ключ-значення", еквівалентно `User(id=4, name="Mary", joined="2018-11-30")`. Передати ключі та значення словника `second_user_data` безпосередньо як аргументи у вигляді «ключ-значення», еквівалентно: `User(id=4, name="Mary", joined="2018-11-30")`
/// ///
### Підтримка редакторів (IDE) ### Підтримка редакторів (IDE) { #editor-support }
Фреймворк спроєктований так, щоб бути легким і інтуїтивно зрозумілим. Усі рішення тестувалися у різних редакторах ще до початку розробки, щоб забезпечити найкращий досвід програмування. Увесь фреймворк спроєктовано так, щоб ним було легко та інтуїтивно користуватися; усі рішення тестувалися у кількох редакторах ще до початку розробки, щоб забезпечити найкращий досвід розробки.
За результатами опитувань розробників Python <a href="https://www.jetbrains.com/research/python-developers-survey-2017/#tools-and-features" class="external-link" target="_blank">однією з найпопулярніших функцій є "автодоповнення"</a>. З опитувань розробників Python зрозуміло <a href="https://www.jetbrains.com/research/python-developers-survey-2017/#tools-and-features" class="external-link" target="_blank">що однією з найуживаніших функцій є «автодоповнення»</a>.
**FastAPI** повністю підтримує автодоповнення у всіх місцях, тому вам рідко доведеться повертатися до документації. Увесь фреймворк **FastAPI** побудований так, щоб це забезпечити. Автодоповнення працює всюди.
Приклад автодоповнення у редакторах: Вам рідко доведеться повертатися до документації.
Ось як ваш редактор може вам допомогти:
* у <a href="https://code.visualstudio.com/" class="external-link" target="_blank">Visual Studio Code</a>: * у <a href="https://code.visualstudio.com/" class="external-link" target="_blank">Visual Studio Code</a>:
@ -87,17 +91,25 @@ my_second_user: User = User(**second_user_data)
![editor support](https://fastapi.tiangolo.com/img/pycharm-completion.png) ![editor support](https://fastapi.tiangolo.com/img/pycharm-completion.png)
### Короткий код Ви отримаєте автодоповнення в коді, який раніше могли вважати навіть неможливим. Наприклад, для ключа `price` всередині JSON body (який міг бути вкладеним), що надходить із запиту.
FastAPI має розумні налаштування **за замовчуванням**, але всі параметри можна налаштовувати відповідно до ваших потреб. Однак за замовчуванням все "просто працює".
Більше не доведеться вводити неправильні назви ключів, постійно повертатися до документації або прокручувати вгору-вниз, щоб знайти, чи ви зрештою використали `username` чи `user_name`.
### Короткий код { #short }
FastAPI має розумні **налаштування за замовчуванням** для всього, з можливістю конфігурації всюди. Усі параметри можна точно налаштувати під ваші потреби та визначити потрібний вам API.
Але за замовчуванням усе **«просто працює»**.
### Валідація { #validation }
### Валідація
* Підтримка валідації для більшості (або всіх?) **типів даних Python**, зокрема: * Підтримка валідації для більшості (або всіх?) **типів даних Python**, зокрема:
* JSON-об'єктів (`dict`). * JSON-об'єктів (`dict`).
* JSON-списків (`list`) з визначенням типів елементів. * JSON-масивів (`list`) із визначенням типів елементів.
* Рядків (`str`) із мінімальною та максимальною довжиною. * Полів-рядків (`str`) із визначенням мінімальної та максимальної довжини.
* Чисел (`int`, `float`) з обмеженнями мінімальних та максимальних значень тощо. * Чисел (`int`, `float`) з мінімальними та максимальними значеннями тощо.
* Валідація складніших типів, таких як: * Валідація для більш екзотичних типів, як-от:
* URL. * URL.
* Email. * Email.
* UUID. * UUID.
@ -105,55 +117,55 @@ FastAPI має розумні налаштування **за замовчува
Уся валідація виконується через надійний та перевірений **Pydantic**. Уся валідація виконується через надійний та перевірений **Pydantic**.
### Безпека та автентифікація ### Безпека та автентифікація { #security-and-authentication }
**FastAPI** підтримує вбудовану автентифікацію та авторизацію, без прив’язки до конкретних баз даних чи моделей даних. Інтегровані безпека та автентифікація. Без жодних компромісів із базами даних чи моделями даних.
Підтримуються всі схеми безпеки OpenAPI, включаючи: Підтримуються всі схеми безпеки, визначені в OpenAPI, включно з:
* HTTP Basic. * HTTP Basic.
* **OAuth2** (також із підтримкою **JWT-токенів**). Див. підручник: [OAuth2 із JWT](tutorial/security/oauth2-jwt.md){.internal-link target=_blank}. * **OAuth2** (також із підтримкою **JWT tokens**). Перегляньте підручник: [OAuth2 із JWT](tutorial/security/oauth2-jwt.md){.internal-link target=_blank}.
* Ключі API в: * Ключі API в:
* Заголовках. * Заголовках.
* Параметрах запиту. * Параметрах запиту.
* Cookies тощо. * Cookies тощо.
А також усі можливості безпеки від Starlette (зокрема **сесійні cookies**). А також усі можливості безпеки від Starlette (зокрема **session cookies**).
Усі вони створені як багаторазові інструменти та компоненти, які легко інтегруються з вашими системами, сховищами даних, реляційними та NoSQL базами даних тощо. Усе це зроблено як багаторазові інструменти та компоненти, які легко інтегруються з вашими системами, сховищами даних, реляційними та NoSQL базами даних тощо.
### Впровадження залежностей ### Впровадження залежностей { #dependency-injection }
**FastAPI** містить надзвичайно просту у використанні, але потужну систему впровадження залежностей. FastAPI містить надзвичайно просту у використанні, але надзвичайно потужну систему <abbr title='також відоме як: "components", "resources", "services", "providers"'><strong>Dependency Injection</strong></abbr>.
* Залежності можуть мати власні залежності, утворюючи ієрархію або **"граф залежностей"**. * Навіть залежності можуть мати власні залежності, утворюючи ієрархію або **«граф» залежностей**.
* Усі залежності автоматично керуються фреймворком. * Усе **автоматично обробляється** фреймворком.
* Усі залежності можуть отримувати дані з запитів і розширювати **обмеження операції за шляхом** та автоматичну документацію. * Усі залежності можуть вимагати дані із запитів і **розширювати обмеження операції шляху** та автоматичну документацію.
* **Автоматична валідація** навіть для параметрів *операцій шляху*, визначених у залежностях. * **Автоматична валідація** навіть для параметрів *операції шляху*, визначених у залежностях.
* Підтримка складних систем автентифікації користувачів, **з'єднань із базами даних** тощо. * Підтримка складних систем автентифікації користувачів, **підключень до баз даних** тощо.
* **Жодних обмежень** щодо використання баз даних, фронтендів тощо, але водночас проста інтеграція з усіма ними. * **Жодних компромісів** із базами даних, фронтендами тощо. Але проста інтеграція з усіма ними.
### Немає обмежень на "плагіни" ### Необмежені «плагіни» { #unlimited-plug-ins }
Або іншими словами, вони не потрібні – просто імпортуйте та використовуйте необхідний код. Інакше кажучи, вони не потрібні — імпортуйте та використовуйте код, який вам потрібен.
Будь-яка інтеграція спроєктована настільки просто (з використанням залежностей), що ви можете створити "плагін" для свого застосунку всього у 2 рядках коду, використовуючи ту саму структуру та синтаксис, що й для ваших *операцій шляху*. Будь-яка інтеграція спроєктована так, щоб її було дуже просто використовувати (із залежностями), тож ви можете створити «плагін» для свого застосунку у 2 рядках коду, використовуючи ту саму структуру та синтаксис, що й для ваших *операцій шляху*.
### Протестовано ### Протестовано { #tested }
* 100% <abbr title="Обсяг коду, що автоматично тестується">покриття тестами</abbr>. * 100% <abbr title="Обсяг коду, що автоматично тестується">покриття тестами</abbr>.
* 100% <abbr title="Анотації типів у Python, завдяки яким ваш редактор і зовнішні інструменти можуть надавати кращу підтримку">анотована типами</abbr> кодова база. * 100% <abbr title="Анотації типів у Python, завдяки яким ваш редактор і зовнішні інструменти можуть надавати кращу підтримку">анотована типами</abbr> кодова база.
* Використовується у робочих середовищах. * Використовується в production-застосунках.
## Можливості Starlette ## Можливості Starlette { #starlette-features }
**FastAPI** повністю сумісний із (та побудований на основі) <a href="https://www.starlette.dev/" class="external-link" target="_blank"><strong>Starlette</strong></a>. Тому будь-який додатковий код Starlette, який ви маєте, також працюватиме. **FastAPI** повністю сумісний із (та побудований на основі) <a href="https://www.starlette.dev/" class="external-link" target="_blank"><strong>Starlette</strong></a>. Тому будь-який додатковий код Starlette, який ви маєте, також працюватиме.
**FastAPI** фактично є підкласом **Starlette**. Тому, якщо ви вже знайомі зі Starlette або використовуєте його, більшість функціональності працюватиме так само. `FastAPI` фактично є підкласом `Starlette`. Тому, якщо ви вже знайомі зі Starlette або використовуєте його, більшість функціональності працюватиме так само.
З **FastAPI** ви отримуєте всі можливості **Starlette** (адже FastAPI — це, по суті, Starlette на стероїдах): З **FastAPI** ви отримуєте всі можливості **Starlette** (адже FastAPI — це просто Starlette на стероїдах):
* Разюча продуктивність. Це <a href="https://github.com/encode/starlette#performance" class="external-link" target="_blank">один із найшвидших фреймворків на Python</a>, на рівні з **NodeJS** і **Go**. * Разюча продуктивність. Це <a href="https://github.com/encode/starlette#performance" class="external-link" target="_blank">один із найшвидших доступних Python-фреймворків, на рівні з **NodeJS** і **Go**</a>.
* Підтримка **WebSocket**. * Підтримка **WebSocket**.
* Фонові задачі у процесі. * Фонові задачі у процесі.
* Події запуску та завершення роботи. * Події запуску та завершення роботи.
@ -163,27 +175,27 @@ FastAPI має розумні налаштування **за замовчува
* 100% покриття тестами. * 100% покриття тестами.
* 100% анотована типами кодова база. * 100% анотована типами кодова база.
## Можливості Pydantic ## Можливості Pydantic { #pydantic-features }
**FastAPI** повністю сумісний із (та побудований на основі) <a href="https://docs.pydantic.dev/" class="external-link" target="_blank"><strong>Pydantic</strong></a>. Тому будь-який додатковий код Pydantic, який ви маєте, також працюватиме. **FastAPI** повністю сумісний із (та побудований на основі) <a href="https://docs.pydantic.dev/" class="external-link" target="_blank"><strong>Pydantic</strong></a>. Тому будь-який додатковий код Pydantic, який ви маєте, також працюватиме.
Включаючи зовнішні бібліотеки, побудовані також на Pydantic, такі як <abbr title="Object-Relational Mapper">ORM</abbr>, <abbr title="Object-Document Mapper">ODM</abbr> для баз даних. Включно із зовнішніми бібліотеками, які також базуються на Pydantic, як-от <abbr title="Object-Relational Mapper - Об'єктно-реляційний відображувач">ORM</abbr>, <abbr title="Object-Document Mapper - Об'єктно-документний відображувач">ODM</abbr> для баз даних.
Це також означає, що в багатьох випадках ви можете передати той самий об'єкт, який отримуєте з запиту, **безпосередньо в базу даних**, оскільки все автоматично перевіряється. Це також означає, що в багатьох випадках ви можете передати той самий об'єкт, який отримуєте із запиту, **безпосередньо в базу даних**, оскільки все автоматично перевіряється.
Те ж саме відбувається й у зворотному напрямку — у багатьох випадках ви можете просто передати об'єкт, який отримуєте з бази даних, **безпосередньо клієнту**. Те саме застосовується й у зворотному напрямку — у багатьох випадках ви можете просто передати об'єкт, який отримуєте з бази даних, **безпосередньо клієнту**.
З **FastAPI** ви отримуєте всі можливості **Pydantic** (адже FastAPI базується на Pydantic для обробки всіх даних): З **FastAPI** ви отримуєте всі можливості **Pydantic** (адже FastAPI базується на Pydantic для обробки всіх даних):
* **Ніякої плутанини** : * **Ніякої плутанини**:
* Не потрібно вчити нову мову для визначення схем. * Не потрібно вчити нову мікромову для визначення схем.
* Якщо ви знаєте типи Python, ви знаєте, як використовувати Pydantic. * Якщо ви знаєте типи Python, ви знаєте, як використовувати Pydantic.
* Легко працює з вашим **<abbr title="Інтегроване середовище розробки, схоже на редактор коду">IDE</abbr>/<abbr title="Програма, яка перевіряє помилки в коді">лінтером</abbr>/мозком**: * Легко працює з вашим **<abbr title="Integrated Development Environment - Інтегроване середовище розробки: схоже на код-редактор">IDE</abbr>/<abbr title="Програма, що перевіряє код на помилки">linter</abbr>/мозком**:
* Оскільки структури даних Pydantic є просто екземплярами класів, які ви визначаєте; автодоповнення, лінтинг, mypy і ваша інтуїція повинні добре працювати з вашими перевіреними даними. * Оскільки структури даних pydantic є просто екземплярами класів, які ви визначаєте; автодоповнення, лінтинг, mypy і ваша інтуїція повинні добре працювати з вашими перевіреними даними.
* Валідація **складних структур**: * Валідує **складні структури**:
* Використання ієрархічних моделей Pydantic. Python `typing`, `List` і `Dict` тощо. * Використання ієрархічних моделей Pydantic, Python `typing`’s `List` і `Dict` тощо.
* Валідатори дозволяють чітко і просто визначати, перевіряти й документувати складні схеми даних у вигляді JSON-схеми. * Валідатори дають змогу складні схеми даних чітко й просто визначати, перевіряти й документувати як JSON Schema.
* Ви можете мати глибоко **вкладені JSON об'єкти** та перевірити та анотувати їх всі. * Ви можете мати глибоко **вкладені JSON** об'єкти, і всі вони будуть валідовані та анотовані.
* **Розширюваність**: * **Розширюваність**:
* Pydantic дозволяє визначати користувацькі типи даних або розширювати валідацію методами в моделі декоратором `validator`. * Pydantic дозволяє визначати користувацькі типи даних або ви можете розширити валідацію методами в моделі, позначеними декоратором validator.
* 100% покриття тестами. * 100% покриття тестами.

4
docs_src/app_testing/app_b_an_py310/main.py

@ -28,8 +28,8 @@ async def read_main(item_id: str, x_token: Annotated[str, Header()]):
return fake_db[item_id] return fake_db[item_id]
@app.post("/items/", response_model=Item) @app.post("/items/")
async def create_item(item: Item, x_token: Annotated[str, Header()]): async def create_item(item: Item, x_token: Annotated[str, Header()]) -> Item:
if x_token != fake_secret_token: if x_token != fake_secret_token:
raise HTTPException(status_code=400, detail="Invalid X-Token header") raise HTTPException(status_code=400, detail="Invalid X-Token header")
if item.id in fake_db: if item.id in fake_db:

4
docs_src/app_testing/app_b_an_py39/main.py

@ -28,8 +28,8 @@ async def read_main(item_id: str, x_token: Annotated[str, Header()]):
return fake_db[item_id] return fake_db[item_id]
@app.post("/items/", response_model=Item) @app.post("/items/")
async def create_item(item: Item, x_token: Annotated[str, Header()]): async def create_item(item: Item, x_token: Annotated[str, Header()]) -> Item:
if x_token != fake_secret_token: if x_token != fake_secret_token:
raise HTTPException(status_code=400, detail="Invalid X-Token header") raise HTTPException(status_code=400, detail="Invalid X-Token header")
if item.id in fake_db: if item.id in fake_db:

4
docs_src/app_testing/app_b_py310/main.py

@ -26,8 +26,8 @@ async def read_main(item_id: str, x_token: str = Header()):
return fake_db[item_id] return fake_db[item_id]
@app.post("/items/", response_model=Item) @app.post("/items/")
async def create_item(item: Item, x_token: str = Header()): async def create_item(item: Item, x_token: str = Header()) -> Item:
if x_token != fake_secret_token: if x_token != fake_secret_token:
raise HTTPException(status_code=400, detail="Invalid X-Token header") raise HTTPException(status_code=400, detail="Invalid X-Token header")
if item.id in fake_db: if item.id in fake_db:

4
docs_src/app_testing/app_b_py39/main.py

@ -28,8 +28,8 @@ async def read_main(item_id: str, x_token: str = Header()):
return fake_db[item_id] return fake_db[item_id]
@app.post("/items/", response_model=Item) @app.post("/items/")
async def create_item(item: Item, x_token: str = Header()): async def create_item(item: Item, x_token: str = Header()) -> Item:
if x_token != fake_secret_token: if x_token != fake_secret_token:
raise HTTPException(status_code=400, detail="Invalid X-Token header") raise HTTPException(status_code=400, detail="Invalid X-Token header")
if item.id in fake_db: if item.id in fake_db:

4
docs_src/body_updates/tutorial002_py310.py

@ -25,8 +25,8 @@ async def read_item(item_id: str):
return items[item_id] return items[item_id]
@app.patch("/items/{item_id}", response_model=Item) @app.patch("/items/{item_id}")
async def update_item(item_id: str, item: Item): async def update_item(item_id: str, item: Item) -> Item:
stored_item_data = items[item_id] stored_item_data = items[item_id]
stored_item_model = Item(**stored_item_data) stored_item_model = Item(**stored_item_data)
update_data = item.model_dump(exclude_unset=True) update_data = item.model_dump(exclude_unset=True)

4
docs_src/body_updates/tutorial002_py39.py

@ -27,8 +27,8 @@ async def read_item(item_id: str):
return items[item_id] return items[item_id]
@app.patch("/items/{item_id}", response_model=Item) @app.patch("/items/{item_id}")
async def update_item(item_id: str, item: Item): async def update_item(item_id: str, item: Item) -> Item:
stored_item_data = items[item_id] stored_item_data = items[item_id]
stored_item_model = Item(**stored_item_data) stored_item_model = Item(**stored_item_data)
update_data = item.model_dump(exclude_unset=True) update_data = item.model_dump(exclude_unset=True)

2
docs_src/metadata/tutorial001_1_py39.py

@ -28,7 +28,7 @@ app = FastAPI(
}, },
license_info={ license_info={
"name": "Apache 2.0", "name": "Apache 2.0",
"identifier": "MIT", "identifier": "Apache-2.0",
}, },
) )

4
docs_src/path_operation_advanced_configuration/tutorial004_py310.py

@ -12,8 +12,8 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, summary="Create an item") @app.post("/items/", summary="Create an item")
async def create_item(item: Item): async def create_item(item: Item) -> Item:
""" """
Create an item with all the information: Create an item with all the information:

4
docs_src/path_operation_advanced_configuration/tutorial004_py39.py

@ -14,8 +14,8 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, summary="Create an item") @app.post("/items/", summary="Create an item")
async def create_item(item: Item): async def create_item(item: Item) -> Item:
""" """
Create an item with all the information: Create an item with all the information:

4
docs_src/path_operation_configuration/tutorial001_py310.py

@ -12,6 +12,6 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, status_code=status.HTTP_201_CREATED) @app.post("/items/", status_code=status.HTTP_201_CREATED)
async def create_item(item: Item): async def create_item(item: Item) -> Item:
return item return item

4
docs_src/path_operation_configuration/tutorial001_py39.py

@ -14,6 +14,6 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, status_code=status.HTTP_201_CREATED) @app.post("/items/", status_code=status.HTTP_201_CREATED)
async def create_item(item: Item): async def create_item(item: Item) -> Item:
return item return item

4
docs_src/path_operation_configuration/tutorial002_py310.py

@ -12,8 +12,8 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, tags=["items"]) @app.post("/items/", tags=["items"])
async def create_item(item: Item): async def create_item(item: Item) -> Item:
return item return item

4
docs_src/path_operation_configuration/tutorial002_py39.py

@ -14,8 +14,8 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, tags=["items"]) @app.post("/items/", tags=["items"])
async def create_item(item: Item): async def create_item(item: Item) -> Item:
return item return item

3
docs_src/path_operation_configuration/tutorial003_py310.py

@ -14,9 +14,8 @@ class Item(BaseModel):
@app.post( @app.post(
"/items/", "/items/",
response_model=Item,
summary="Create an item", summary="Create an item",
description="Create an item with all the information, name, description, price, tax and a set of unique tags", description="Create an item with all the information, name, description, price, tax and a set of unique tags",
) )
async def create_item(item: Item): async def create_item(item: Item) -> Item:
return item return item

3
docs_src/path_operation_configuration/tutorial003_py39.py

@ -16,9 +16,8 @@ class Item(BaseModel):
@app.post( @app.post(
"/items/", "/items/",
response_model=Item,
summary="Create an item", summary="Create an item",
description="Create an item with all the information, name, description, price, tax and a set of unique tags", description="Create an item with all the information, name, description, price, tax and a set of unique tags",
) )
async def create_item(item: Item): async def create_item(item: Item) -> Item:
return item return item

4
docs_src/path_operation_configuration/tutorial004_py310.py

@ -12,8 +12,8 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, summary="Create an item") @app.post("/items/", summary="Create an item")
async def create_item(item: Item): async def create_item(item: Item) -> Item:
""" """
Create an item with all the information: Create an item with all the information:

4
docs_src/path_operation_configuration/tutorial004_py39.py

@ -14,8 +14,8 @@ class Item(BaseModel):
tags: set[str] = set() tags: set[str] = set()
@app.post("/items/", response_model=Item, summary="Create an item") @app.post("/items/", summary="Create an item")
async def create_item(item: Item): async def create_item(item: Item) -> Item:
""" """
Create an item with all the information: Create an item with all the information:

3
docs_src/path_operation_configuration/tutorial005_py310.py

@ -14,11 +14,10 @@ class Item(BaseModel):
@app.post( @app.post(
"/items/", "/items/",
response_model=Item,
summary="Create an item", summary="Create an item",
response_description="The created item", response_description="The created item",
) )
async def create_item(item: Item): async def create_item(item: Item) -> Item:
""" """
Create an item with all the information: Create an item with all the information:

3
docs_src/path_operation_configuration/tutorial005_py39.py

@ -16,11 +16,10 @@ class Item(BaseModel):
@app.post( @app.post(
"/items/", "/items/",
response_model=Item,
summary="Create an item", summary="Create an item",
response_description="The created item", response_description="The created item",
) )
async def create_item(item: Item): async def create_item(item: Item) -> Item:
""" """
Create an item with all the information: Create an item with all the information:

4
docs_src/security/tutorial004_an_py310.py

@ -133,10 +133,10 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me( async def read_users_me(
current_user: Annotated[User, Depends(get_current_active_user)], current_user: Annotated[User, Depends(get_current_active_user)],
): ) -> User:
return current_user return current_user

4
docs_src/security/tutorial004_an_py39.py

@ -133,10 +133,10 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me( async def read_users_me(
current_user: Annotated[User, Depends(get_current_active_user)], current_user: Annotated[User, Depends(get_current_active_user)],
): ) -> User:
return current_user return current_user

4
docs_src/security/tutorial004_py310.py

@ -130,8 +130,8 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me(current_user: User = Depends(get_current_active_user)): async def read_users_me(current_user: User = Depends(get_current_active_user)) -> User:
return current_user return current_user

4
docs_src/security/tutorial004_py39.py

@ -131,8 +131,8 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me(current_user: User = Depends(get_current_active_user)): async def read_users_me(current_user: User = Depends(get_current_active_user)) -> User:
return current_user return current_user

4
docs_src/security/tutorial005_an_py310.py

@ -160,10 +160,10 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me( async def read_users_me(
current_user: Annotated[User, Depends(get_current_active_user)], current_user: Annotated[User, Depends(get_current_active_user)],
): ) -> User:
return current_user return current_user

4
docs_src/security/tutorial005_an_py39.py

@ -160,10 +160,10 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me( async def read_users_me(
current_user: Annotated[User, Depends(get_current_active_user)], current_user: Annotated[User, Depends(get_current_active_user)],
): ) -> User:
return current_user return current_user

4
docs_src/security/tutorial005_py310.py

@ -159,8 +159,8 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me(current_user: User = Depends(get_current_active_user)): async def read_users_me(current_user: User = Depends(get_current_active_user)) -> User:
return current_user return current_user

4
docs_src/security/tutorial005_py39.py

@ -160,8 +160,8 @@ async def login_for_access_token(
return Token(access_token=access_token, token_type="bearer") return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User) @app.get("/users/me/")
async def read_users_me(current_user: User = Depends(get_current_active_user)): async def read_users_me(current_user: User = Depends(get_current_active_user)) -> User:
return current_user return current_user

2
docs_src/wsgi/tutorial001_py39.py

@ -1,5 +1,5 @@
from a2wsgi import WSGIMiddleware
from fastapi import FastAPI from fastapi import FastAPI
from fastapi.middleware.wsgi import WSGIMiddleware
from flask import Flask, request from flask import Flask, request
from markupsafe import escape from markupsafe import escape

4
fastapi/_compat/shared.py

@ -17,7 +17,7 @@ from pydantic.version import VERSION as PYDANTIC_VERSION
from starlette.datastructures import UploadFile from starlette.datastructures import UploadFile
from typing_extensions import get_args, get_origin from typing_extensions import get_args, get_origin
# Copy from Pydantic v2, compatible with v1 # Copy from Pydantic: pydantic/_internal/_typing_extra.py
if sys.version_info < (3, 10): if sys.version_info < (3, 10):
WithArgsTypes: tuple[Any, ...] = (typing._GenericAlias, types.GenericAlias) # type: ignore[attr-defined] WithArgsTypes: tuple[Any, ...] = (typing._GenericAlias, types.GenericAlias) # type: ignore[attr-defined]
else: else:
@ -45,7 +45,7 @@ sequence_types = tuple(sequence_annotation_to_type.keys())
Url: type[Any] Url: type[Any]
# Copy of Pydantic v2, compatible with v1 # Copy of Pydantic: pydantic/_internal/_utils.py
def lenient_issubclass( def lenient_issubclass(
cls: Any, class_or_tuple: Union[type[Any], tuple[type[Any], ...], None] cls: Any, class_or_tuple: Union[type[Any], tuple[type[Any], ...], None]
) -> bool: ) -> bool:

8
fastapi/_compat/v2.py

@ -490,7 +490,7 @@ def get_model_fields(model: type[BaseModel]) -> list[ModelField]:
@lru_cache @lru_cache
def get_cached_model_fields(model: type[BaseModel]) -> list[ModelField]: def get_cached_model_fields(model: type[BaseModel]) -> list[ModelField]:
return get_model_fields(model) # type: ignore[return-value] return get_model_fields(model)
# Duplicate of several schema functions from Pydantic v1 to make them compatible with # Duplicate of several schema functions from Pydantic v1 to make them compatible with
@ -513,13 +513,13 @@ def get_model_name_map(unique_models: TypeModelSet) -> dict[TypeModelOrEnum, str
def get_compat_model_name_map(fields: list[ModelField]) -> ModelNameMap: def get_compat_model_name_map(fields: list[ModelField]) -> ModelNameMap:
all_flat_models = set() all_flat_models: TypeModelSet = set()
v2_model_fields = [field for field in fields if isinstance(field, ModelField)] v2_model_fields = [field for field in fields if isinstance(field, ModelField)]
v2_flat_models = get_flat_models_from_fields(v2_model_fields, known_models=set()) v2_flat_models = get_flat_models_from_fields(v2_model_fields, known_models=set())
all_flat_models = all_flat_models.union(v2_flat_models) # type: ignore[arg-type] all_flat_models = all_flat_models.union(v2_flat_models)
model_name_map = get_model_name_map(all_flat_models) # type: ignore[arg-type] model_name_map = get_model_name_map(all_flat_models)
return model_name_map return model_name_map

7
fastapi/applications.py

@ -672,7 +672,7 @@ class FastAPI(Starlette):
in the autogenerated OpenAPI using the `root_path`. in the autogenerated OpenAPI using the `root_path`.
Read more about it in the Read more about it in the
[FastAPI docs for Behind a Proxy](https://fastapi.tiangolo.com/advanced/behind-a-proxy/#disable-automatic-server-from-root_path). [FastAPI docs for Behind a Proxy](https://fastapi.tiangolo.com/advanced/behind-a-proxy/#disable-automatic-server-from-root-path).
**Example** **Example**
@ -739,7 +739,7 @@ class FastAPI(Starlette):
It will be added to the generated OpenAPI (e.g. visible at `/docs`). It will be added to the generated OpenAPI (e.g. visible at `/docs`).
Read more about it in the Read more about it in the
[FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/). [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/#deprecate-a-path-operation).
""" """
), ),
] = None, ] = None,
@ -812,6 +812,9 @@ class FastAPI(Starlette):
In this case, there would be two different schemas, one for input and In this case, there would be two different schemas, one for input and
another one for output. another one for output.
Read more about it in the
[FastAPI docs about how to separate schemas for input and output](https://fastapi.tiangolo.com/how-to/separate-openapi-schemas)
""" """
), ),
] = True, ] = True,

6
fastapi/dependencies/utils.py

@ -404,7 +404,7 @@ def analyze_param(
if isinstance(fastapi_annotation, FieldInfo): if isinstance(fastapi_annotation, FieldInfo):
# Copy `field_info` because we mutate `field_info.default` below. # Copy `field_info` because we mutate `field_info.default` below.
field_info = copy_field_info( field_info = copy_field_info(
field_info=fastapi_annotation, # type: ignore[arg-type] field_info=fastapi_annotation,
annotation=use_annotation, annotation=use_annotation,
) )
assert ( assert (
@ -438,7 +438,7 @@ def analyze_param(
"Cannot specify FastAPI annotations in `Annotated` and default value" "Cannot specify FastAPI annotations in `Annotated` and default value"
f" together for {param_name!r}" f" together for {param_name!r}"
) )
field_info = value # type: ignore[assignment] field_info = value
if isinstance(field_info, FieldInfo): if isinstance(field_info, FieldInfo):
field_info.annotation = type_annotation field_info.annotation = type_annotation
@ -537,7 +537,7 @@ def analyze_param(
# For Pydantic v1 # For Pydantic v1
and getattr(field, "shape", 1) == 1 and getattr(field, "shape", 1) == 1
) )
) ), f"Query parameter {param_name!r} must be one of the supported types"
return ParamDetails(type_annotation=type_annotation, depends=depends, field=field) return ParamDetails(type_annotation=type_annotation, depends=depends, field=field)

10
fastapi/exceptions.py

@ -49,6 +49,9 @@ class HTTPException(StarletteHTTPException):
Doc( Doc(
""" """
HTTP status code to send to the client. HTTP status code to send to the client.
Read more about it in the
[FastAPI docs for Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/#use-httpexception)
""" """
), ),
], ],
@ -58,6 +61,9 @@ class HTTPException(StarletteHTTPException):
""" """
Any data to be sent to the client in the `detail` key of the JSON Any data to be sent to the client in the `detail` key of the JSON
response. response.
Read more about it in the
[FastAPI docs for Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/#use-httpexception)
""" """
), ),
] = None, ] = None,
@ -66,6 +72,10 @@ class HTTPException(StarletteHTTPException):
Doc( Doc(
""" """
Any headers to send to the client in the response. Any headers to send to the client in the response.
Read more about it in the
[FastAPI docs for Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/#add-custom-headers)
""" """
), ),
] = None, ] = None,

4
fastapi/middleware/wsgi.py

@ -1 +1,3 @@
from starlette.middleware.wsgi import WSGIMiddleware as WSGIMiddleware # noqa from starlette.middleware.wsgi import (
WSGIMiddleware as WSGIMiddleware,
) # pragma: no cover # noqa

30
fastapi/openapi/docs.py

@ -33,6 +33,9 @@ def get_swagger_ui_html(
This is normally done automatically by FastAPI using the default URL This is normally done automatically by FastAPI using the default URL
`/openapi.json`. `/openapi.json`.
Read more about it in the
[FastAPI docs for Conditional OpenAPI](https://fastapi.tiangolo.com/how-to/conditional-openapi/#conditional-openapi-from-settings-and-env-vars)
""" """
), ),
], ],
@ -41,6 +44,9 @@ def get_swagger_ui_html(
Doc( Doc(
""" """
The HTML `<title>` content, normally shown in the browser tab. The HTML `<title>` content, normally shown in the browser tab.
Read more about it in the
[FastAPI docs for Custom Docs UI Static Assets](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/)
""" """
), ),
], ],
@ -51,6 +57,9 @@ def get_swagger_ui_html(
The URL to use to load the Swagger UI JavaScript. The URL to use to load the Swagger UI JavaScript.
It is normally set to a CDN URL. It is normally set to a CDN URL.
Read more about it in the
[FastAPI docs for Custom Docs UI Static Assets](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/)
""" """
), ),
] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js", ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js",
@ -61,6 +70,9 @@ def get_swagger_ui_html(
The URL to use to load the Swagger UI CSS. The URL to use to load the Swagger UI CSS.
It is normally set to a CDN URL. It is normally set to a CDN URL.
Read more about it in the
[FastAPI docs for Custom Docs UI Static Assets](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/)
""" """
), ),
] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css", ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css",
@ -77,6 +89,9 @@ def get_swagger_ui_html(
Doc( Doc(
""" """
The OAuth2 redirect URL, it is normally automatically handled by FastAPI. The OAuth2 redirect URL, it is normally automatically handled by FastAPI.
Read more about it in the
[FastAPI docs for Custom Docs UI Static Assets](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/)
""" """
), ),
] = None, ] = None,
@ -85,6 +100,9 @@ def get_swagger_ui_html(
Doc( Doc(
""" """
A dictionary with Swagger UI OAuth2 initialization configurations. A dictionary with Swagger UI OAuth2 initialization configurations.
Read more about the available configuration options in the
[Swagger UI docs](https://swagger.io/docs/open-source-tools/swagger-ui/usage/oauth2/).
""" """
), ),
] = None, ] = None,
@ -95,6 +113,9 @@ def get_swagger_ui_html(
Configuration parameters for Swagger UI. Configuration parameters for Swagger UI.
It defaults to [swagger_ui_default_parameters][fastapi.openapi.docs.swagger_ui_default_parameters]. It defaults to [swagger_ui_default_parameters][fastapi.openapi.docs.swagger_ui_default_parameters].
Read more about it in the
[FastAPI docs about how to Configure Swagger UI](https://fastapi.tiangolo.com/how-to/configure-swagger-ui/).
""" """
), ),
] = None, ] = None,
@ -168,6 +189,9 @@ def get_redoc_html(
This is normally done automatically by FastAPI using the default URL This is normally done automatically by FastAPI using the default URL
`/openapi.json`. `/openapi.json`.
Read more about it in the
[FastAPI docs for Conditional OpenAPI](https://fastapi.tiangolo.com/how-to/conditional-openapi/#conditional-openapi-from-settings-and-env-vars)
""" """
), ),
], ],
@ -176,6 +200,9 @@ def get_redoc_html(
Doc( Doc(
""" """
The HTML `<title>` content, normally shown in the browser tab. The HTML `<title>` content, normally shown in the browser tab.
Read more about it in the
[FastAPI docs for Custom Docs UI Static Assets](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/)
""" """
), ),
], ],
@ -186,6 +213,9 @@ def get_redoc_html(
The URL to use to load the ReDoc JavaScript. The URL to use to load the ReDoc JavaScript.
It is normally set to a CDN URL. It is normally set to a CDN URL.
Read more about it in the
[FastAPI docs for Custom Docs UI Static Assets](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/)
""" """
), ),
] = "https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js", ] = "https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js",

3
fastapi/openapi/utils.py

@ -1,3 +1,4 @@
import copy
import http.client import http.client
import inspect import inspect
import warnings import warnings
@ -377,7 +378,7 @@ def get_openapi_path(
additional_status_code, additional_status_code,
additional_response, additional_response,
) in route.responses.items(): ) in route.responses.items():
process_response = additional_response.copy() process_response = copy.deepcopy(additional_response)
process_response.pop("model", None) process_response.pop("model", None)
status_code_key = str(additional_status_code).upper() status_code_key = str(additional_status_code).upper()
if status_code_key == "DEFAULT": if status_code_key == "DEFAULT":

94
fastapi/param_functions.py

@ -79,6 +79,9 @@ def Path( # noqa: N802
Doc( Doc(
""" """
Human-readable title. Human-readable title.
Read more about it in the
[FastAPI docs for Path Parameters and Numeric Validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#declare-metadata)
""" """
), ),
] = None, ] = None,
@ -96,6 +99,9 @@ def Path( # noqa: N802
""" """
Greater than. If set, value must be greater than this. Only applicable to Greater than. If set, value must be greater than this. Only applicable to
numbers. numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -105,6 +111,9 @@ def Path( # noqa: N802
""" """
Greater than or equal. If set, value must be greater than or equal to Greater than or equal. If set, value must be greater than or equal to
this. Only applicable to numbers. this. Only applicable to numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -113,6 +122,9 @@ def Path( # noqa: N802
Doc( Doc(
""" """
Less than. If set, value must be less than this. Only applicable to numbers. Less than. If set, value must be less than this. Only applicable to numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -122,6 +134,9 @@ def Path( # noqa: N802
""" """
Less than or equal. If set, value must be less than or equal to this. Less than or equal. If set, value must be less than or equal to this.
Only applicable to numbers. Only applicable to numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -213,6 +228,9 @@ def Path( # noqa: N802
Doc( Doc(
""" """
Example values for this field. Example values for this field.
Read more about it in the
[FastAPI docs for Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/)
""" """
), ),
] = None, ] = None,
@ -343,6 +361,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
Default value if the parameter field is not set. Default value if the parameter field is not set.
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#alternative-old-query-as-the-default-value)
""" """
), ),
] = Undefined, ] = Undefined,
@ -367,6 +388,9 @@ def Query( # noqa: N802
This will be used to extract the data and for the generated OpenAPI. This will be used to extract the data and for the generated OpenAPI.
It is particularly useful when you can't use the name you want because it It is particularly useful when you can't use the name you want because it
is a Python reserved keyword or similar. is a Python reserved keyword or similar.
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#alias-parameters)
""" """
), ),
] = None, ] = None,
@ -402,6 +426,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
Human-readable title. Human-readable title.
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#declare-more-metadata)
""" """
), ),
] = None, ] = None,
@ -410,6 +437,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
Human-readable description. Human-readable description.
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#declare-more-metadata)
""" """
), ),
] = None, ] = None,
@ -419,6 +449,9 @@ def Query( # noqa: N802
""" """
Greater than. If set, value must be greater than this. Only applicable to Greater than. If set, value must be greater than this. Only applicable to
numbers. numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -428,6 +461,9 @@ def Query( # noqa: N802
""" """
Greater than or equal. If set, value must be greater than or equal to Greater than or equal. If set, value must be greater than or equal to
this. Only applicable to numbers. this. Only applicable to numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -436,6 +472,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
Less than. If set, value must be less than this. Only applicable to numbers. Less than. If set, value must be less than this. Only applicable to numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -445,6 +484,9 @@ def Query( # noqa: N802
""" """
Less than or equal. If set, value must be less than or equal to this. Less than or equal. If set, value must be less than or equal to this.
Only applicable to numbers. Only applicable to numbers.
Read more about it in the
[FastAPI docs about Path parameters numeric validations](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#number-validations-greater-than-and-less-than-or-equal)
""" """
), ),
] = None, ] = None,
@ -453,6 +495,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
Minimum length for strings. Minimum length for strings.
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/)
""" """
), ),
] = None, ] = None,
@ -461,6 +506,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
Maximum length for strings. Maximum length for strings.
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/)
""" """
), ),
] = None, ] = None,
@ -469,6 +517,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
RegEx pattern for strings. RegEx pattern for strings.
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#add-regular-expressions
""" """
), ),
] = None, ] = None,
@ -536,6 +587,9 @@ def Query( # noqa: N802
Doc( Doc(
""" """
Example values for this field. Example values for this field.
Read more about it in the
[FastAPI docs for Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/)
""" """
), ),
] = None, ] = None,
@ -570,6 +624,9 @@ def Query( # noqa: N802
Mark this parameter field as deprecated. Mark this parameter field as deprecated.
It will affect the generated OpenAPI (e.g. visible at `/docs`). It will affect the generated OpenAPI (e.g. visible at `/docs`).
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#deprecating-parameters)
""" """
), ),
] = None, ] = None,
@ -581,6 +638,9 @@ def Query( # noqa: N802
You probably don't need it, but it's available. You probably don't need it, but it's available.
This affects the generated OpenAPI (e.g. visible at `/docs`). This affects the generated OpenAPI (e.g. visible at `/docs`).
Read more about it in the
[FastAPI docs about Query parameters](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#exclude-parameters-from-openapi
""" """
), ),
] = True, ] = True,
@ -849,6 +909,9 @@ def Header( # noqa: N802
Doc( Doc(
""" """
Example values for this field. Example values for this field.
Read more about it in the
[FastAPI docs for Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/)
""" """
), ),
] = None, ] = None,
@ -1152,6 +1215,9 @@ def Cookie( # noqa: N802
Doc( Doc(
""" """
Example values for this field. Example values for this field.
Read more about it in the
[FastAPI docs for Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/)
""" """
), ),
] = None, ] = None,
@ -1477,6 +1543,9 @@ def Body( # noqa: N802
Doc( Doc(
""" """
Example values for this field. Example values for this field.
Read more about it in the
[FastAPI docs for Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/)
""" """
), ),
] = None, ] = None,
@ -1790,6 +1859,9 @@ def Form( # noqa: N802
Doc( Doc(
""" """
Example values for this field. Example values for this field.
Read more about it in the
[FastAPI docs for Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/)
""" """
), ),
] = None, ] = None,
@ -2102,6 +2174,9 @@ def File( # noqa: N802
Doc( Doc(
""" """
Example values for this field. Example values for this field.
Read more about it in the
[FastAPI docs for Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/)
""" """
), ),
] = None, ] = None,
@ -2215,6 +2290,9 @@ def Depends( # noqa: N802
Don't call it directly, FastAPI will call it for you, just pass the object Don't call it directly, FastAPI will call it for you, just pass the object
directly. directly.
Read more about it in the
[FastAPI docs for Dependencies](https://fastapi.tiangolo.com/tutorial/dependencies/)
""" """
), ),
] = None, ] = None,
@ -2230,6 +2308,9 @@ def Depends( # noqa: N802
Set `use_cache` to `False` to disable this behavior and ensure the Set `use_cache` to `False` to disable this behavior and ensure the
dependency is called again (if declared more than once) in the same request. dependency is called again (if declared more than once) in the same request.
Read more about it in the
[FastAPI docs about sub-dependencies](https://fastapi.tiangolo.com/tutorial/dependencies/sub-dependencies/#using-the-same-dependency-multiple-times)
""" """
), ),
] = True, ] = True,
@ -2250,6 +2331,9 @@ def Depends( # noqa: N802
that handles the request (similar to when using `"function"`), but end that handles the request (similar to when using `"function"`), but end
**after** the response is sent back to the client. So, the dependency **after** the response is sent back to the client. So, the dependency
function will be executed **around** the **request** and response cycle. function will be executed **around** the **request** and response cycle.
Read more about it in the
[FastAPI docs for FastAPI Dependencies with yield](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#early-exit-and-scope)
""" """
), ),
] = None, ] = None,
@ -2295,6 +2379,9 @@ def Security( # noqa: N802
Don't call it directly, FastAPI will call it for you, just pass the object Don't call it directly, FastAPI will call it for you, just pass the object
directly. directly.
Read more about it in the
[FastAPI docs for Dependencies](https://fastapi.tiangolo.com/tutorial/dependencies/)
""" """
), ),
] = None, ] = None,
@ -2312,7 +2399,9 @@ def Security( # noqa: N802
These scopes are integrated with OpenAPI (and the API docs at `/docs`). These scopes are integrated with OpenAPI (and the API docs at `/docs`).
So they are visible in the OpenAPI specification. So they are visible in the OpenAPI specification.
)
Read more about it in the
[FastAPI docs about OAuth2 scopes](https://fastapi.tiangolo.com/advanced/security/oauth2-scopes/)
""" """
), ),
] = None, ] = None,
@ -2327,6 +2416,9 @@ def Security( # noqa: N802
Set `use_cache` to `False` to disable this behavior and ensure the Set `use_cache` to `False` to disable this behavior and ensure the
dependency is called again (if declared more than once) in the same request. dependency is called again (if declared more than once) in the same request.
Read more about it in the
[FastAPI docs about sub-dependencies](https://fastapi.tiangolo.com/tutorial/dependencies/sub-dependencies/#using-the-same-dependency-multiple-times)
""" """
), ),
] = True, ] = True,

30
fastapi/security/oauth2.py

@ -68,6 +68,9 @@ class OAuth2PasswordRequestForm:
"password". Nevertheless, this dependency class is permissive and "password". Nevertheless, this dependency class is permissive and
allows not passing it. If you want to enforce it, use instead the allows not passing it. If you want to enforce it, use instead the
`OAuth2PasswordRequestFormStrict` dependency. `OAuth2PasswordRequestFormStrict` dependency.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
] = None, ] = None,
@ -78,6 +81,9 @@ class OAuth2PasswordRequestForm:
""" """
`username` string. The OAuth2 spec requires the exact field name `username` string. The OAuth2 spec requires the exact field name
`username`. `username`.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
], ],
@ -88,6 +94,9 @@ class OAuth2PasswordRequestForm:
""" """
`password` string. The OAuth2 spec requires the exact field name `password` string. The OAuth2 spec requires the exact field name
`password`. `password`.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
], ],
@ -112,6 +121,9 @@ class OAuth2PasswordRequestForm:
* `users:read` * `users:read`
* `profile` * `profile`
* `openid` * `openid`
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
] = "", ] = "",
@ -222,6 +234,9 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm):
"password". This dependency is strict about it. If you want to be "password". This dependency is strict about it. If you want to be
permissive, use instead the `OAuth2PasswordRequestForm` dependency permissive, use instead the `OAuth2PasswordRequestForm` dependency
class. class.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
], ],
@ -232,6 +247,9 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm):
""" """
`username` string. The OAuth2 spec requires the exact field name `username` string. The OAuth2 spec requires the exact field name
`username`. `username`.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
], ],
@ -242,6 +260,9 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm):
""" """
`password` string. The OAuth2 spec requires the exact field name `password` string. The OAuth2 spec requires the exact field name
`password`. `password`.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
], ],
@ -266,6 +287,9 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm):
* `users:read` * `users:read`
* `profile` * `profile`
* `openid` * `openid`
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
] = "", ] = "",
@ -423,6 +447,9 @@ class OAuth2PasswordBearer(OAuth2):
""" """
The URL to obtain the OAuth2 token. This would be the *path operation* The URL to obtain the OAuth2 token. This would be the *path operation*
that has `OAuth2PasswordRequestForm` as a dependency. that has `OAuth2PasswordRequestForm` as a dependency.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
], ],
@ -442,6 +469,9 @@ class OAuth2PasswordBearer(OAuth2):
""" """
The OAuth2 scopes that would be required by the *path operations* that The OAuth2 scopes that would be required by the *path operations* that
use this dependency. use this dependency.
Read more about it in the
[FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
""" """
), ),
] = None, ] = None,

2
fastapi/utils.py

@ -90,7 +90,7 @@ def create_model_field(
field_info = field_info or FieldInfo(annotation=type_, default=default, alias=alias) field_info = field_info or FieldInfo(annotation=type_, default=default, alias=alias)
kwargs = {"mode": mode, "name": name, "field_info": field_info} kwargs = {"mode": mode, "name": name, "field_info": field_info}
try: try:
return v2.ModelField(**kwargs) # type: ignore[return-value,arg-type] return v2.ModelField(**kwargs) # type: ignore[arg-type]
except PydanticSchemaGenerationError: except PydanticSchemaGenerationError:
raise fastapi.exceptions.FastAPIError( raise fastapi.exceptions.FastAPIError(
_invalid_args_message.format(type_=type_) _invalid_args_message.format(type_=type_)

12
pyproject.toml

@ -140,18 +140,18 @@ docs = [
"jieba==0.42.1", "jieba==0.42.1",
"markdown-include-variants==0.0.8", "markdown-include-variants==0.0.8",
"mdx-include>=1.4.1,<2.0.0", "mdx-include>=1.4.1,<2.0.0",
"mkdocs-macros-plugin==1.4.1", "mkdocs-macros-plugin==1.5.0",
"mkdocs-material==9.7.0", "mkdocs-material==9.7.0",
"mkdocs-redirects>=1.2.1,<1.3.0", "mkdocs-redirects>=1.2.1,<1.3.0",
"mkdocstrings[python]==0.30.1", "mkdocstrings[python]==0.30.1",
"pillow==11.3.0", "pillow==11.3.0",
"python-slugify==8.0.4", "python-slugify==8.0.4",
"pyyaml>=5.3.1,<7.0.0", "pyyaml>=5.3.1,<7.0.0",
"typer==0.16.0", "typer==0.21.1",
] ]
docs-tests = [ docs-tests = [
"httpx>=0.23.0,<1.0.0", "httpx>=0.23.0,<1.0.0",
"ruff==0.14.3", "ruff==0.14.14",
] ]
github-actions = [ github-actions = [
"httpx>=0.27.0,<1.0.0", "httpx>=0.27.0,<1.0.0",
@ -174,13 +174,14 @@ tests = [
"pytest>=7.1.3,<9.0.0", "pytest>=7.1.3,<9.0.0",
"pytest-codspeed==4.2.0", "pytest-codspeed==4.2.0",
"pyyaml>=5.3.1,<7.0.0", "pyyaml>=5.3.1,<7.0.0",
"sqlmodel==0.0.27", "sqlmodel==0.0.31",
"strawberry-graphql>=0.200.0,<1.0.0", "strawberry-graphql>=0.200.0,<1.0.0",
"types-orjson==3.6.2", "types-orjson==3.6.2",
"types-ujson==5.10.0.20240515", "types-ujson==5.10.0.20240515",
"a2wsgi>=1.9.0,<=2.0.0",
] ]
translations = [ translations = [
"gitpython==3.1.45", "gitpython==3.1.46",
"pydantic-ai==0.4.10", "pydantic-ai==0.4.10",
"pygithub==2.8.1", "pygithub==2.8.1",
] ]
@ -231,7 +232,6 @@ xfail_strict = true
junit_family = "xunit2" junit_family = "xunit2"
filterwarnings = [ filterwarnings = [
"error", "error",
'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette',
# see https://trio.readthedocs.io/en/stable/history.html#trio-0-22-0-2022-09-28 # see https://trio.readthedocs.io/en/stable/history.html#trio-0-22-0-2022-09-28
"ignore:You seem to already have a custom.*:RuntimeWarning:trio", "ignore:You seem to already have a custom.*:RuntimeWarning:trio",
# TODO: remove after upgrading SQLAlchemy to a version that includes the following changes # TODO: remove after upgrading SQLAlchemy to a version that includes the following changes

30
scripts/mkdocs_hooks.py

@ -26,6 +26,17 @@ def get_missing_translation_content(docs_dir: str) -> str:
return missing_translation_path.read_text(encoding="utf-8") return missing_translation_path.read_text(encoding="utf-8")
@lru_cache
def get_translation_banner_content(docs_dir: str) -> str:
docs_dir_path = Path(docs_dir)
translation_banner_path = docs_dir_path / "translation-banner.md"
if not translation_banner_path.is_file():
translation_banner_path = (
docs_dir_path.parent.parent / "en" / "docs" / "translation-banner.md"
)
return translation_banner_path.read_text(encoding="utf-8")
@lru_cache @lru_cache
def get_mkdocs_material_langs() -> list[str]: def get_mkdocs_material_langs() -> list[str]:
material_path = Path(material.__file__).parent material_path = Path(material.__file__).parent
@ -151,4 +162,21 @@ def on_page_markdown(
if markdown.startswith("#"): if markdown.startswith("#"):
header, _, body = markdown.partition("\n\n") header, _, body = markdown.partition("\n\n")
return f"{header}\n\n{missing_translation_content}\n\n{body}" return f"{header}\n\n{missing_translation_content}\n\n{body}"
return markdown
docs_dir_path = Path(config.docs_dir)
en_docs_dir_path = docs_dir_path.parent.parent / "en/docs"
if docs_dir_path == en_docs_dir_path:
return markdown
# For translated pages add translation banner
translation_banner_content = get_translation_banner_content(config.docs_dir)
en_url = "https://fastapi.tiangolo.com/" + page.url.lstrip("/")
translation_banner_content = translation_banner_content.replace(
"ENGLISH_VERSION_URL", en_url
)
header = ""
body = markdown
if markdown.startswith("#"):
header, _, body = markdown.partition("\n\n")
return f"{header}\n\n{translation_banner_content}\n\n{body}"

28
scripts/translate.py

@ -10,6 +10,7 @@ from typing import Annotated
import git import git
import typer import typer
import yaml import yaml
from doc_parsing_utils import check_translation
from github import Github from github import Github
from pydantic_ai import Agent from pydantic_ai import Agent
from rich import print from rich import print
@ -119,9 +120,30 @@ def translate_page(
] ]
) )
prompt = "\n\n".join(prompt_segments) prompt = "\n\n".join(prompt_segments)
print(f"Running agent for {out_path}")
result = agent.run_sync(prompt) MAX_ATTEMPTS = 3
out_content = f"{result.output.strip()}\n" for attempt_no in range(1, MAX_ATTEMPTS + 1):
print(f"Running agent for {out_path} (attempt {attempt_no}/{MAX_ATTEMPTS})")
result = agent.run_sync(prompt)
out_content = f"{result.output.strip()}\n"
try:
check_translation(
doc_lines=out_content.splitlines(),
en_doc_lines=original_content.splitlines(),
lang_code=language,
auto_fix=False,
path=str(out_path),
)
break # Exit loop if no errors
except ValueError as e:
print(
f"Translation check failed on attempt {attempt_no}/{MAX_ATTEMPTS}: {e}"
)
continue # Retry if not reached max attempts
else: # Max retry attempts reached
print(f"Translation failed for {out_path} after {MAX_ATTEMPTS} attempts")
raise typer.Exit(code=1)
print(f"Saving translation to {out_path}") print(f"Saving translation to {out_path}")
out_path.write_text(out_content, encoding="utf-8", newline="\n") out_path.write_text(out_content, encoding="utf-8", newline="\n")

123
tests/test_additional_responses_union_duplicate_anyof.py

@ -0,0 +1,123 @@
"""
Regression test: Ensure app-level responses with Union models and content/examples
don't accumulate duplicate $ref entries in anyOf arrays.
See https://github.com/fastapi/fastapi/pull/14463
"""
from typing import Union
from fastapi import FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel
class ModelA(BaseModel):
a: str
class ModelB(BaseModel):
b: str
app = FastAPI(
responses={
500: {
"model": Union[ModelA, ModelB],
"content": {"application/json": {"examples": {"Case A": {"value": "a"}}}},
}
}
)
@app.get("/route1")
async def route1():
pass # pragma: no cover
@app.get("/route2")
async def route2():
pass # pragma: no cover
client = TestClient(app)
def test_openapi_schema():
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == {
"openapi": "3.1.0",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/route1": {
"get": {
"summary": "Route1",
"operationId": "route1_route1_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"anyOf": [
{"$ref": "#/components/schemas/ModelA"},
{"$ref": "#/components/schemas/ModelB"},
],
"title": "Response 500 Route1 Route1 Get",
},
"examples": {"Case A": {"value": "a"}},
}
},
},
},
}
},
"/route2": {
"get": {
"summary": "Route2",
"operationId": "route2_route2_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"anyOf": [
{"$ref": "#/components/schemas/ModelA"},
{"$ref": "#/components/schemas/ModelB"},
],
"title": "Response 500 Route2 Route2 Get",
},
"examples": {"Case A": {"value": "a"}},
}
},
},
},
}
},
},
"components": {
"schemas": {
"ModelA": {
"properties": {"a": {"type": "string", "title": "A"}},
"type": "object",
"required": ["a"],
"title": "ModelA",
},
"ModelB": {
"properties": {"b": {"type": "string", "title": "B"}},
"type": "object",
"required": ["b"],
"title": "ModelB",
},
}
},
}

15
tests/test_invalid_sequence_param.py

@ -4,7 +4,10 @@ from pydantic import BaseModel
def test_invalid_sequence(): def test_invalid_sequence():
with pytest.raises(AssertionError): with pytest.raises(
AssertionError,
match="Query parameter 'q' must be one of the supported types",
):
app = FastAPI() app = FastAPI()
class Item(BaseModel): class Item(BaseModel):
@ -16,7 +19,10 @@ def test_invalid_sequence():
def test_invalid_tuple(): def test_invalid_tuple():
with pytest.raises(AssertionError): with pytest.raises(
AssertionError,
match="Query parameter 'q' must be one of the supported types",
):
app = FastAPI() app = FastAPI()
class Item(BaseModel): class Item(BaseModel):
@ -28,7 +34,10 @@ def test_invalid_tuple():
def test_invalid_dict(): def test_invalid_dict():
with pytest.raises(AssertionError): with pytest.raises(
AssertionError,
match="Query parameter 'q' must be one of the supported types",
):
app = FastAPI() app = FastAPI()
class Item(BaseModel): class Item(BaseModel):

2
tests/test_tutorial/test_metadata/test_tutorial001_1.py

@ -28,7 +28,7 @@ def test_openapi_schema():
}, },
"license": { "license": {
"name": "Apache 2.0", "name": "Apache 2.0",
"identifier": "MIT", "identifier": "Apache-2.0",
}, },
"version": "0.0.1", "version": "0.0.1",
}, },

114
uv.lock

@ -7,6 +7,18 @@ resolution-markers = [
"python_full_version < '3.10'", "python_full_version < '3.10'",
] ]
[[package]]
name = "a2wsgi"
version = "1.10.10"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "typing-extensions", marker = "python_full_version < '3.11'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/9a/cb/822c56fbea97e9eee201a2e434a80437f6750ebcb1ed307ee3a0a7505b14/a2wsgi-1.10.10.tar.gz", hash = "sha256:a5bcffb52081ba39df0d5e9a884fc6f819d92e3a42389343ba77cbf809fe1f45", size = 18799, upload-time = "2025-06-18T09:00:10.843Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/02/d5/349aba3dc421e73cbd4958c0ce0a4f1aa3a738bc0d7de75d2f40ed43a535/a2wsgi-1.10.10-py3-none-any.whl", hash = "sha256:d2b21379479718539dc15fce53b876251a0efe7615352dfe49f6ad1bc507848d", size = 17389, upload-time = "2025-06-18T09:00:09.676Z" },
]
[[package]] [[package]]
name = "ag-ui-protocol" name = "ag-ui-protocol"
version = "0.1.10" version = "0.1.10"
@ -1058,6 +1070,7 @@ standard-no-fastapi-cloud-cli = [
[package.dev-dependencies] [package.dev-dependencies]
dev = [ dev = [
{ name = "a2wsgi" },
{ name = "anyio", extra = ["trio"] }, { name = "anyio", extra = ["trio"] },
{ name = "black" }, { name = "black" },
{ name = "cairosvg" }, { name = "cairosvg" },
@ -1131,6 +1144,7 @@ github-actions = [
{ name = "smokeshow" }, { name = "smokeshow" },
] ]
tests = [ tests = [
{ name = "a2wsgi" },
{ name = "anyio", extra = ["trio"] }, { name = "anyio", extra = ["trio"] },
{ name = "coverage", version = "7.10.7", source = { registry = "https://pypi.org/simple" }, extra = ["toml"], marker = "python_full_version < '3.10'" }, { name = "coverage", version = "7.10.7", source = { registry = "https://pypi.org/simple" }, extra = ["toml"], marker = "python_full_version < '3.10'" },
{ name = "coverage", version = "7.13.1", source = { registry = "https://pypi.org/simple" }, extra = ["toml"], marker = "python_full_version >= '3.10'" }, { name = "coverage", version = "7.13.1", source = { registry = "https://pypi.org/simple" }, extra = ["toml"], marker = "python_full_version >= '3.10'" },
@ -1197,13 +1211,14 @@ provides-extras = ["standard", "standard-no-fastapi-cloud-cli", "all"]
[package.metadata.requires-dev] [package.metadata.requires-dev]
dev = [ dev = [
{ name = "a2wsgi", specifier = ">=1.9.0,<=2.0.0" },
{ name = "anyio", extras = ["trio"], specifier = ">=3.2.1,<5.0.0" }, { name = "anyio", extras = ["trio"], specifier = ">=3.2.1,<5.0.0" },
{ name = "black", specifier = "==25.1.0" }, { name = "black", specifier = "==25.1.0" },
{ name = "cairosvg", specifier = "==2.8.2" }, { name = "cairosvg", specifier = "==2.8.2" },
{ name = "coverage", extras = ["toml"], specifier = ">=6.5.0,<8.0" }, { name = "coverage", extras = ["toml"], specifier = ">=6.5.0,<8.0" },
{ name = "dirty-equals", specifier = "==0.9.0" }, { name = "dirty-equals", specifier = "==0.9.0" },
{ name = "flask", specifier = ">=1.1.2,<4.0.0" }, { name = "flask", specifier = ">=1.1.2,<4.0.0" },
{ name = "gitpython", specifier = "==3.1.45" }, { name = "gitpython", specifier = "==3.1.46" },
{ name = "griffe-typingdoc", specifier = "==0.3.0" }, { name = "griffe-typingdoc", specifier = "==0.3.0" },
{ name = "griffe-warnings-deprecated", specifier = "==1.1.0" }, { name = "griffe-warnings-deprecated", specifier = "==1.1.0" },
{ name = "httpx", specifier = ">=0.23.0,<1.0.0" }, { name = "httpx", specifier = ">=0.23.0,<1.0.0" },
@ -1211,7 +1226,7 @@ dev = [
{ name = "jieba", specifier = "==0.42.1" }, { name = "jieba", specifier = "==0.42.1" },
{ name = "markdown-include-variants", specifier = "==0.0.8" }, { name = "markdown-include-variants", specifier = "==0.0.8" },
{ name = "mdx-include", specifier = ">=1.4.1,<2.0.0" }, { name = "mdx-include", specifier = ">=1.4.1,<2.0.0" },
{ name = "mkdocs-macros-plugin", specifier = "==1.4.1" }, { name = "mkdocs-macros-plugin", specifier = "==1.5.0" },
{ name = "mkdocs-material", specifier = "==9.7.0" }, { name = "mkdocs-material", specifier = "==9.7.0" },
{ name = "mkdocs-redirects", specifier = ">=1.2.1,<1.3.0" }, { name = "mkdocs-redirects", specifier = ">=1.2.1,<1.3.0" },
{ name = "mkdocstrings", extras = ["python"], specifier = "==0.30.1" }, { name = "mkdocstrings", extras = ["python"], specifier = "==0.30.1" },
@ -1227,10 +1242,10 @@ dev = [
{ name = "pytest-codspeed", specifier = "==4.2.0" }, { name = "pytest-codspeed", specifier = "==4.2.0" },
{ name = "python-slugify", specifier = "==8.0.4" }, { name = "python-slugify", specifier = "==8.0.4" },
{ name = "pyyaml", specifier = ">=5.3.1,<7.0.0" }, { name = "pyyaml", specifier = ">=5.3.1,<7.0.0" },
{ name = "ruff", specifier = "==0.14.3" }, { name = "ruff", specifier = "==0.14.14" },
{ name = "sqlmodel", specifier = "==0.0.27" }, { name = "sqlmodel", specifier = "==0.0.31" },
{ name = "strawberry-graphql", specifier = ">=0.200.0,<1.0.0" }, { name = "strawberry-graphql", specifier = ">=0.200.0,<1.0.0" },
{ name = "typer", specifier = "==0.16.0" }, { name = "typer", specifier = "==0.21.1" },
{ name = "types-orjson", specifier = "==3.6.2" }, { name = "types-orjson", specifier = "==3.6.2" },
{ name = "types-ujson", specifier = "==5.10.0.20240515" }, { name = "types-ujson", specifier = "==5.10.0.20240515" },
] ]
@ -1243,19 +1258,19 @@ docs = [
{ name = "jieba", specifier = "==0.42.1" }, { name = "jieba", specifier = "==0.42.1" },
{ name = "markdown-include-variants", specifier = "==0.0.8" }, { name = "markdown-include-variants", specifier = "==0.0.8" },
{ name = "mdx-include", specifier = ">=1.4.1,<2.0.0" }, { name = "mdx-include", specifier = ">=1.4.1,<2.0.0" },
{ name = "mkdocs-macros-plugin", specifier = "==1.4.1" }, { name = "mkdocs-macros-plugin", specifier = "==1.5.0" },
{ name = "mkdocs-material", specifier = "==9.7.0" }, { name = "mkdocs-material", specifier = "==9.7.0" },
{ name = "mkdocs-redirects", specifier = ">=1.2.1,<1.3.0" }, { name = "mkdocs-redirects", specifier = ">=1.2.1,<1.3.0" },
{ name = "mkdocstrings", extras = ["python"], specifier = "==0.30.1" }, { name = "mkdocstrings", extras = ["python"], specifier = "==0.30.1" },
{ name = "pillow", specifier = "==11.3.0" }, { name = "pillow", specifier = "==11.3.0" },
{ name = "python-slugify", specifier = "==8.0.4" }, { name = "python-slugify", specifier = "==8.0.4" },
{ name = "pyyaml", specifier = ">=5.3.1,<7.0.0" }, { name = "pyyaml", specifier = ">=5.3.1,<7.0.0" },
{ name = "ruff", specifier = "==0.14.3" }, { name = "ruff", specifier = "==0.14.14" },
{ name = "typer", specifier = "==0.16.0" }, { name = "typer", specifier = "==0.21.1" },
] ]
docs-tests = [ docs-tests = [
{ name = "httpx", specifier = ">=0.23.0,<1.0.0" }, { name = "httpx", specifier = ">=0.23.0,<1.0.0" },
{ name = "ruff", specifier = "==0.14.3" }, { name = "ruff", specifier = "==0.14.14" },
] ]
github-actions = [ github-actions = [
{ name = "httpx", specifier = ">=0.27.0,<1.0.0" }, { name = "httpx", specifier = ">=0.27.0,<1.0.0" },
@ -1266,6 +1281,7 @@ github-actions = [
{ name = "smokeshow", specifier = ">=0.5.0" }, { name = "smokeshow", specifier = ">=0.5.0" },
] ]
tests = [ tests = [
{ name = "a2wsgi", specifier = ">=1.9.0,<=2.0.0" },
{ name = "anyio", extras = ["trio"], specifier = ">=3.2.1,<5.0.0" }, { name = "anyio", extras = ["trio"], specifier = ">=3.2.1,<5.0.0" },
{ name = "coverage", extras = ["toml"], specifier = ">=6.5.0,<8.0" }, { name = "coverage", extras = ["toml"], specifier = ">=6.5.0,<8.0" },
{ name = "dirty-equals", specifier = "==0.9.0" }, { name = "dirty-equals", specifier = "==0.9.0" },
@ -1278,14 +1294,14 @@ tests = [
{ name = "pytest", specifier = ">=7.1.3,<9.0.0" }, { name = "pytest", specifier = ">=7.1.3,<9.0.0" },
{ name = "pytest-codspeed", specifier = "==4.2.0" }, { name = "pytest-codspeed", specifier = "==4.2.0" },
{ name = "pyyaml", specifier = ">=5.3.1,<7.0.0" }, { name = "pyyaml", specifier = ">=5.3.1,<7.0.0" },
{ name = "ruff", specifier = "==0.14.3" }, { name = "ruff", specifier = "==0.14.14" },
{ name = "sqlmodel", specifier = "==0.0.27" }, { name = "sqlmodel", specifier = "==0.0.31" },
{ name = "strawberry-graphql", specifier = ">=0.200.0,<1.0.0" }, { name = "strawberry-graphql", specifier = ">=0.200.0,<1.0.0" },
{ name = "types-orjson", specifier = "==3.6.2" }, { name = "types-orjson", specifier = "==3.6.2" },
{ name = "types-ujson", specifier = "==5.10.0.20240515" }, { name = "types-ujson", specifier = "==5.10.0.20240515" },
] ]
translations = [ translations = [
{ name = "gitpython", specifier = "==3.1.45" }, { name = "gitpython", specifier = "==3.1.46" },
{ name = "pydantic-ai", specifier = "==0.4.10" }, { name = "pydantic-ai", specifier = "==0.4.10" },
{ name = "pygithub", specifier = "==2.8.1" }, { name = "pygithub", specifier = "==2.8.1" },
] ]
@ -1632,15 +1648,15 @@ wheels = [
[[package]] [[package]]
name = "gitpython" name = "gitpython"
version = "3.1.45" version = "3.1.46"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "gitdb" }, { name = "gitdb" },
{ name = "typing-extensions", marker = "python_full_version < '3.10'" }, { name = "typing-extensions", marker = "python_full_version < '3.10'" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/9a/c8/dd58967d119baab745caec2f9d853297cec1989ec1d63f677d3880632b88/gitpython-3.1.45.tar.gz", hash = "sha256:85b0ee964ceddf211c41b9f27a49086010a190fd8132a24e21f362a4b36a791c", size = 215076, upload-time = "2025-07-24T03:45:54.871Z" } sdist = { url = "https://files.pythonhosted.org/packages/df/b5/59d16470a1f0dfe8c793f9ef56fd3826093fc52b3bd96d6b9d6c26c7e27b/gitpython-3.1.46.tar.gz", hash = "sha256:400124c7d0ef4ea03f7310ac2fbf7151e09ff97f2a3288d64a440c584a29c37f", size = 215371, upload-time = "2026-01-01T15:37:32.073Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/01/61/d4b89fec821f72385526e1b9d9a3a0385dda4a72b206d28049e2c7cd39b8/gitpython-3.1.45-py3-none-any.whl", hash = "sha256:8908cb2e02fb3b93b7eb0f2827125cb699869470432cc885f019b8fd0fccff77", size = 208168, upload-time = "2025-07-24T03:45:52.517Z" }, { url = "https://files.pythonhosted.org/packages/6a/09/e21df6aef1e1ffc0c816f0522ddc3f6dcded766c3261813131c78a704470/gitpython-3.1.46-py3-none-any.whl", hash = "sha256:79812ed143d9d25b6d176a10bb511de0f9c67b1fa641d82097b0ab90398a2058", size = 208620, upload-time = "2026-01-01T15:37:30.574Z" },
] ]
[[package]] [[package]]
@ -2652,7 +2668,7 @@ wheels = [
[[package]] [[package]]
name = "mkdocs-macros-plugin" name = "mkdocs-macros-plugin"
version = "1.4.1" version = "1.5.0"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "hjson" }, { name = "hjson" },
@ -2667,9 +2683,9 @@ dependencies = [
{ name = "termcolor", version = "3.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, { name = "termcolor", version = "3.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },
{ name = "termcolor", version = "3.3.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "termcolor", version = "3.3.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/1b/42/bb2ceed148c77f82b57c6d3b7f584f0f34ababf7a9a8ff85809380d1f400/mkdocs_macros_plugin-1.4.1.tar.gz", hash = "sha256:55a9c93871e3744cdeb0736316783d60830a6d5d97b1132364e6b491607f2332", size = 35094, upload-time = "2025-10-25T12:37:20.689Z" } sdist = { url = "https://files.pythonhosted.org/packages/92/15/e6a44839841ebc9c5872fa0e6fad1c3757424e4fe026093b68e9f386d136/mkdocs_macros_plugin-1.5.0.tar.gz", hash = "sha256:12aa45ce7ecb7a445c66b9f649f3dd05e9b92e8af6bc65e4acd91d26f878c01f", size = 37730, upload-time = "2025-11-13T08:08:55.545Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/93/ec/e6e96a7ae8df414f03f43681821234b0d3b86666f7b91f70ab26775a8809/mkdocs_macros_plugin-1.4.1-py3-none-any.whl", hash = "sha256:5a9e483f6056fe7ad0923802affe699233ca468672e20a9640dba237165b3240", size = 40155, upload-time = "2025-10-25T12:37:19.417Z" }, { url = "https://files.pythonhosted.org/packages/51/62/9fffba5bb9ed3d31a932ad35038ba9483d59850256ee0fea7f1187173983/mkdocs_macros_plugin-1.5.0-py3-none-any.whl", hash = "sha256:c10fabd812bf50f9170609d0ed518e54f1f0e12c334ac29141723a83c881dd6f", size = 44626, upload-time = "2025-11-13T08:08:53.878Z" },
] ]
[[package]] [[package]]
@ -3238,11 +3254,11 @@ argon2 = [
[[package]] [[package]]
name = "pyasn1" name = "pyasn1"
version = "0.6.1" version = "0.6.2"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/ba/e9/01f1a64245b89f039897cb0130016d79f77d52669aae6ee7b159a6c4c018/pyasn1-0.6.1.tar.gz", hash = "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034", size = 145322, upload-time = "2024-09-10T22:41:42.55Z" } sdist = { url = "https://files.pythonhosted.org/packages/fe/b6/6e630dff89739fcd427e3f72b3d905ce0acb85a45d4ec3e2678718a3487f/pyasn1-0.6.2.tar.gz", hash = "sha256:9b59a2b25ba7e4f8197db7686c09fb33e658b98339fadb826e9512629017833b", size = 146586, upload-time = "2026-01-16T18:04:18.534Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.whl", hash = "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629", size = 83135, upload-time = "2024-09-11T16:00:36.122Z" }, { url = "https://files.pythonhosted.org/packages/44/b5/a96872e5184f354da9c84ae119971a0a4c221fe9b27a4d94bd43f2596727/pyasn1-0.6.2-py3-none-any.whl", hash = "sha256:1eb26d860996a18e9b6ed05e7aae0e9fc21619fcee6af91cca9bad4fbea224bf", size = 83371, upload-time = "2026-01-16T18:04:17.174Z" },
] ]
[[package]] [[package]]
@ -4248,28 +4264,28 @@ wheels = [
[[package]] [[package]]
name = "ruff" name = "ruff"
version = "0.14.3" version = "0.14.14"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/75/62/50b7727004dfe361104dfbf898c45a9a2fdfad8c72c04ae62900224d6ecf/ruff-0.14.3.tar.gz", hash = "sha256:4ff876d2ab2b161b6de0aa1f5bd714e8e9b4033dc122ee006925fbacc4f62153", size = 5558687, upload-time = "2025-10-31T00:26:26.878Z" } sdist = { url = "https://files.pythonhosted.org/packages/2e/06/f71e3a86b2df0dfa2d2f72195941cd09b44f87711cb7fa5193732cb9a5fc/ruff-0.14.14.tar.gz", hash = "sha256:2d0f819c9a90205f3a867dbbd0be083bee9912e170fd7d9704cc8ae45824896b", size = 4515732, upload-time = "2026-01-22T22:30:17.527Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/ce/8e/0c10ff1ea5d4360ab8bfca4cb2c9d979101a391f3e79d2616c9bf348cd26/ruff-0.14.3-py3-none-linux_armv6l.whl", hash = "sha256:876b21e6c824f519446715c1342b8e60f97f93264012de9d8d10314f8a79c371", size = 12535613, upload-time = "2025-10-31T00:25:44.302Z" }, { url = "https://files.pythonhosted.org/packages/d2/89/20a12e97bc6b9f9f68343952da08a8099c57237aef953a56b82711d55edd/ruff-0.14.14-py3-none-linux_armv6l.whl", hash = "sha256:7cfe36b56e8489dee8fbc777c61959f60ec0f1f11817e8f2415f429552846aed", size = 10467650, upload-time = "2026-01-22T22:30:08.578Z" },
{ url = "https://files.pythonhosted.org/packages/d3/c8/6724f4634c1daf52409fbf13fefda64aa9c8f81e44727a378b7b73dc590b/ruff-0.14.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b6fd8c79b457bedd2abf2702b9b472147cd860ed7855c73a5247fa55c9117654", size = 12855812, upload-time = "2025-10-31T00:25:47.793Z" }, { url = "https://files.pythonhosted.org/packages/a3/b1/c5de3fd2d5a831fcae21beda5e3589c0ba67eec8202e992388e4b17a6040/ruff-0.14.14-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6006a0082336e7920b9573ef8a7f52eec837add1265cc74e04ea8a4368cd704c", size = 10883245, upload-time = "2026-01-22T22:30:04.155Z" },
{ url = "https://files.pythonhosted.org/packages/de/03/db1bce591d55fd5f8a08bb02517fa0b5097b2ccabd4ea1ee29aa72b67d96/ruff-0.14.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:71ff6edca490c308f083156938c0c1a66907151263c4abdcb588602c6e696a14", size = 11944026, upload-time = "2025-10-31T00:25:49.657Z" }, { url = "https://files.pythonhosted.org/packages/b8/7c/3c1db59a10e7490f8f6f8559d1db8636cbb13dccebf18686f4e3c9d7c772/ruff-0.14.14-py3-none-macosx_11_0_arm64.whl", hash = "sha256:026c1d25996818f0bf498636686199d9bd0d9d6341c9c2c3b62e2a0198b758de", size = 10231273, upload-time = "2026-01-22T22:30:34.642Z" },
{ url = "https://files.pythonhosted.org/packages/0b/75/4f8dbd48e03272715d12c87dc4fcaaf21b913f0affa5f12a4e9c6f8a0582/ruff-0.14.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:786ee3ce6139772ff9272aaf43296d975c0217ee1b97538a98171bf0d21f87ed", size = 12356818, upload-time = "2025-10-31T00:25:51.949Z" }, { url = "https://files.pythonhosted.org/packages/a1/6e/5e0e0d9674be0f8581d1f5e0f0a04761203affce3232c1a1189d0e3b4dad/ruff-0.14.14-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f666445819d31210b71e0a6d1c01e24447a20b85458eea25a25fe8142210ae0e", size = 10585753, upload-time = "2026-01-22T22:30:31.781Z" },
{ url = "https://files.pythonhosted.org/packages/ec/9b/506ec5b140c11d44a9a4f284ea7c14ebf6f8b01e6e8917734a3325bff787/ruff-0.14.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cd6291d0061811c52b8e392f946889916757610d45d004e41140d81fb6cd5ddc", size = 12336745, upload-time = "2025-10-31T00:25:54.248Z" }, { url = "https://files.pythonhosted.org/packages/23/09/754ab09f46ff1884d422dc26d59ba18b4e5d355be147721bb2518aa2a014/ruff-0.14.14-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3c0f18b922c6d2ff9a5e6c3ee16259adc513ca775bcf82c67ebab7cbd9da5bc8", size = 10286052, upload-time = "2026-01-22T22:30:24.827Z" },
{ url = "https://files.pythonhosted.org/packages/c7/e1/c560d254048c147f35e7f8131d30bc1f63a008ac61595cf3078a3e93533d/ruff-0.14.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a497ec0c3d2c88561b6d90f9c29f5ae68221ac00d471f306fa21fa4264ce5fcd", size = 13101684, upload-time = "2025-10-31T00:25:56.253Z" }, { url = "https://files.pythonhosted.org/packages/c8/cc/e71f88dd2a12afb5f50733851729d6b571a7c3a35bfdb16c3035132675a0/ruff-0.14.14-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1629e67489c2dea43e8658c3dba659edbfd87361624b4040d1df04c9740ae906", size = 11043637, upload-time = "2026-01-22T22:30:13.239Z" },
{ url = "https://files.pythonhosted.org/packages/a5/32/e310133f8af5cd11f8cc30f52522a3ebccc5ea5bff4b492f94faceaca7a8/ruff-0.14.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:e231e1be58fc568950a04fbe6887c8e4b85310e7889727e2b81db205c45059eb", size = 14535000, upload-time = "2025-10-31T00:25:58.397Z" }, { url = "https://files.pythonhosted.org/packages/67/b2/397245026352494497dac935d7f00f1468c03a23a0c5db6ad8fc49ca3fb2/ruff-0.14.14-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:27493a2131ea0f899057d49d303e4292b2cae2bb57253c1ed1f256fbcd1da480", size = 12194761, upload-time = "2026-01-22T22:30:22.542Z" },
{ url = "https://files.pythonhosted.org/packages/a2/a1/7b0470a22158c6d8501eabc5e9b6043c99bede40fa1994cadf6b5c2a61c7/ruff-0.14.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:469e35872a09c0e45fecf48dd960bfbce056b5db2d5e6b50eca329b4f853ae20", size = 14156450, upload-time = "2025-10-31T00:26:00.889Z" }, { url = "https://files.pythonhosted.org/packages/5b/06/06ef271459f778323112c51b7587ce85230785cd64e91772034ddb88f200/ruff-0.14.14-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01ff589aab3f5b539e35db38425da31a57521efd1e4ad1ae08fc34dbe30bd7df", size = 12005701, upload-time = "2026-01-22T22:30:20.499Z" },
{ url = "https://files.pythonhosted.org/packages/0a/96/24bfd9d1a7f532b560dcee1a87096332e461354d3882124219bcaff65c09/ruff-0.14.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d6bc90307c469cb9d28b7cfad90aaa600b10d67c6e22026869f585e1e8a2db0", size = 13568414, upload-time = "2025-10-31T00:26:03.291Z" }, { url = "https://files.pythonhosted.org/packages/41/d6/99364514541cf811ccc5ac44362f88df66373e9fec1b9d1c4cc830593fe7/ruff-0.14.14-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1cc12d74eef0f29f51775f5b755913eb523546b88e2d733e1d701fe65144e89b", size = 11282455, upload-time = "2026-01-22T22:29:59.679Z" },
{ url = "https://files.pythonhosted.org/packages/a7/e7/138b883f0dfe4ad5b76b58bf4ae675f4d2176ac2b24bdd81b4d966b28c61/ruff-0.14.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2f8a0bbcffcfd895df39c9a4ecd59bb80dca03dc43f7fb63e647ed176b741e", size = 13315293, upload-time = "2025-10-31T00:26:05.708Z" }, { url = "https://files.pythonhosted.org/packages/ca/71/37daa46f89475f8582b7762ecd2722492df26421714a33e72ccc9a84d7a5/ruff-0.14.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb8481604b7a9e75eff53772496201690ce2687067e038b3cc31aaf16aa0b974", size = 11215882, upload-time = "2026-01-22T22:29:57.032Z" },
{ url = "https://files.pythonhosted.org/packages/33/f4/c09bb898be97b2eb18476b7c950df8815ef14cf956074177e9fbd40b7719/ruff-0.14.3-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:678fdd7c7d2d94851597c23ee6336d25f9930b460b55f8598e011b57c74fd8c5", size = 13539444, upload-time = "2025-10-31T00:26:08.09Z" }, { url = "https://files.pythonhosted.org/packages/2c/10/a31f86169ec91c0705e618443ee74ede0bdd94da0a57b28e72db68b2dbac/ruff-0.14.14-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:14649acb1cf7b5d2d283ebd2f58d56b75836ed8c6f329664fa91cdea19e76e66", size = 11180549, upload-time = "2026-01-22T22:30:27.175Z" },
{ url = "https://files.pythonhosted.org/packages/9c/aa/b30a1db25fc6128b1dd6ff0741fa4abf969ded161599d07ca7edd0739cc0/ruff-0.14.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1ec1ac071e7e37e0221d2f2dbaf90897a988c531a8592a6a5959f0603a1ecf5e", size = 12252581, upload-time = "2025-10-31T00:26:10.297Z" }, { url = "https://files.pythonhosted.org/packages/fd/1e/c723f20536b5163adf79bdd10c5f093414293cdf567eed9bdb7b83940f3f/ruff-0.14.14-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e8058d2145566510790eab4e2fad186002e288dec5e0d343a92fe7b0bc1b3e13", size = 10543416, upload-time = "2026-01-22T22:30:01.964Z" },
{ url = "https://files.pythonhosted.org/packages/da/13/21096308f384d796ffe3f2960b17054110a9c3828d223ca540c2b7cc670b/ruff-0.14.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:afcdc4b5335ef440d19e7df9e8ae2ad9f749352190e96d481dc501b753f0733e", size = 12307503, upload-time = "2025-10-31T00:26:12.646Z" }, { url = "https://files.pythonhosted.org/packages/3e/34/8a84cea7e42c2d94ba5bde1d7a4fae164d6318f13f933d92da6d7c2041ff/ruff-0.14.14-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e651e977a79e4c758eb807f0481d673a67ffe53cfa92209781dfa3a996cf8412", size = 10285491, upload-time = "2026-01-22T22:30:29.51Z" },
{ url = "https://files.pythonhosted.org/packages/cb/cc/a350bac23f03b7dbcde3c81b154706e80c6f16b06ff1ce28ed07dc7b07b0/ruff-0.14.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:7bfc42f81862749a7136267a343990f865e71fe2f99cf8d2958f684d23ce3dfa", size = 12675457, upload-time = "2025-10-31T00:26:15.044Z" }, { url = "https://files.pythonhosted.org/packages/55/ef/b7c5ea0be82518906c978e365e56a77f8de7678c8bb6651ccfbdc178c29f/ruff-0.14.14-py3-none-musllinux_1_2_i686.whl", hash = "sha256:cc8b22da8d9d6fdd844a68ae937e2a0adf9b16514e9a97cc60355e2d4b219fc3", size = 10733525, upload-time = "2026-01-22T22:30:06.499Z" },
{ url = "https://files.pythonhosted.org/packages/cb/76/46346029fa2f2078826bc88ef7167e8c198e58fe3126636e52f77488cbba/ruff-0.14.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a65e448cfd7e9c59fae8cf37f9221585d3354febaad9a07f29158af1528e165f", size = 13403980, upload-time = "2025-10-31T00:26:17.81Z" }, { url = "https://files.pythonhosted.org/packages/6a/5b/aaf1dfbcc53a2811f6cc0a1759de24e4b03e02ba8762daabd9b6bd8c59e3/ruff-0.14.14-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:16bc890fb4cc9781bb05beb5ab4cd51be9e7cb376bf1dd3580512b24eb3fda2b", size = 11315626, upload-time = "2026-01-22T22:30:36.848Z" },
{ url = "https://files.pythonhosted.org/packages/9f/a4/35f1ef68c4e7b236d4a5204e3669efdeefaef21f0ff6a456792b3d8be438/ruff-0.14.3-py3-none-win32.whl", hash = "sha256:f3d91857d023ba93e14ed2d462ab62c3428f9bbf2b4fbac50a03ca66d31991f7", size = 12500045, upload-time = "2025-10-31T00:26:20.503Z" }, { url = "https://files.pythonhosted.org/packages/2c/aa/9f89c719c467dfaf8ad799b9bae0df494513fb21d31a6059cb5870e57e74/ruff-0.14.14-py3-none-win32.whl", hash = "sha256:b530c191970b143375b6a68e6f743800b2b786bbcf03a7965b06c4bf04568167", size = 10502442, upload-time = "2026-01-22T22:30:38.93Z" },
{ url = "https://files.pythonhosted.org/packages/03/15/51960ae340823c9859fb60c63301d977308735403e2134e17d1d2858c7fb/ruff-0.14.3-py3-none-win_amd64.whl", hash = "sha256:d7b7006ac0756306db212fd37116cce2bd307e1e109375e1c6c106002df0ae5f", size = 13594005, upload-time = "2025-10-31T00:26:22.533Z" }, { url = "https://files.pythonhosted.org/packages/87/44/90fa543014c45560cae1fffc63ea059fb3575ee6e1cb654562197e5d16fb/ruff-0.14.14-py3-none-win_amd64.whl", hash = "sha256:3dde1435e6b6fe5b66506c1dff67a421d0b7f6488d466f651c07f4cab3bf20fd", size = 11630486, upload-time = "2026-01-22T22:30:10.852Z" },
{ url = "https://files.pythonhosted.org/packages/b7/73/4de6579bac8e979fca0a77e54dec1f1e011a0d268165eb8a9bc0982a6564/ruff-0.14.3-py3-none-win_arm64.whl", hash = "sha256:26eb477ede6d399d898791d01961e16b86f02bc2486d0d1a7a9bb2379d055dc1", size = 12590017, upload-time = "2025-10-31T00:26:24.52Z" }, { url = "https://files.pythonhosted.org/packages/9e/6a/40fee331a52339926a92e17ae748827270b288a35ef4a15c9c8f2ec54715/ruff-0.14.14-py3-none-win_arm64.whl", hash = "sha256:56e6981a98b13a32236a72a8da421d7839221fa308b223b9283312312e5ac76c", size = 10920448, upload-time = "2026-01-22T22:30:15.417Z" },
] ]
[[package]] [[package]]
@ -4415,15 +4431,15 @@ wheels = [
[[package]] [[package]]
name = "sqlmodel" name = "sqlmodel"
version = "0.0.27" version = "0.0.31"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "pydantic" }, { name = "pydantic" },
{ name = "sqlalchemy" }, { name = "sqlalchemy" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/90/5a/693d90866233e837d182da76082a6d4c2303f54d3aaaa5c78e1238c5d863/sqlmodel-0.0.27.tar.gz", hash = "sha256:ad1227f2014a03905aef32e21428640848ac09ff793047744a73dfdd077ff620", size = 118053, upload-time = "2025-10-08T16:39:11.938Z" } sdist = { url = "https://files.pythonhosted.org/packages/56/b8/e7cd6def4a773f25d6e29ffce63ccbfd6cf9488b804ab6fb9b80d334b39d/sqlmodel-0.0.31.tar.gz", hash = "sha256:2d41a8a9ee05e40736e2f9db8ea28cbfe9b5d4e5a18dd139e80605025e0c516c", size = 94952, upload-time = "2025-12-28T12:35:01.436Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/8c/92/c35e036151fe53822893979f8a13e6f235ae8191f4164a79ae60a95d66aa/sqlmodel-0.0.27-py3-none-any.whl", hash = "sha256:667fe10aa8ff5438134668228dc7d7a08306f4c5c4c7e6ad3ad68defa0e7aa49", size = 29131, upload-time = "2025-10-08T16:39:10.917Z" }, { url = "https://files.pythonhosted.org/packages/6c/72/5aa5be921800f6418a949a73c9bb7054890881143e6bc604a93d228a95a3/sqlmodel-0.0.31-py3-none-any.whl", hash = "sha256:6d946d56cac4c2db296ba1541357cee2e795d68174e2043cd138b916794b1513", size = 27093, upload-time = "2025-12-28T12:35:00.108Z" },
] ]
[[package]] [[package]]
@ -4737,7 +4753,7 @@ wheels = [
[[package]] [[package]]
name = "typer" name = "typer"
version = "0.16.0" version = "0.21.1"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
dependencies = [ dependencies = [
{ name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },
@ -4746,9 +4762,9 @@ dependencies = [
{ name = "shellingham" }, { name = "shellingham" },
{ name = "typing-extensions" }, { name = "typing-extensions" },
] ]
sdist = { url = "https://files.pythonhosted.org/packages/c5/8c/7d682431efca5fd290017663ea4588bf6f2c6aad085c7f108c5dbc316e70/typer-0.16.0.tar.gz", hash = "sha256:af377ffaee1dbe37ae9440cb4e8f11686ea5ce4e9bae01b84ae7c63b87f1dd3b", size = 102625, upload-time = "2025-05-26T14:30:31.824Z" } sdist = { url = "https://files.pythonhosted.org/packages/36/bf/8825b5929afd84d0dabd606c67cd57b8388cb3ec385f7ef19c5cc2202069/typer-0.21.1.tar.gz", hash = "sha256:ea835607cd752343b6b2b7ce676893e5a0324082268b48f27aa058bdb7d2145d", size = 110371, upload-time = "2026-01-06T11:21:10.989Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/76/42/3efaf858001d2c2913de7f354563e3a3a2f0decae3efe98427125a8f441e/typer-0.16.0-py3-none-any.whl", hash = "sha256:1f79bed11d4d02d4310e3c1b7ba594183bcedb0ac73b27a9e5f28f6fb5b98855", size = 46317, upload-time = "2025-05-26T14:30:30.523Z" }, { url = "https://files.pythonhosted.org/packages/a0/1d/d9257dd49ff2ca23ea5f132edf1281a0c4f9de8a762b9ae399b670a59235/typer-0.21.1-py3-none-any.whl", hash = "sha256:7985e89081c636b88d172c2ee0cfe33c253160994d47bdfdc302defd7d1f1d01", size = 47381, upload-time = "2026-01-06T11:21:09.824Z" },
] ]
[[package]] [[package]]

Loading…
Cancel
Save