Browse Source

Merge branch 'master' into fr-llm-prompt

pull/14618/head
Sebastián Ramírez 6 months ago
committed by GitHub
parent
commit
273d21c722
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      .github/dependabot.yml
  2. 25
      .github/workflows/build-docs.yml
  3. 12
      .github/workflows/contributors.yml
  4. 16
      .github/workflows/deploy-docs.yml
  5. 12
      .github/workflows/label-approved.yml
  6. 12
      .github/workflows/notify-translations.yml
  7. 12
      .github/workflows/people.yml
  8. 7
      .github/workflows/pre-commit.yml
  9. 15
      .github/workflows/publish.yml
  10. 11
      .github/workflows/smokeshow.yml
  11. 12
      .github/workflows/sponsors.yml
  12. 4
      .github/workflows/test-redistribute.yml
  13. 26
      .github/workflows/test.yml
  14. 12
      .github/workflows/topic-repos.yml
  15. 29
      .github/workflows/translate.yml
  16. 3
      .gitignore
  17. 7
      .pre-commit-config.yaml
  18. 1
      .python-version
  19. 361
      docs/de/llm-prompt.md
  20. 29
      docs/en/data/contributors.yml
  21. 431
      docs/en/data/github_sponsors.yml
  22. 442
      docs/en/data/topic_repos.yml
  23. 146
      docs/en/data/translation_reviewers.yml
  24. 26
      docs/en/data/translators.yml
  25. 2
      docs/en/docs/_llm-test.md
  26. 32
      docs/en/docs/contributing.md
  27. 15
      docs/en/docs/release-notes.md
  28. 2
      docs/en/docs/tutorial/bigger-applications.md
  29. 46
      docs/es/docs/_llm-test.md
  30. 40
      docs/es/docs/advanced/path-operation-advanced-configuration.md
  31. 56
      docs/es/docs/advanced/settings.md
  32. 26
      docs/es/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
  33. 6
      docs/es/docs/how-to/separate-openapi-schemas.md
  34. 26
      docs/es/docs/index.md
  35. 28
      docs/es/docs/tutorial/bigger-applications.md
  36. 22
      docs/es/docs/tutorial/body-updates.md
  37. 14
      docs/es/docs/tutorial/body.md
  38. 39
      docs/es/docs/tutorial/extra-models.md
  39. 26
      docs/es/docs/tutorial/query-params-str-validations.md
  40. 20
      docs/es/docs/tutorial/response-model.md
  41. 38
      docs/es/docs/tutorial/schema-extra-example.md
  42. 16
      docs/ja/llm-prompt.md
  43. 16
      docs/ko/llm-prompt.md
  44. 2
      docs/missing-translation.md
  45. 18
      docs/pt/llm-prompt.md
  46. 18
      docs/tr/llm-prompt.md
  47. 20
      docs/uk/llm-prompt.md
  48. 34
      docs/zh-hant/llm-prompt.md
  49. 22
      docs/zh/llm-prompt.md
  50. 63
      pyproject.toml
  51. 4
      requirements-docs-tests.txt
  52. 21
      requirements-docs.txt
  53. 6
      requirements-github-actions.txt
  54. 18
      requirements-tests.txt
  55. 3
      requirements-translations.txt
  56. 7
      requirements.txt
  57. 733
      scripts/doc_parsing_utils.py
  58. 2
      scripts/docs.py
  59. 528
      scripts/general-llm-prompt.md
  60. 2
      scripts/notify_translations.py
  61. 2
      scripts/test.sh
  62. 42
      scripts/tests/test_translation_fixer/conftest.py
  63. 44
      scripts/tests/test_translation_fixer/test_code_blocks/data/en_doc.md
  64. 45
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_lines_number_gt.md
  65. 45
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_lines_number_lt.md
  66. 44
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_mermaid_not_translated.md
  67. 44
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_mermaid_translated.md
  68. 50
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_number_gt.md
  69. 41
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_number_lt.md
  70. 46
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_wrong_lang_code.md
  71. 46
      scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_wrong_lang_code_2.md
  72. 58
      scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_lines_number_mismatch.py
  73. 59
      scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_mermaid.py
  74. 60
      scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_number_mismatch.py
  75. 58
      scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_wrong_lang_code.py
  76. 13
      scripts/tests/test_translation_fixer/test_code_includes/data/en_doc.md
  77. 15
      scripts/tests/test_translation_fixer/test_code_includes/data/translated_doc_number_gt.md
  78. 13
      scripts/tests/test_translation_fixer/test_code_includes/data/translated_doc_number_lt.md
  79. 60
      scripts/tests/test_translation_fixer/test_code_includes/test_number_mismatch.py
  80. 244
      scripts/tests/test_translation_fixer/test_complex_doc/data/en_doc.md
  81. 240
      scripts/tests/test_translation_fixer/test_complex_doc/data/translated_doc.md
  82. 240
      scripts/tests/test_translation_fixer/test_complex_doc/data/translated_doc_expected.md
  83. 30
      scripts/tests/test_translation_fixer/test_complex_doc/test_compex_doc.py
  84. 19
      scripts/tests/test_translation_fixer/test_header_permalinks/data/en_doc.md
  85. 19
      scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_level_mismatch_1.md
  86. 19
      scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_level_mismatch_2.md
  87. 19
      scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_number_gt.md
  88. 19
      scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_number_lt.md
  89. 60
      scripts/tests/test_translation_fixer/test_header_permalinks/test_header_level_mismatch.py
  90. 60
      scripts/tests/test_translation_fixer/test_header_permalinks/test_header_number_mismatch.py
  91. 19
      scripts/tests/test_translation_fixer/test_html_links/data/en_doc.md
  92. 21
      scripts/tests/test_translation_fixer/test_html_links/data/translated_doc_number_gt.md
  93. 19
      scripts/tests/test_translation_fixer/test_html_links/data/translated_doc_number_lt.md
  94. 58
      scripts/tests/test_translation_fixer/test_html_links/test_html_links_number_mismatch.py
  95. 19
      scripts/tests/test_translation_fixer/test_markdown_links/data/en_doc.md
  96. 19
      scripts/tests/test_translation_fixer/test_markdown_links/data/translated_doc.md
  97. 21
      scripts/tests/test_translation_fixer/test_markdown_links/data/translated_doc_number_gt.md
  98. 19
      scripts/tests/test_translation_fixer/test_markdown_links/data/translated_doc_number_lt.md
  99. 60
      scripts/tests/test_translation_fixer/test_markdown_links/test_mkd_links_number_mismatch.py
  100. 662
      scripts/translate.py

2
.github/dependabot.yml

@ -8,7 +8,7 @@ updates:
commit-message: commit-message:
prefix: prefix:
# Python # Python
- package-ecosystem: "pip" - package-ecosystem: "uv"
directory: "/" directory: "/"
schedule: schedule:
interval: "monthly" interval: "monthly"

25
.github/workflows/build-docs.yml

@ -8,9 +8,6 @@ on:
- opened - opened
- synchronize - synchronize
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
changes: changes:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -31,8 +28,8 @@ jobs:
- README.md - README.md
- docs/** - docs/**
- docs_src/** - docs_src/**
- requirements-docs.txt
- pyproject.toml - pyproject.toml
- uv.lock
- mkdocs.yml - mkdocs.yml
- mkdocs.env.yml - mkdocs.env.yml
- .github/workflows/build-docs.yml - .github/workflows/build-docs.yml
@ -49,21 +46,20 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install docs extras - name: Install docs extras
run: uv pip install -r requirements-docs.txt run: uv sync --locked --no-dev --group docs
- name: Export Language Codes - name: Export Language Codes
id: show-langs id: show-langs
run: | run: |
echo "langs=$(python ./scripts/docs.py langs-json)" >> $GITHUB_OUTPUT echo "langs=$(uv run ./scripts/docs.py langs-json)" >> $GITHUB_OUTPUT
build-docs: build-docs:
needs: needs:
@ -83,25 +79,24 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install docs extras - name: Install docs extras
run: uv pip install -r requirements-docs.txt run: uv sync --locked --no-dev --group docs
- name: Update Languages - name: Update Languages
run: python ./scripts/docs.py update-languages run: uv run ./scripts/docs.py update-languages
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
key: mkdocs-cards-${{ matrix.lang }}-${{ github.ref }} key: mkdocs-cards-${{ matrix.lang }}-${{ github.ref }}
path: docs/${{ matrix.lang }}/.cache path: docs/${{ matrix.lang }}/.cache
- name: Build Docs - name: Build Docs
run: python ./scripts/docs.py build-lang ${{ matrix.lang }} run: uv run ./scripts/docs.py build-lang ${{ matrix.lang }}
- uses: actions/upload-artifact@v5 - uses: actions/upload-artifact@v5
with: with:
name: docs-site-${{ matrix.lang }} name: docs-site-${{ matrix.lang }}

12
.github/workflows/contributors.yml

@ -10,9 +10,6 @@ on:
required: false required: false
default: "false" default: "false"
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
job: job:
if: github.repository_owner == 'fastapi' if: github.repository_owner == 'fastapi'
@ -28,17 +25,16 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-github-actions.txt run: uv sync --locked --no-dev --group github-actions
# Allow debugging with tmate # Allow debugging with tmate
- name: Setup tmate session - name: Setup tmate session
uses: mxschmitt/action-tmate@v3 uses: mxschmitt/action-tmate@v3
@ -48,6 +44,6 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }} GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }}
- name: FastAPI People Contributors - name: FastAPI People Contributors
run: python ./scripts/contributors.py run: uv run ./scripts/contributors.py
env: env:
GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }} GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }}

16
.github/workflows/deploy-docs.yml

@ -12,9 +12,6 @@ permissions:
pull-requests: write pull-requests: write
statuses: write statuses: write
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
deploy-docs: deploy-docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -27,19 +24,18 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install GitHub Actions dependencies - name: Install GitHub Actions dependencies
run: uv pip install -r requirements-github-actions.txt run: uv sync --locked --no-dev --group github-actions
- name: Deploy Docs Status Pending - name: Deploy Docs Status Pending
run: python ./scripts/deploy_docs_status.py run: uv run ./scripts/deploy_docs_status.py
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
@ -70,14 +66,14 @@ jobs:
command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }} command: pages deploy ./site --project-name=${{ env.PROJECT_NAME }} --branch=${{ env.BRANCH }}
- name: Deploy Docs Status Error - name: Deploy Docs Status Error
if: failure() if: failure()
run: python ./scripts/deploy_docs_status.py run: uv run ./scripts/deploy_docs_status.py
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_ID: ${{ github.run_id }} RUN_ID: ${{ github.run_id }}
STATE: "error" STATE: "error"
- name: Comment Deploy - name: Comment Deploy
run: python ./scripts/deploy_docs_status.py run: uv run ./scripts/deploy_docs_status.py
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }} DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }}

12
.github/workflows/label-approved.yml

@ -8,9 +8,6 @@ on:
permissions: permissions:
pull-requests: write pull-requests: write
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
label-approved: label-approved:
if: github.repository_owner == 'fastapi' if: github.repository_owner == 'fastapi'
@ -24,19 +21,18 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install GitHub Actions dependencies - name: Install GitHub Actions dependencies
run: uv pip install -r requirements-github-actions.txt run: uv sync --locked --no-dev --group github-actions
- name: Label Approved - name: Label Approved
run: python ./scripts/label_approved.py run: uv run ./scripts/label_approved.py
env: env:
TOKEN: ${{ secrets.GITHUB_TOKEN }} TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG: > CONFIG: >

12
.github/workflows/notify-translations.yml

@ -15,9 +15,6 @@ on:
required: false required: false
default: 'false' default: 'false'
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
job: job:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -32,17 +29,16 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-github-actions.txt run: uv sync --locked --no-dev --group github-actions
# Allow debugging with tmate # Allow debugging with tmate
- name: Setup tmate session - name: Setup tmate session
uses: mxschmitt/action-tmate@v3 uses: mxschmitt/action-tmate@v3
@ -52,7 +48,7 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify Translations - name: Notify Translations
run: python ./scripts/notify_translations.py run: uv run ./scripts/notify_translations.py
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUMBER: ${{ github.event.inputs.number || null }} NUMBER: ${{ github.event.inputs.number || null }}

12
.github/workflows/people.yml

@ -10,9 +10,6 @@ on:
required: false required: false
default: "false" default: "false"
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
job: job:
if: github.repository_owner == 'fastapi' if: github.repository_owner == 'fastapi'
@ -28,17 +25,16 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-github-actions.txt run: uv sync --locked --no-dev --group github-actions
# Allow debugging with tmate # Allow debugging with tmate
- name: Setup tmate session - name: Setup tmate session
uses: mxschmitt/action-tmate@v3 uses: mxschmitt/action-tmate@v3
@ -48,7 +44,7 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.FASTAPI_PEOPLE }} GITHUB_TOKEN: ${{ secrets.FASTAPI_PEOPLE }}
- name: FastAPI People Experts - name: FastAPI People Experts
run: python ./scripts/people.py run: uv run ./scripts/people.py
env: env:
GITHUB_TOKEN: ${{ secrets.FASTAPI_PEOPLE }} GITHUB_TOKEN: ${{ secrets.FASTAPI_PEOPLE }}
SLEEP_INTERVAL: ${{ vars.PEOPLE_SLEEP_INTERVAL }} SLEEP_INTERVAL: ${{ vars.PEOPLE_SLEEP_INTERVAL }}

7
.github/workflows/pre-commit.yml

@ -40,18 +40,15 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.14" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock uv.lock
- name: Install Dependencies - name: Install Dependencies
run: | run: uv sync --locked --extra all
uv venv
uv pip install -r requirements.txt
- name: Run prek - pre-commit - name: Run prek - pre-commit
id: precommit id: precommit
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure

15
.github/workflows/publish.yml

@ -15,6 +15,7 @@ jobs:
- fastapi-slim - fastapi-slim
permissions: permissions:
id-token: write id-token: write
contents: read
steps: steps:
- name: Dump GitHub context - name: Dump GitHub context
env: env:
@ -24,19 +25,15 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.10" python-version-file: ".python-version"
# Issue ref: https://github.com/actions/setup-python/issues/436 # Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip" # cache: "pip"
# cache-dependency-path: pyproject.toml # cache-dependency-path: pyproject.toml
- name: Install build dependencies - name: Install uv
run: pip install build uses: astral-sh/setup-uv@v7
- name: Build distribution - name: Build distribution
run: uv build
env: env:
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
run: python -m build
- name: Publish - name: Publish
uses: pypa/[email protected] run: uv publish
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

11
.github/workflows/smokeshow.yml

@ -8,9 +8,6 @@ on:
permissions: permissions:
statuses: write statuses: write
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
smokeshow: smokeshow:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -23,14 +20,14 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions/setup-python@v6 - uses: actions/setup-python@v6
with: with:
python-version: '3.13' python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
- run: uv pip install -r requirements-github-actions.txt uv.lock
- run: uv sync --locked --no-dev --group github-actions
- uses: actions/download-artifact@v6 - uses: actions/download-artifact@v6
with: with:
name: coverage-html name: coverage-html
@ -41,7 +38,7 @@ jobs:
- name: Upload coverage to Smokeshow - name: Upload coverage to Smokeshow
run: | run: |
for i in 1 2 3 4 5; do for i in 1 2 3 4 5; do
if smokeshow upload htmlcov; then if uv run smokeshow upload htmlcov; then
echo "Smokeshow upload success!" echo "Smokeshow upload success!"
break break
fi fi

12
.github/workflows/sponsors.yml

@ -10,9 +10,6 @@ on:
required: false required: false
default: "false" default: "false"
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
job: job:
if: github.repository_owner == 'fastapi' if: github.repository_owner == 'fastapi'
@ -28,17 +25,16 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-github-actions.txt run: uv sync --locked --no-dev --group github-actions
# Allow debugging with tmate # Allow debugging with tmate
- name: Setup tmate session - name: Setup tmate session
uses: mxschmitt/action-tmate@v3 uses: mxschmitt/action-tmate@v3
@ -46,7 +42,7 @@ jobs:
with: with:
limit-access-to-actor: true limit-access-to-actor: true
- name: FastAPI People Sponsors - name: FastAPI People Sponsors
run: python ./scripts/sponsors.py run: uv run ./scripts/sponsors.py
env: env:
SPONSORS_TOKEN: ${{ secrets.SPONSORS_TOKEN }} SPONSORS_TOKEN: ${{ secrets.SPONSORS_TOKEN }}
PR_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }} PR_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }}

4
.github/workflows/test-redistribute.yml

@ -26,7 +26,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.10" python-version-file: ".python-version"
- name: Install build dependencies - name: Install build dependencies
run: pip install build run: pip install build
- name: Build source distribution - name: Build source distribution
@ -40,7 +40,7 @@ jobs:
- name: Install test dependencies - name: Install test dependencies
run: | run: |
cd dist/fastapi*/ cd dist/fastapi*/
pip install -r requirements-tests.txt pip install --group tests --editable .[all]
env: env:
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
- name: Run source distribution tests - name: Run source distribution tests

26
.github/workflows/test.yml

@ -13,7 +13,7 @@ on:
- cron: "0 0 * * 1" - cron: "0 0 * * 1"
env: env:
UV_SYSTEM_PYTHON: 1 UV_NO_SYNC: true
jobs: jobs:
test: test:
@ -44,6 +44,8 @@ jobs:
coverage: coverage coverage: coverage
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env:
UV_PYTHON: ${{ matrix.python-version }}
steps: steps:
- name: Dump GitHub context - name: Dump GitHub context
env: env:
@ -57,17 +59,16 @@ jobs:
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-tests.txt run: uv sync --locked --no-dev --group tests --extra all
- run: mkdir coverage - run: mkdir coverage
- name: Test - name: Test
if: matrix.codspeed != 'codspeed' if: matrix.codspeed != 'codspeed'
run: bash scripts/test.sh run: uv run bash scripts/test.sh
env: env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
@ -79,7 +80,7 @@ jobs:
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
with: with:
mode: simulation mode: simulation
run: coverage run -m pytest tests/ --codspeed run: uv run coverage run -m pytest tests/ --codspeed
# Do not store coverage for all possible combinations to avoid file size max errors in Smokeshow # Do not store coverage for all possible combinations to avoid file size max errors in Smokeshow
- name: Store coverage files - name: Store coverage files
if: matrix.coverage == 'coverage' if: matrix.coverage == 'coverage'
@ -100,17 +101,16 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions/setup-python@v6 - uses: actions/setup-python@v6
with: with:
python-version: '3.11' python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-tests.txt run: uv sync --locked --no-dev --group tests --extra all
- name: Get coverage files - name: Get coverage files
uses: actions/download-artifact@v6 uses: actions/download-artifact@v6
with: with:
@ -118,15 +118,15 @@ jobs:
path: coverage path: coverage
merge-multiple: true merge-multiple: true
- run: ls -la coverage - run: ls -la coverage
- run: coverage combine coverage - run: uv run coverage combine coverage
- run: coverage html --title "Coverage for ${{ github.sha }}" - run: uv run coverage html --title "Coverage for ${{ github.sha }}"
- name: Store coverage HTML - name: Store coverage HTML
uses: actions/upload-artifact@v5 uses: actions/upload-artifact@v5
with: with:
name: coverage-html name: coverage-html
path: htmlcov path: htmlcov
include-hidden-files: true include-hidden-files: true
- run: coverage report --fail-under=100 - run: uv run coverage report --fail-under=100
# https://github.com/marketplace/actions/alls-green#why # https://github.com/marketplace/actions/alls-green#why
check: # This job does nothing and is only used for the branch protection check: # This job does nothing and is only used for the branch protection

12
.github/workflows/topic-repos.yml

@ -5,9 +5,6 @@ on:
- cron: "0 12 1 * *" - cron: "0 12 1 * *"
workflow_dispatch: workflow_dispatch:
env:
UV_SYSTEM_PYTHON: 1
jobs: jobs:
topic-repos: topic-repos:
if: github.repository_owner == 'fastapi' if: github.repository_owner == 'fastapi'
@ -23,18 +20,17 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
version: "0.4.15"
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install GitHub Actions dependencies - name: Install GitHub Actions dependencies
run: uv pip install -r requirements-github-actions.txt run: uv sync --locked --no-dev --group github-actions
- name: Update Topic Repos - name: Update Topic Repos
run: python ./scripts/topic_repos.py run: uv run ./scripts/topic_repos.py
env: env:
GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }} GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }}

29
.github/workflows/translate.yml

@ -30,9 +30,11 @@ on:
type: string type: string
required: false required: false
default: "" default: ""
commit_in_place:
env: description: Whether to commit changes directly instead of making a PR
UV_SYSTEM_PYTHON: 1 type: boolean
required: false
default: false
jobs: jobs:
langs: langs:
@ -45,20 +47,20 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-github-actions.txt -r requirements-translations.txt run: uv sync --locked --no-dev --group github-actions --group translations
- name: Export Language Codes - name: Export Language Codes
id: show-langs id: show-langs
run: | run: |
echo "langs=$(python ./scripts/translate.py llm-translatable-json)" >> $GITHUB_OUTPUT echo "langs=$(uv run ./scripts/translate.py llm-translatable-json)" >> $GITHUB_OUTPUT
echo "commands=$(python ./scripts/translate.py commands-json)" >> $GITHUB_OUTPUT echo "commands=$(uv run ./scripts/translate.py commands-json)" >> $GITHUB_OUTPUT
env: env:
LANGUAGE: ${{ github.event.inputs.language }} LANGUAGE: ${{ github.event.inputs.language }}
COMMAND: ${{ github.event.inputs.command }} COMMAND: ${{ github.event.inputs.command }}
@ -84,15 +86,15 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v6
with: with:
python-version: "3.11" python-version-file: ".python-version"
- name: Setup uv - name: Setup uv
uses: astral-sh/setup-uv@v7 uses: astral-sh/setup-uv@v7
with: with:
cache-dependency-glob: | cache-dependency-glob: |
requirements**.txt
pyproject.toml pyproject.toml
uv.lock
- name: Install Dependencies - name: Install Dependencies
run: uv pip install -r requirements-github-actions.txt -r requirements-translations.txt run: uv sync --locked --no-dev --group github-actions --group translations
# Allow debugging with tmate # Allow debugging with tmate
- name: Setup tmate session - name: Setup tmate session
uses: mxschmitt/action-tmate@v3 uses: mxschmitt/action-tmate@v3
@ -104,11 +106,12 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: FastAPI Translate - name: FastAPI Translate
run: | run: |
python ./scripts/translate.py ${{ matrix.command }} uv run ./scripts/translate.py ${{ matrix.command }}
python ./scripts/translate.py make-pr uv run ./scripts/translate.py make-pr
env: env:
GITHUB_TOKEN: ${{ secrets.FASTAPI_TRANSLATIONS }} GITHUB_TOKEN: ${{ secrets.FASTAPI_TRANSLATIONS }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGUAGE: ${{ matrix.lang }} LANGUAGE: ${{ matrix.lang }}
EN_PATH: ${{ github.event.inputs.en_path }} EN_PATH: ${{ github.event.inputs.en_path }}
COMMAND: ${{ matrix.command }} COMMAND: ${{ matrix.command }}
COMMIT_IN_PLACE: ${{ github.event.inputs.commit_in_place }}

3
.gitignore

@ -29,7 +29,4 @@ archive.zip
# macOS # macOS
.DS_Store .DS_Store
# Ignore while the setup still depends on requirements.txt files
uv.lock
.codspeed .codspeed

7
.pre-commit-config.yaml

@ -6,6 +6,7 @@ repos:
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
args: ['--maxkb=750'] args: ['--maxkb=750']
exclude: ^uv.lock$
- id: check-toml - id: check-toml
- id: check-yaml - id: check-yaml
args: args:
@ -57,3 +58,9 @@ repos:
entry: uv run ./scripts/docs.py ensure-non-translated entry: uv run ./scripts/docs.py ensure-non-translated
files: ^docs/(?!en/).*|^scripts/docs\.py$ files: ^docs/(?!en/).*|^scripts/docs\.py$
pass_filenames: false pass_filenames: false
- id: fix-translations
language: unsupported
name: fix translations
entry: uv run ./scripts/translation_fixer.py fix-pages
files: ^docs/(?!en/).*/docs/.*\.md$

1
.python-version

@ -0,0 +1 @@
3.11

361
docs/de/llm-prompt.md

@ -4,213 +4,197 @@ Translate to German (Deutsch).
Language code: de. Language code: de.
### Definitions
"hyphen"
The character «-»
Unicode U+002D (HYPHEN-MINUS)
Alternative names: hyphen, dash, minus sign
"dash"
The character «–»
Unicode U+2013 (EN DASH)
German name: Halbgeviertstrich
### Grammar to use when talking to the reader ### Grammar to use when talking to the reader
Use the formal grammar (use «Sie» instead of «Du»). Use the formal grammar (use `Sie` instead of `Du`).
### Quotes ### Quotes
1) Convert neutral double quotes («"») and English double typographic quotes («“» and «”») to German double typographic quotes («„» and «“»). Convert neutral single quotes («'») and English single typographic quotes («‘» and «’») to German single typographic quotes («‚» and «‘»). Do NOT convert «`"» to «„», do NOT convert «"`» to «“». 1) Convert neutral double quotes (`"`) to German double typographic quotes (`„` and `“`). Convert neutral single quotes (`'`) to German single typographic quotes (`‚` and `‘`).
Do NOT convert quotes in code snippets and code blocks to their German typographic equivalents.
Examples: Examples:
Source (English): Source (English):
««« ```
"Hello world" "Hello world"
“Hello Universe” “Hello Universe”
"He said: 'Hello'" "He said: 'Hello'"
“my name is ‘Nils’” “my name is ‘Nils’”
`"__main__"` `"__main__"`
`"items"` `"items"`
»»» ```
Result (German): Result (German):
««« ```
„Hallo Welt“ „Hallo Welt“
„Hallo Universum“ „Hallo Universum“
„Er sagte: ‚Hallo‘“ „Er sagte: ‚Hallo‘“
„Mein Name ist ‚Nils‘“ „Mein Name ist ‚Nils‘“
`"__main__"` `"__main__"`
`"items"` `"items"`
»»» ```
### Ellipsis ### Ellipsis
1) Make sure there is a space between an ellipsis and a word following or preceding the ellipsis. - Make sure there is a space between an ellipsis and a word following or preceding the ellipsis.
Examples: Examples:
Source (English): Source (English):
««« ```
...as we intended. ...as we intended.
...this would work: ...this would work:
...etc. ...etc.
others... others...
More to come... More to come...
»»» ```
Result (German): Result (German):
««« ```
... wie wir es beabsichtigt hatten. ... wie wir es beabsichtigt hatten.
... das würde funktionieren: ... das würde funktionieren:
... usw. ... usw.
Andere ... Andere ...
Später mehr ... Später mehr ...
»»» ```
2) This does not apply in URLs, code blocks, and code snippets. Do not remove or add spaces there.
- This does not apply in URLs, code blocks, and code snippets. Do not remove or add spaces there.
### Headings ### Headings
1) Translate headings using the infinite form. - Translate headings using the infinite form.
Examples: Examples:
Source (English): Source (English):
««« ```
## Create a Project { #create-a-project } ## Create a Project { #create-a-project }
»»» ```
Translate with (German): Result (German):
««« ```
## Ein Projekt erstellen { #create-a-project } ## Ein Projekt erstellen { #create-a-project }
»»» ```
Do NOT translate with (German): Do NOT translate with (German):
««« ```
## Erstellen Sie ein Projekt { #create-a-project } ## Erstellen Sie ein Projekt { #create-a-project }
»»» ```
Source (English): Source (English):
««« ```
# Install Packages { #install-packages } # Install Packages { #install-packages }
»»» ```
Translate with (German): Translate with (German):
««« ```
# Pakete installieren { #install-packages } # Pakete installieren { #install-packages }
»»» ```
Do NOT translate with (German): Do NOT translate with (German):
««« ```
# Installieren Sie Pakete { #install-packages } # Installieren Sie Pakete { #install-packages }
»»» ```
Source (English): Source (English):
««« ```
### Run Your Program { #run-your-program } ### Run Your Program { #run-your-program }
»»» ```
Translate with (German): Translate with (German):
««« ```
### Ihr Programm ausführen { #run-your-program } ### Ihr Programm ausführen { #run-your-program }
»»» ```
Do NOT translate with (German): Do NOT translate with (German):
««« ```
### Führen Sie Ihr Programm aus { #run-your-program } ### Führen Sie Ihr Programm aus { #run-your-program }
»»» ```
2) Make sure that the translated part of the heading does not end with a period. - Make sure that the translated part of the heading does not end with a period.
Example: Example:
Source (English): Source (English):
««« ```
## Another module with `APIRouter` { #another-module-with-apirouter } ## Another module with `APIRouter` { #another-module-with-apirouter }
»»» ```
Translate with (German): Translate with (German):
««« ```
## Ein weiteres Modul mit `APIRouter` { #another-module-with-apirouter } ## Ein weiteres Modul mit `APIRouter` { #another-module-with-apirouter }
»»» ```
Do NOT translate with (German) – notice the added period: Do NOT translate with (German) – notice the added period:
««« ```
## Ein weiteres Modul mit `APIRouter`. { #another-module-with-apirouter } ## Ein weiteres Modul mit `APIRouter`. { #another-module-with-apirouter }
»»» ```
3) Replace occurrences of literal « - » (a space followed by a hyphen followed by a space) with « – » (a space followed by a dash followed by a space) in the translated part of the heading. - Replace occurrences of literal ` - ` (a space followed by a hyphen followed by a space) with ` – ` (a space followed by a dash followed by a space) in the translated part of the heading.
Example: Example:
Source (English): Source (English):
««« ```
# FastAPI in Containers - Docker { #fastapi-in-containers-docker } # FastAPI in Containers - Docker { #fastapi-in-containers-docker }
»»» ```
Translate with (German) – notice the dash: Translate with (German) – notice the dash:
««« ```
# FastAPI in Containern – Docker { #fastapi-in-containers-docker } # FastAPI in Containern – Docker { #fastapi-in-containers-docker }
»»» ```
Do NOT translate with (German) – notice the hyphen: Do NOT translate with (German) – notice the hyphen:
««« ```
# FastAPI in Containern - Docker { #fastapi-in-containers-docker } # FastAPI in Containern - Docker { #fastapi-in-containers-docker }
»»» ```
3.1) Do not apply rule 3 when there is no space before or no space after the hyphen. - Do not apply rule 3 when there is no space before or no space after the hyphen.
Example: Example:
Source (English): Source (English):
««« ```
## Type hints and annotations { #type-hints-and-annotations } ## Type hints and annotations { #type-hints-and-annotations }
»»» ```
Translate with (German) – notice the hyphen: Translate with (German) - notice the hyphen:
««« ```
## Typhinweise und -annotationen { #type-hints-and-annotations } ## Typhinweise und -annotationen { #type-hints-and-annotations }
»»» ```
Do NOT translate with (German) – notice the dash: Do NOT translate with (German) - notice the dash:
««« ```
## Typhinweise und –annotationen { #type-hints-and-annotations } ## Typhinweise und –annotationen { #type-hints-and-annotations }
»»» ```
3.2) Do not apply rule 3 to the untranslated part of the heading inside curly brackets, which you shall not translate.
- Do not modify the hyphens in the content in headers inside of curly braces, which you shall not translate.
### German instructions, when to use and when not to use hyphens in words (written in first person, which is you) ### German instructions, when to use and when not to use hyphens in words (written in first person, which is you).
In der Regel versuche ich so weit wie möglich Worte zusammenzuschreiben, also ohne Bindestrich, es sei denn, es ist Konkretesding-Klassevondingen, etwa «Pydantic-Modell» (aber: «Datenbankmodell»), «Python-Modul» (aber: «Standardmodul»). Ich setze auch einen Bindestrich, wenn er die gleichen Buchstaben verbindet, etwa «Enum-Member», «Cloud-Dienst», «Template-Engine». Oder wenn das Wort sonst einfach zu lang wird, etwa, «Performance-Optimierung». Oder um etwas visuell besser zu dokumentieren, etwa «Pfadoperation-Dekorator», «Pfadoperation-Funktion». In der Regel versuche ich so weit wie möglich Worte zusammenzuschreiben, also ohne Bindestrich, es sei denn, es ist Konkretesding-Klassevondingen, etwa «Pydantic-Modell» (aber: «Datenbankmodell»), «Python-Modul» (aber: «Standardmodul»). Ich setze auch einen Bindestrich, wenn er die gleichen Buchstaben verbindet, etwa «Enum-Member», «Cloud-Dienst», «Template-Engine». Oder wenn das Wort sonst einfach zu lang wird, etwa, «Performance-Optimierung». Oder um etwas visuell besser zu dokumentieren, etwa «Pfadoperation-Dekorator», «Pfadoperation-Funktion».
@ -219,123 +203,122 @@ In der Regel versuche ich so weit wie möglich Worte zusammenzuschreiben, also o
Ich versuche nicht, alles einzudeutschen. Das bezieht sich besonders auf Begriffe aus dem Bereich der Programmierung. Ich wandele zwar korrekt in Großschreibung um und setze Bindestriche, wo notwendig, aber ansonsten lasse ich solch ein Wort unverändert. Beispielsweise wird aus dem englischen Wort «string» in der deutschen Übersetzung «String», aber nicht «Zeichenkette». Oder aus dem englischen Wort «request body» wird in der deutschen Übersetzung «Requestbody», aber nicht «Anfragekörper». Oder aus dem englischen «response» wird im Deutschen «Response», aber nicht «Antwort». Ich versuche nicht, alles einzudeutschen. Das bezieht sich besonders auf Begriffe aus dem Bereich der Programmierung. Ich wandele zwar korrekt in Großschreibung um und setze Bindestriche, wo notwendig, aber ansonsten lasse ich solch ein Wort unverändert. Beispielsweise wird aus dem englischen Wort «string» in der deutschen Übersetzung «String», aber nicht «Zeichenkette». Oder aus dem englischen Wort «request body» wird in der deutschen Übersetzung «Requestbody», aber nicht «Anfragekörper». Oder aus dem englischen «response» wird im Deutschen «Response», aber nicht «Antwort».
### List of English terms and their preferred German translations ### List of English terms and their preferred German translations
Below is a list of English terms and their preferred German translations, separated by a colon («:»). Use these translations, do not use your own. If an existing translation does not use these terms, update it to use them. In the below list, a term or a translation may be followed by an explanation in brackets, which explains when to translate the term this way. If a translation is preceded by «NOT», then that means: do NOT use this translation for this term. English nouns, starting with the word «the», have the German genus – «der», «die», «das» – prepended to their German translation, to help you to grammatically decline them in the translation. They are given in singular case, unless they have «(plural)» attached, which means they are given in plural case. Verbs are given in the full infinitive – starting with the word «to». Below is a list of English terms and their preferred German translations, separated by a colon (:). Use these translations, do not use your own. If an existing translation does not use these terms, update it to use them. In the below list, a term or a translation may be followed by an explanation in brackets, which explains when to translate the term this way. If a translation is preceded by `NOT`, then that means: do NOT use this translation for this term. English nouns, starting with the word `the`, have the German genus – `der`, `die`, `das` – prepended to their German translation, to help you to grammatically decline them in the translation. They are given in singular case, unless they have `(plural)` attached, which means they are given in plural case. Verbs are given in the full infinitive – starting with the word `to`.
* «/// check»: «/// check | Testen» * /// check: /// check | Testen
* «/// danger»: «/// danger | Gefahr» * /// danger: /// danger | Gefahr
* «/// info»: «/// info | Info» * /// info: /// info | Info
* «/// note | Technical Details»: «/// note | Technische Details» * /// note | Technical Details: /// note | Technische Details
* «/// note»: «/// note | Hinweis» * /// note: /// note | Hinweis
* «/// tip»: «/// tip | Tipp» * /// tip: /// tip | Tipp
* «/// warning»: «/// warning | Achtung» * /// warning: /// warning | Achtung
* «you»: «Sie» * you: Sie
* «your»: «Ihr» * your: Ihr
* «e.g»: «z. B.» * e.g: z. B.
* «etc.»: «usw.» * etc.: usw.
* «ref»: «Ref.» * ref: Ref.
* «the Tutorial - User guide»: «das Tutorial – Benutzerhandbuch» * the Tutorial - User guide: das Tutorial – Benutzerhandbuch
* «the Advanced User Guide»: «das Handbuch für fortgeschrittene Benutzer» * the Advanced User Guide: das Handbuch für fortgeschrittene Benutzer
* «the SQLModel docs»: «die SQLModel-Dokumentation» * the SQLModel docs: die SQLModel-Dokumentation
* «the docs»: «die Dokumentation» (use singular case) * the docs: die Dokumentation (use singular case)
* «the env var»: «die Umgebungsvariable» * the env var: die Umgebungsvariable
* «the `PATH` environment variable»: «die `PATH`-Umgebungsvariable» * the `PATH` environment variable: die `PATH`-Umgebungsvariable
* «the `PATH`»: «der `PATH`» * the `PATH`: der `PATH`
* «the `requirements.txt`»: «die `requirements.txt`» * the `requirements.txt`: die `requirements.txt`
* «the API Router»: «der API-Router» * the API Router: der API-Router
* «the Authorization-Header»: «der Autorisierungsheader» * the Authorization-Header: der Autorisierungsheader
* «the `Authorization`-Header»: «der `Authorization`-Header» * the `Authorization`-Header: der `Authorization`-Header
* «the background task»: «der Hintergrundtask» * the background task: der Hintergrundtask
* «the button»: «der Button» * the button: der Button
* «the cloud provider»: «der Cloudanbieter» * the cloud provider: der Cloudanbieter
* «the CLI»: «Das CLI» * the CLI: Das CLI
* «the coverage»: «Die Testabdeckung» * the coverage: Die Testabdeckung
* «the command line interface»: «Das Kommandozeileninterface» * the command line interface: Das Kommandozeileninterface
* «the default value»: «der Defaultwert» * the default value: der Defaultwert
* «the default value»: NOT «der Standardwert» * the default value: NOT der Standardwert
* «the default declaration»: «die Default-Deklaration» * the default declaration: die Default-Deklaration
* «the deployment»: «das Deployment» * the deployment: das Deployment
* «the dict»: «das Dict» * the dict: das Dict
* «the dictionary»: «das Dictionary» * the dictionary: das Dictionary
* «the enumeration»: «die Enumeration» * the enumeration: die Enumeration
* «the enum»: «das Enum» * the enum: das Enum
* «the engine»: «die Engine» * the engine: die Engine
* «the error response»: «die Error-Response» * the error response: die Error-Response
* «the event»: «das Event» * the event: das Event
* «the exception»: «die Exception» * the exception: die Exception
* «the exception handler»: «der Exceptionhandler» * the exception handler: der Exceptionhandler
* «the form model»: «das Formularmodell» * the form model: das Formularmodell
* «the form body»: «der Formularbody» * the form body: der Formularbody
* «the header»: «der Header» * the header: der Header
* «the headers» (plural): «die Header» * the headers (plural): die Header
* «in headers» (plural): «in Headern» * in headers (plural): in Headern
* «the forwarded header»: «der Forwarded-Header» * the forwarded header: der Forwarded-Header
* «the lifespan event»: «das Lifespan-Event» * the lifespan event: das Lifespan-Event
* «the lock»: «der Lock» * the lock: der Lock
* «the locking»: «das Locking» * the locking: das Locking
* «the mobile application»: «die Mobile-Anwendung» * the mobile application: die Mobile-Anwendung
* «the model object»: «das Modellobjekt» * the model object: das Modellobjekt
* «the mounting»: «das Mounten» * the mounting: das Mounten
* «mounted»: «gemountet» * mounted: gemountet
* «the origin»: «das Origin» * the origin: das Origin
* «the override»: «Die Überschreibung» * the override: Die Überschreibung
* «the parameter»: «der Parameter» * the parameter: der Parameter
* «the parameters» (plural): «die Parameter» * the parameters (plural): die Parameter
* «the function parameter»: «der Funktionsparameter» * the function parameter: der Funktionsparameter
* «the default parameter»: «der Defaultparameter» * the default parameter: der Defaultparameter
* «the body parameter»: «der Body-Parameter» * the body parameter: der Body-Parameter
* «the request body parameter»: «der Requestbody-Parameter» * the request body parameter: der Requestbody-Parameter
* «the path parameter»: «der Pfad-Parameter» * the path parameter: der Pfad-Parameter
* «the query parameter»: «der Query-Parameter» * the query parameter: der Query-Parameter
* «the cookie parameter»: «der Cookie-Parameter» * the cookie parameter: der Cookie-Parameter
* «the header parameter»: «der Header-Parameter» * the header parameter: der Header-Parameter
* «the form parameter»: «der Formular-Parameter» * the form parameter: der Formular-Parameter
* «the payload»: «die Payload» * the payload: die Payload
* «the performance»: NOT «die Performance» * the performance: NOT die Performance
* «the query»: «die Query» * the query: die Query
* «the recap»: «die Zusammenfassung» * the recap: die Zusammenfassung
* «the request» (what the client sends to the server): «der Request» * the request (what the client sends to the server): der Request
* «the request body»: «der Requestbody» * the request body: der Requestbody
* «the request bodies» (plural): «die Requestbodys» * the request bodies (plural): die Requestbodys
* «the response» (what the server sends back to the client): «die Response» * the response (what the server sends back to the client): die Response
* «the return type»: «der Rückgabetyp» * the return type: der Rückgabetyp
* «the return value»: «der Rückgabewert» * the return value: der Rückgabewert
* «the startup» (the event of the app): «der Startup» * the startup (the event of the app): der Startup
* «the shutdown» (the event of the app): «der Shutdown» * the shutdown (the event of the app): der Shutdown
* «the startup event»: «das Startup-Event» * the startup event: das Startup-Event
* «the shutdown event»: «das Shutdown-Event» * the shutdown event: das Shutdown-Event
* «the startup» (of the server): «das Hochfahren» * the startup (of the server): das Hochfahren
* «the startup» (the company): «das Startup» * the startup (the company): das Startup
* «the SDK»: «das SDK» * the SDK: das SDK
* «the tag»: «der Tag» * the tag: der Tag
* «the type annotation»: «die Typannotation» * the type annotation: die Typannotation
* «the type hint»: «der Typhinweis» * the type hint: der Typhinweis
* «the wildcard»: «die Wildcard» * the wildcard: die Wildcard
* «the worker class»: «die Workerklasse» * the worker class: die Workerklasse
* «the worker class»: NOT «die Arbeiterklasse» * the worker class: NOT die Arbeiterklasse
* «the worker process»: «der Workerprozess» * the worker process: der Workerprozess
* «the worker process»: NOT «der Arbeiterprozess» * the worker process: NOT der Arbeiterprozess
* «to commit»: «committen» * to commit: committen
* «to deploy» (in the cloud): «deployen» * to deploy (in the cloud): deployen
* «to modify»: «ändern» * to modify: ändern
* «to serve» (an application): «bereitstellen» * to serve (an application): bereitstellen
* «to serve» (a response): «ausliefern» * to serve (a response): ausliefern
* «to serve»: NOT «bedienen» * to serve: NOT bedienen
* «to upgrade»: «aktualisieren» * to upgrade: aktualisieren
* «to wrap»: «wrappen» * to wrap: wrappen
* «to wrap»: NOT «hüllen» * to wrap: NOT hüllen
* «`foo` as a `type`»: «`foo` vom Typ `type`» * `foo` as a `type`: `foo` vom Typ `type`
* «`foo` as a `type`»: «`foo`, ein `type`» * `foo` as a `type`: `foo`, ein `type`
* «FastAPI's X»: «FastAPIs X» * FastAPI's X: FastAPIs X
* «Starlette's Y»: «Starlettes Y» * Starlette's Y: Starlettes Y
* «X is case-sensitive»: «Groß-/Klein­schrei­bung ist relevant in X» * X is case-sensitive: Groß-/Klein­schrei­bung ist relevant in X
* «X is case-insensitive»: «Groß-/Klein­schrei­bung ist nicht relevant in X» * X is case-insensitive: Groß-/Klein­schrei­bung ist nicht relevant in X
* «standard Python»: «Standard-Python» * standard Python: Standard-Python
* «deprecated»: «deprecatet» * deprecated: deprecatet
### Other rules ### Other rules
Preserve indentation. Keep emoticons. Encode in utf-8. Use Linux line breaks (LF). Preserve indentation. Keep emojis. Encode in utf-8. Use Linux line breaks (LF).

29
docs/en/data/contributors.yml

@ -1,6 +1,6 @@
tiangolo: tiangolo:
login: tiangolo login: tiangolo
count: 808 count: 857
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:
@ -10,7 +10,7 @@ dependabot:
url: https://github.com/apps/dependabot url: https://github.com/apps/dependabot
alejsdev: alejsdev:
login: alejsdev login: alejsdev
count: 52 count: 53
avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=85ceac49fb87138aebe8d663912e359447329090&v=4 avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=85ceac49fb87138aebe8d663912e359447329090&v=4
url: https://github.com/alejsdev url: https://github.com/alejsdev
pre-commit-ci: pre-commit-ci:
@ -18,6 +18,11 @@ pre-commit-ci:
count: 50 count: 50
avatarUrl: https://avatars.githubusercontent.com/in/68672?v=4 avatarUrl: https://avatars.githubusercontent.com/in/68672?v=4
url: https://github.com/apps/pre-commit-ci url: https://github.com/apps/pre-commit-ci
YuriiMotov:
login: YuriiMotov
count: 36
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=b9b13d598dddfab529a52d264df80a900bfe7060&v=4
url: https://github.com/YuriiMotov
github-actions: github-actions:
login: github-actions login: github-actions
count: 26 count: 26
@ -28,26 +33,21 @@ Kludex:
count: 25 count: 25
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: 20
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=b9b13d598dddfab529a52d264df80a900bfe7060&v=4
url: https://github.com/YuriiMotov
dmontagu: dmontagu:
login: dmontagu login: dmontagu
count: 17 count: 17
avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4 avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4
url: https://github.com/dmontagu url: https://github.com/dmontagu
svlandeg:
login: svlandeg
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/8796347?u=556c97650c27021911b0b9447ec55e75987b0e8a&v=4
url: https://github.com/svlandeg
nilslindemann: nilslindemann:
login: nilslindemann login: nilslindemann
count: 15 count: 15
avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4 avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
url: https://github.com/nilslindemann url: https://github.com/nilslindemann
svlandeg:
login: svlandeg
count: 14
avatarUrl: https://avatars.githubusercontent.com/u/8796347?u=556c97650c27021911b0b9447ec55e75987b0e8a&v=4
url: https://github.com/svlandeg
euri10: euri10:
login: euri10 login: euri10
count: 13 count: 13
@ -553,6 +553,11 @@ DanielKusyDev:
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/36250676?u=2ea6114ff751fc48b55f231987a0e2582c6b1bd2&v=4 avatarUrl: https://avatars.githubusercontent.com/u/36250676?u=2ea6114ff751fc48b55f231987a0e2582c6b1bd2&v=4
url: https://github.com/DanielKusyDev url: https://github.com/DanielKusyDev
Viicos:
login: Viicos
count: 2
avatarUrl: https://avatars.githubusercontent.com/u/65306057?u=fcd677dc1b9bef12aa103613e5ccb3f8ce305af9&v=4
url: https://github.com/Viicos
DanielYang59: DanielYang59:
login: DanielYang59 login: DanielYang59
count: 2 count: 2

431
docs/en/data/github_sponsors.yml

@ -2,57 +2,51 @@ sponsors:
- - login: renderinc - - login: renderinc
avatarUrl: https://avatars.githubusercontent.com/u/36424661?v=4 avatarUrl: https://avatars.githubusercontent.com/u/36424661?v=4
url: https://github.com/renderinc url: https://github.com/renderinc
- login: andrew-propelauth
avatarUrl: https://avatars.githubusercontent.com/u/89474256?u=c98993dec8553c09d424ede67bbe86e5c35f48c9&v=4
url: https://github.com/andrew-propelauth
- login: blockbee-io
avatarUrl: https://avatars.githubusercontent.com/u/115143449?u=1b8620c2d6567c4df2111a371b85a51f448f9b85&v=4
url: https://github.com/blockbee-io
- login: zuplo
avatarUrl: https://avatars.githubusercontent.com/u/85497839?v=4
url: https://github.com/zuplo
- login: coderabbitai
avatarUrl: https://avatars.githubusercontent.com/u/132028505?v=4
url: https://github.com/coderabbitai
- login: greptileai
avatarUrl: https://avatars.githubusercontent.com/u/140149887?v=4
url: https://github.com/greptileai
- login: subtotal - login: subtotal
avatarUrl: https://avatars.githubusercontent.com/u/176449348?v=4 avatarUrl: https://avatars.githubusercontent.com/u/176449348?v=4
url: https://github.com/subtotal url: https://github.com/subtotal
- login: greptileai
avatarUrl: https://avatars.githubusercontent.com/u/140149887?v=4
url: https://github.com/greptileai
- login: coderabbitai
avatarUrl: https://avatars.githubusercontent.com/u/132028505?v=4
url: https://github.com/coderabbitai
- login: zuplo
avatarUrl: https://avatars.githubusercontent.com/u/85497839?v=4
url: https://github.com/zuplo
- login: blockbee-io
avatarUrl: https://avatars.githubusercontent.com/u/115143449?u=1b8620c2d6567c4df2111a371b85a51f448f9b85&v=4
url: https://github.com/blockbee-io
- login: andrew-propelauth
avatarUrl: https://avatars.githubusercontent.com/u/89474256?u=c98993dec8553c09d424ede67bbe86e5c35f48c9&v=4
url: https://github.com/andrew-propelauth
- login: railwayapp - login: railwayapp
avatarUrl: https://avatars.githubusercontent.com/u/66716858?v=4 avatarUrl: https://avatars.githubusercontent.com/u/66716858?v=4
url: https://github.com/railwayapp url: https://github.com/railwayapp
- - login: dribia - - login: speakeasy-api
avatarUrl: https://avatars.githubusercontent.com/u/41189616?v=4 avatarUrl: https://avatars.githubusercontent.com/u/91446104?v=4
url: https://github.com/dribia url: https://github.com/speakeasy-api
- login: svix
avatarUrl: https://avatars.githubusercontent.com/u/80175132?v=4
url: https://github.com/svix
- login: stainless-api - login: stainless-api
avatarUrl: https://avatars.githubusercontent.com/u/88061651?v=4 avatarUrl: https://avatars.githubusercontent.com/u/88061651?v=4
url: https://github.com/stainless-api url: https://github.com/stainless-api
- login: speakeasy-api - login: svix
avatarUrl: https://avatars.githubusercontent.com/u/91446104?v=4 avatarUrl: https://avatars.githubusercontent.com/u/80175132?v=4
url: https://github.com/speakeasy-api url: https://github.com/svix
- login: databento
avatarUrl: https://avatars.githubusercontent.com/u/64141749?v=4
url: https://github.com/databento
- login: permitio - login: permitio
avatarUrl: https://avatars.githubusercontent.com/u/71775833?v=4 avatarUrl: https://avatars.githubusercontent.com/u/71775833?v=4
url: https://github.com/permitio url: https://github.com/permitio
- - login: Ponte-Energy-Partners - login: databento
avatarUrl: https://avatars.githubusercontent.com/u/114745848?v=4 avatarUrl: https://avatars.githubusercontent.com/u/64141749?v=4
url: https://github.com/Ponte-Energy-Partners url: https://github.com/databento
- login: LambdaTest-Inc - - login: LambdaTest-Inc
avatarUrl: https://avatars.githubusercontent.com/u/171592363?u=96606606a45fa170427206199014f2a5a2a4920b&v=4 avatarUrl: https://avatars.githubusercontent.com/u/171592363?u=96606606a45fa170427206199014f2a5a2a4920b&v=4
url: https://github.com/LambdaTest-Inc url: https://github.com/LambdaTest-Inc
- login: Ponte-Energy-Partners
avatarUrl: https://avatars.githubusercontent.com/u/114745848?v=4
url: https://github.com/Ponte-Energy-Partners
- login: BoostryJP - login: BoostryJP
avatarUrl: https://avatars.githubusercontent.com/u/57932412?v=4 avatarUrl: https://avatars.githubusercontent.com/u/57932412?v=4
url: https://github.com/BoostryJP url: https://github.com/BoostryJP
- login: requestly
avatarUrl: https://avatars.githubusercontent.com/u/12287519?v=4
url: https://github.com/requestly
- login: acsone - login: acsone
avatarUrl: https://avatars.githubusercontent.com/u/7601056?v=4 avatarUrl: https://avatars.githubusercontent.com/u/7601056?v=4
url: https://github.com/acsone url: https://github.com/acsone
@ -68,9 +62,6 @@ sponsors:
- login: Doist - login: Doist
avatarUrl: https://avatars.githubusercontent.com/u/2565372?v=4 avatarUrl: https://avatars.githubusercontent.com/u/2565372?v=4
url: https://github.com/Doist url: https://github.com/Doist
- login: bholagabbar
avatarUrl: https://avatars.githubusercontent.com/u/11693595?v=4
url: https://github.com/bholagabbar
- - login: mainframeindustries - - login: mainframeindustries
avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4 avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4
url: https://github.com/mainframeindustries url: https://github.com/mainframeindustries
@ -86,6 +77,9 @@ sponsors:
- login: ChargeStorm - login: ChargeStorm
avatarUrl: https://avatars.githubusercontent.com/u/26000165?v=4 avatarUrl: https://avatars.githubusercontent.com/u/26000165?v=4
url: https://github.com/ChargeStorm url: https://github.com/ChargeStorm
- login: ibrahimpelumi6142
avatarUrl: https://avatars.githubusercontent.com/u/113442282?v=4
url: https://github.com/ibrahimpelumi6142
- login: nilslindemann - login: nilslindemann
avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4 avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
url: https://github.com/nilslindemann url: https://github.com/nilslindemann
@ -116,124 +110,127 @@ sponsors:
- login: Leay15 - login: Leay15
avatarUrl: https://avatars.githubusercontent.com/u/32212558?u=c4aa9c1737e515959382a5515381757b1fd86c53&v=4 avatarUrl: https://avatars.githubusercontent.com/u/32212558?u=c4aa9c1737e515959382a5515381757b1fd86c53&v=4
url: https://github.com/Leay15 url: https://github.com/Leay15
- login: Karine-Bauch
avatarUrl: https://avatars.githubusercontent.com/u/90465103?u=7feb1018abb1a5631cfd9a91fea723d1ceb5f49b&v=4
url: https://github.com/Karine-Bauch
- login: jugeeem - login: jugeeem
avatarUrl: https://avatars.githubusercontent.com/u/116043716?u=ae590d79c38ac79c91b9c5caa6887d061e865a3d&v=4 avatarUrl: https://avatars.githubusercontent.com/u/116043716?u=ae590d79c38ac79c91b9c5caa6887d061e865a3d&v=4
url: https://github.com/jugeeem url: https://github.com/jugeeem
- login: patsatsia - login: Karine-Bauch
avatarUrl: https://avatars.githubusercontent.com/u/61111267?u=3271b85f7a37b479c8d0ae0a235182e83c166edf&v=4 avatarUrl: https://avatars.githubusercontent.com/u/90465103?u=7feb1018abb1a5631cfd9a91fea723d1ceb5f49b&v=4
url: https://github.com/patsatsia url: https://github.com/Karine-Bauch
- login: anthonycepeda
avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=60bdf46240cff8fca482ff0fc07d963fd5e1a27c&v=4
url: https://github.com/anthonycepeda
- login: patricioperezv
avatarUrl: https://avatars.githubusercontent.com/u/73832292?u=5f471f156e19ee7920e62ae0f4a47b95580e61cf&v=4
url: https://github.com/patricioperezv
- login: chickenandstats
avatarUrl: https://avatars.githubusercontent.com/u/79477966?u=ae2b894aa954070db1d7830dab99b49eba4e4567&v=4
url: https://github.com/chickenandstats
- login: kaoru0310 - login: kaoru0310
avatarUrl: https://avatars.githubusercontent.com/u/80977929?u=1b61d10142b490e56af932ddf08a390fae8ee94f&v=4 avatarUrl: https://avatars.githubusercontent.com/u/80977929?u=1b61d10142b490e56af932ddf08a390fae8ee94f&v=4
url: https://github.com/kaoru0310 url: https://github.com/kaoru0310
- login: jstanden - login: chickenandstats
avatarUrl: https://avatars.githubusercontent.com/u/63288?u=c3658d57d2862c607a0e19c2101c3c51876e36ad&v=4 avatarUrl: https://avatars.githubusercontent.com/u/79477966?u=ae2b894aa954070db1d7830dab99b49eba4e4567&v=4
url: https://github.com/jstanden url: https://github.com/chickenandstats
- login: knallgelb - login: patricioperezv
avatarUrl: https://avatars.githubusercontent.com/u/2358812?u=c48cb6362b309d74cbf144bd6ad3aed3eb443e82&v=4 avatarUrl: https://avatars.githubusercontent.com/u/73832292?u=5f471f156e19ee7920e62ae0f4a47b95580e61cf&v=4
url: https://github.com/knallgelb url: https://github.com/patricioperezv
- login: dblackrun - login: anthonycepeda
avatarUrl: https://avatars.githubusercontent.com/u/3528486?v=4 avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=60bdf46240cff8fca482ff0fc07d963fd5e1a27c&v=4
url: https://github.com/dblackrun url: https://github.com/anthonycepeda
- login: zsinx6 - login: AalbatrossGuy
avatarUrl: https://avatars.githubusercontent.com/u/3532625?u=ba75a5dc744d1116ccfeaaf30d41cb2fe81fe8dd&v=4 avatarUrl: https://avatars.githubusercontent.com/u/68378354?u=0bdeea9356d24f638244131f6d8d1e2d2f3601ca&v=4
url: https://github.com/zsinx6 url: https://github.com/AalbatrossGuy
- login: kennywakeland - login: patsatsia
avatarUrl: https://avatars.githubusercontent.com/u/3631417?u=7c8f743f1ae325dfadea7c62bbf1abd6a824fc55&v=4 avatarUrl: https://avatars.githubusercontent.com/u/61111267?u=3271b85f7a37b479c8d0ae0a235182e83c166edf&v=4
url: https://github.com/kennywakeland url: https://github.com/patsatsia
- login: aacayaco
avatarUrl: https://avatars.githubusercontent.com/u/3634801?u=eaadda178c964178fcb64886f6c732172c8f8219&v=4
url: https://github.com/aacayaco
- login: anomaly
avatarUrl: https://avatars.githubusercontent.com/u/3654837?v=4
url: https://github.com/anomaly
- login: mj0331
avatarUrl: https://avatars.githubusercontent.com/u/3890353?u=1c627ac1a024515b4871de5c3ebbfaa1a57f65d4&v=4
url: https://github.com/mj0331
- login: gorhack
avatarUrl: https://avatars.githubusercontent.com/u/4141690?u=ec119ebc4bdf00a7bc84657a71aa17834f4f27f3&v=4
url: https://github.com/gorhack
- login: Ryandaydev
avatarUrl: https://avatars.githubusercontent.com/u/4292423?u=679ff84cb7b988c5795a5fa583857f574a055763&v=4
url: https://github.com/Ryandaydev
- login: jaredtrog
avatarUrl: https://avatars.githubusercontent.com/u/4381365?v=4
url: https://github.com/jaredtrog
- login: oliverxchen - login: oliverxchen
avatarUrl: https://avatars.githubusercontent.com/u/4471774?u=534191f25e32eeaadda22dfab4b0a428733d5489&v=4 avatarUrl: https://avatars.githubusercontent.com/u/4471774?u=534191f25e32eeaadda22dfab4b0a428733d5489&v=4
url: https://github.com/oliverxchen url: https://github.com/oliverxchen
- login: paulcwatts - login: jaredtrog
avatarUrl: https://avatars.githubusercontent.com/u/150269?u=1819e145d573b44f0ad74b87206d21cd60331d4e&v=4 avatarUrl: https://avatars.githubusercontent.com/u/4381365?v=4
url: https://github.com/paulcwatts url: https://github.com/jaredtrog
- login: robintw - login: Ryandaydev
avatarUrl: https://avatars.githubusercontent.com/u/296686?v=4 avatarUrl: https://avatars.githubusercontent.com/u/4292423?u=679ff84cb7b988c5795a5fa583857f574a055763&v=4
url: https://github.com/robintw url: https://github.com/Ryandaydev
- login: pamelafox - login: gorhack
avatarUrl: https://avatars.githubusercontent.com/u/297042?v=4 avatarUrl: https://avatars.githubusercontent.com/u/4141690?u=ec119ebc4bdf00a7bc84657a71aa17834f4f27f3&v=4
url: https://github.com/pamelafox url: https://github.com/gorhack
- login: wshayes - login: mj0331
avatarUrl: https://avatars.githubusercontent.com/u/365303?u=07ca03c5ee811eb0920e633cc3c3db73dbec1aa5&v=4 avatarUrl: https://avatars.githubusercontent.com/u/3890353?u=1c627ac1a024515b4871de5c3ebbfaa1a57f65d4&v=4
url: https://github.com/wshayes url: https://github.com/mj0331
- login: koxudaxi - login: anomaly
avatarUrl: https://avatars.githubusercontent.com/u/630670?u=507d8577b4b3670546b449c4c2ccbc5af40d72f7&v=4 avatarUrl: https://avatars.githubusercontent.com/u/3654837?v=4
url: https://github.com/koxudaxi url: https://github.com/anomaly
- login: falkben - login: aacayaco
avatarUrl: https://avatars.githubusercontent.com/u/653031?u=ad9838e089058c9e5a0bab94c0eec7cc181e0cd0&v=4 avatarUrl: https://avatars.githubusercontent.com/u/3634801?u=eaadda178c964178fcb64886f6c732172c8f8219&v=4
url: https://github.com/falkben url: https://github.com/aacayaco
- login: mintuhouse - login: kennywakeland
avatarUrl: https://avatars.githubusercontent.com/u/769950?u=ecfbd79a97d33177e0d093ddb088283cf7fe8444&v=4 avatarUrl: https://avatars.githubusercontent.com/u/3631417?u=7c8f743f1ae325dfadea7c62bbf1abd6a824fc55&v=4
url: https://github.com/mintuhouse url: https://github.com/kennywakeland
- login: zsinx6
avatarUrl: https://avatars.githubusercontent.com/u/3532625?u=ba75a5dc744d1116ccfeaaf30d41cb2fe81fe8dd&v=4
url: https://github.com/zsinx6
- login: dblackrun
avatarUrl: https://avatars.githubusercontent.com/u/3528486?v=4
url: https://github.com/dblackrun
- login: knallgelb
avatarUrl: https://avatars.githubusercontent.com/u/2358812?u=c48cb6362b309d74cbf144bd6ad3aed3eb443e82&v=4
url: https://github.com/knallgelb
- login: dodo5522 - login: dodo5522
avatarUrl: https://avatars.githubusercontent.com/u/1362607?u=9bf1e0e520cccc547c046610c468ce6115bbcf9f&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1362607?u=9bf1e0e520cccc547c046610c468ce6115bbcf9f&v=4
url: https://github.com/dodo5522 url: https://github.com/dodo5522
- login: wdwinslow - login: mintuhouse
avatarUrl: https://avatars.githubusercontent.com/u/11562137?u=371272f2c69e680e0559a7b0a57385e83a5dc728&v=4 avatarUrl: https://avatars.githubusercontent.com/u/769950?u=ecfbd79a97d33177e0d093ddb088283cf7fe8444&v=4
url: https://github.com/wdwinslow url: https://github.com/mintuhouse
- login: jsoques - login: falkben
avatarUrl: https://avatars.githubusercontent.com/u/12414216?u=620921d94196546cc8b9eae2cc4cbc3f95bab42f&v=4 avatarUrl: https://avatars.githubusercontent.com/u/653031?u=ad9838e089058c9e5a0bab94c0eec7cc181e0cd0&v=4
url: https://github.com/jsoques url: https://github.com/falkben
- login: dannywade - login: koxudaxi
avatarUrl: https://avatars.githubusercontent.com/u/13680237?u=418ee985bd41577b20fde81417fb2d901e875e8a&v=4 avatarUrl: https://avatars.githubusercontent.com/u/630670?u=507d8577b4b3670546b449c4c2ccbc5af40d72f7&v=4
url: https://github.com/dannywade url: https://github.com/koxudaxi
- login: khadrawy - login: wshayes
avatarUrl: https://avatars.githubusercontent.com/u/13686061?u=59f25ef42ecf04c22657aac4238ce0e2d3d30304&v=4 avatarUrl: https://avatars.githubusercontent.com/u/365303?u=07ca03c5ee811eb0920e633cc3c3db73dbec1aa5&v=4
url: https://github.com/khadrawy url: https://github.com/wshayes
- login: mjohnsey - login: pamelafox
avatarUrl: https://avatars.githubusercontent.com/u/16784016?u=38fad2e6b411244560b3af99c5f5a4751bc81865&v=4 avatarUrl: https://avatars.githubusercontent.com/u/297042?v=4
url: https://github.com/mjohnsey url: https://github.com/pamelafox
- login: ashi-agrawal - login: robintw
avatarUrl: https://avatars.githubusercontent.com/u/17105294?u=99c7a854035e5398d8e7b674f2d42baae6c957f8&v=4 avatarUrl: https://avatars.githubusercontent.com/u/296686?v=4
url: https://github.com/ashi-agrawal url: https://github.com/robintw
- login: jstanden
avatarUrl: https://avatars.githubusercontent.com/u/63288?u=c3658d57d2862c607a0e19c2101c3c51876e36ad&v=4
url: https://github.com/jstanden
- login: RaamEEIL - login: RaamEEIL
avatarUrl: https://avatars.githubusercontent.com/u/20320552?v=4 avatarUrl: https://avatars.githubusercontent.com/u/20320552?v=4
url: https://github.com/RaamEEIL url: https://github.com/RaamEEIL
- login: ternaus - login: ashi-agrawal
avatarUrl: https://avatars.githubusercontent.com/u/5481618?u=513a26b02a39e7a28d587cd37c6cc877ea368e6e&v=4 avatarUrl: https://avatars.githubusercontent.com/u/17105294?u=99c7a854035e5398d8e7b674f2d42baae6c957f8&v=4
url: https://github.com/ternaus url: https://github.com/ashi-agrawal
- login: eseglem - login: mjohnsey
avatarUrl: https://avatars.githubusercontent.com/u/5920492?u=208d419cf667b8ac594c82a8db01932c7e50d057&v=4 avatarUrl: https://avatars.githubusercontent.com/u/16784016?u=38fad2e6b411244560b3af99c5f5a4751bc81865&v=4
url: https://github.com/eseglem url: https://github.com/mjohnsey
- login: FernandoCelmer - login: khadrawy
avatarUrl: https://avatars.githubusercontent.com/u/6262214?u=58ba6d5888fa7f355934e52db19f950e20b38162&v=4 avatarUrl: https://avatars.githubusercontent.com/u/13686061?u=59f25ef42ecf04c22657aac4238ce0e2d3d30304&v=4
url: https://github.com/FernandoCelmer url: https://github.com/khadrawy
- login: Rehket - login: dannywade
avatarUrl: https://avatars.githubusercontent.com/u/7015688?u=3afb0ba200feebbc7f958950e92db34df2a3c172&v=4 avatarUrl: https://avatars.githubusercontent.com/u/13680237?u=418ee985bd41577b20fde81417fb2d901e875e8a&v=4
url: https://github.com/Rehket url: https://github.com/dannywade
- login: jsoques
avatarUrl: https://avatars.githubusercontent.com/u/12414216?u=620921d94196546cc8b9eae2cc4cbc3f95bab42f&v=4
url: https://github.com/jsoques
- login: wdwinslow
avatarUrl: https://avatars.githubusercontent.com/u/11562137?u=371272f2c69e680e0559a7b0a57385e83a5dc728&v=4
url: https://github.com/wdwinslow
- login: hiancdtrsnm - login: hiancdtrsnm
avatarUrl: https://avatars.githubusercontent.com/u/7343177?v=4 avatarUrl: https://avatars.githubusercontent.com/u/7343177?v=4
url: https://github.com/hiancdtrsnm url: https://github.com/hiancdtrsnm
- - login: manoelpqueiroz - login: Rehket
avatarUrl: https://avatars.githubusercontent.com/u/7015688?u=3afb0ba200feebbc7f958950e92db34df2a3c172&v=4
url: https://github.com/Rehket
- login: FernandoCelmer
avatarUrl: https://avatars.githubusercontent.com/u/6262214?u=58ba6d5888fa7f355934e52db19f950e20b38162&v=4
url: https://github.com/FernandoCelmer
- login: eseglem
avatarUrl: https://avatars.githubusercontent.com/u/5920492?u=208d419cf667b8ac594c82a8db01932c7e50d057&v=4
url: https://github.com/eseglem
- login: ternaus
avatarUrl: https://avatars.githubusercontent.com/u/5481618?u=513a26b02a39e7a28d587cd37c6cc877ea368e6e&v=4
url: https://github.com/ternaus
- - login: Artur-Galstyan
avatarUrl: https://avatars.githubusercontent.com/u/63471891?u=e8691f386037e51a737cc0ba866cd8c89e5cf109&v=4
url: https://github.com/Artur-Galstyan
- login: manoelpqueiroz
avatarUrl: https://avatars.githubusercontent.com/u/23669137?u=b12e84b28a84369ab5b30bd5a79e5788df5a0756&v=4 avatarUrl: https://avatars.githubusercontent.com/u/23669137?u=b12e84b28a84369ab5b30bd5a79e5788df5a0756&v=4
url: https://github.com/manoelpqueiroz url: https://github.com/manoelpqueiroz
- - login: pawamoy - - login: pawamoy
@ -254,9 +251,12 @@ sponsors:
- login: hgalytoby - login: hgalytoby
avatarUrl: https://avatars.githubusercontent.com/u/50397689?u=6cc9028f3db63f8f60ad21c17b1ce4b88c4e2e60&v=4 avatarUrl: https://avatars.githubusercontent.com/u/50397689?u=6cc9028f3db63f8f60ad21c17b1ce4b88c4e2e60&v=4
url: https://github.com/hgalytoby url: https://github.com/hgalytoby
- login: nisutec - login: johnl28
avatarUrl: https://avatars.githubusercontent.com/u/25281462?u=e562484c451fdfc59053163f64405f8eb262b8b0&v=4 avatarUrl: https://avatars.githubusercontent.com/u/54412955?u=47dd06082d1c39caa90c752eb55566e4f3813957&v=4
url: https://github.com/nisutec url: https://github.com/johnl28
- login: danielunderwood
avatarUrl: https://avatars.githubusercontent.com/u/4472301?v=4
url: https://github.com/danielunderwood
- login: hoenie-ams - login: hoenie-ams
avatarUrl: https://avatars.githubusercontent.com/u/25708487?u=cda07434f0509ac728d9edf5e681117c0f6b818b&v=4 avatarUrl: https://avatars.githubusercontent.com/u/25708487?u=cda07434f0509ac728d9edf5e681117c0f6b818b&v=4
url: https://github.com/hoenie-ams url: https://github.com/hoenie-ams
@ -267,93 +267,87 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/33275230?u=eb223cad27017bb1e936ee9b429b450d092d0236&v=4 avatarUrl: https://avatars.githubusercontent.com/u/33275230?u=eb223cad27017bb1e936ee9b429b450d092d0236&v=4
url: https://github.com/engineerjoe440 url: https://github.com/engineerjoe440
- login: bnkc - login: bnkc
avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=db5e6f4f87836cad26c2aa90ce390ce49041c5a9&v=4 avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=4771ac4e64066f0847d40e5b29910adabd9b2372&v=4
url: https://github.com/bnkc url: https://github.com/bnkc
- login: petercool - login: petercool
avatarUrl: https://avatars.githubusercontent.com/u/37613029?u=75aa8c6729e6e8f85a300561c4dbeef9d65c8797&v=4 avatarUrl: https://avatars.githubusercontent.com/u/37613029?u=75aa8c6729e6e8f85a300561c4dbeef9d65c8797&v=4
url: https://github.com/petercool url: https://github.com/petercool
- login: johnl28
avatarUrl: https://avatars.githubusercontent.com/u/54412955?u=47dd06082d1c39caa90c752eb55566e4f3813957&v=4
url: https://github.com/johnl28
- login: PunRabbit
avatarUrl: https://avatars.githubusercontent.com/u/70463212?u=1a835cfbc99295a60c8282f6aa6199d1b42241a5&v=4
url: https://github.com/PunRabbit
- login: PelicanQ - login: PelicanQ
avatarUrl: https://avatars.githubusercontent.com/u/77930606?v=4 avatarUrl: https://avatars.githubusercontent.com/u/77930606?v=4
url: https://github.com/PelicanQ url: https://github.com/PelicanQ
- login: WillHogan - login: PunRabbit
avatarUrl: https://avatars.githubusercontent.com/u/1661551?u=8a80356e3e7d5a417157aba7ea565dabc8678327&v=4 avatarUrl: https://avatars.githubusercontent.com/u/70463212?u=1a835cfbc99295a60c8282f6aa6199d1b42241a5&v=4
url: https://github.com/WillHogan url: https://github.com/PunRabbit
- login: my3 - login: my3
avatarUrl: https://avatars.githubusercontent.com/u/1825270?v=4 avatarUrl: https://avatars.githubusercontent.com/u/1825270?v=4
url: https://github.com/my3 url: https://github.com/my3
- login: danielunderwood - login: WillHogan
avatarUrl: https://avatars.githubusercontent.com/u/4472301?v=4 avatarUrl: https://avatars.githubusercontent.com/u/1661551?u=8a80356e3e7d5a417157aba7ea565dabc8678327&v=4
url: https://github.com/danielunderwood url: https://github.com/WillHogan
- login: ddanier
avatarUrl: https://avatars.githubusercontent.com/u/113563?u=ed1dc79de72f93bd78581f88ebc6952b62f472da&v=4
url: https://github.com/ddanier
- login: bryanculbertson
avatarUrl: https://avatars.githubusercontent.com/u/144028?u=defda4f90e93429221cc667500944abde60ebe4a&v=4
url: https://github.com/bryanculbertson
- login: slafs
avatarUrl: https://avatars.githubusercontent.com/u/210173?v=4
url: https://github.com/slafs
- login: ceb10n
avatarUrl: https://avatars.githubusercontent.com/u/235213?u=edcce471814a1eba9f0cdaa4cd0de18921a940a6&v=4
url: https://github.com/ceb10n
- login: tochikuji
avatarUrl: https://avatars.githubusercontent.com/u/851759?v=4
url: https://github.com/tochikuji
- login: miguelgr - login: miguelgr
avatarUrl: https://avatars.githubusercontent.com/u/1484589?u=54556072b8136efa12ae3b6902032ea2a39ace4b&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1484589?u=54556072b8136efa12ae3b6902032ea2a39ace4b&v=4
url: https://github.com/miguelgr url: https://github.com/miguelgr
- login: xncbf - login: tochikuji
avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=a80a7bb349555b277645632ed66639ff43400614&v=4 avatarUrl: https://avatars.githubusercontent.com/u/851759?v=4
url: https://github.com/xncbf url: https://github.com/tochikuji
- login: DMantis - login: ceb10n
avatarUrl: https://avatars.githubusercontent.com/u/9536869?u=652dd0d49717803c0cbcbf44f7740e53cf2d4892&v=4 avatarUrl: https://avatars.githubusercontent.com/u/235213?u=edcce471814a1eba9f0cdaa4cd0de18921a940a6&v=4
url: https://github.com/DMantis url: https://github.com/ceb10n
- login: hard-coders - login: slafs
avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4 avatarUrl: https://avatars.githubusercontent.com/u/210173?v=4
url: https://github.com/hard-coders url: https://github.com/slafs
- login: mntolia - login: bryanculbertson
avatarUrl: https://avatars.githubusercontent.com/u/10390224?v=4 avatarUrl: https://avatars.githubusercontent.com/u/144028?u=defda4f90e93429221cc667500944abde60ebe4a&v=4
url: https://github.com/mntolia url: https://github.com/bryanculbertson
- login: Zuzah - login: ddanier
avatarUrl: https://avatars.githubusercontent.com/u/10934846?u=1ef43e075ddc87bd1178372bf4d95ee6175cae27&v=4 avatarUrl: https://avatars.githubusercontent.com/u/113563?u=ed1dc79de72f93bd78581f88ebc6952b62f472da&v=4
url: https://github.com/Zuzah url: https://github.com/ddanier
- login: TheR1D - login: nisutec
avatarUrl: https://avatars.githubusercontent.com/u/16740832?u=b0dfdbdb27b79729430c71c6128962f77b7b53f7&v=4 avatarUrl: https://avatars.githubusercontent.com/u/25281462?u=e562484c451fdfc59053163f64405f8eb262b8b0&v=4
url: https://github.com/TheR1D url: https://github.com/nisutec
- login: joshuatz - login: joshuatz
avatarUrl: https://avatars.githubusercontent.com/u/17817563?u=f1bf05b690d1fc164218f0b420cdd3acb7913e21&v=4 avatarUrl: https://avatars.githubusercontent.com/u/17817563?u=f1bf05b690d1fc164218f0b420cdd3acb7913e21&v=4
url: https://github.com/joshuatz url: https://github.com/joshuatz
- login: rangulvers - login: TheR1D
avatarUrl: https://avatars.githubusercontent.com/u/5235430?u=e254d4af4ace5a05fa58372ae677c7d26f0d5a53&v=4 avatarUrl: https://avatars.githubusercontent.com/u/16740832?u=b0dfdbdb27b79729430c71c6128962f77b7b53f7&v=4
url: https://github.com/rangulvers url: https://github.com/TheR1D
- login: sdevkota - login: Zuzah
avatarUrl: https://avatars.githubusercontent.com/u/5250987?u=4ed9a120c89805a8aefda1cbdc0cf6512e64d1b4&v=4 avatarUrl: https://avatars.githubusercontent.com/u/10934846?u=1ef43e075ddc87bd1178372bf4d95ee6175cae27&v=4
url: https://github.com/sdevkota url: https://github.com/Zuzah
- login: Baghdady92 - login: mntolia
avatarUrl: https://avatars.githubusercontent.com/u/5708590?v=4 avatarUrl: https://avatars.githubusercontent.com/u/10390224?v=4
url: https://github.com/Baghdady92 url: https://github.com/mntolia
- login: KentShikama - login: hard-coders
avatarUrl: https://avatars.githubusercontent.com/u/6329898?u=8b236810db9b96333230430837e1f021f9246da1&v=4 avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=78d12d1acdf853c817700145e73de7fd9e5d068b&v=4
url: https://github.com/KentShikama url: https://github.com/hard-coders
- login: katnoria - login: DMantis
avatarUrl: https://avatars.githubusercontent.com/u/7674948?u=09767eb13e07e09496c5fee4e5ce21d9eac34a56&v=4 avatarUrl: https://avatars.githubusercontent.com/u/9536869?u=652dd0d49717803c0cbcbf44f7740e53cf2d4892&v=4
url: https://github.com/katnoria url: https://github.com/DMantis
- login: harsh183 - login: xncbf
avatarUrl: https://avatars.githubusercontent.com/u/7780198?v=4 avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=a80a7bb349555b277645632ed66639ff43400614&v=4
url: https://github.com/harsh183 url: https://github.com/xncbf
- login: moonape1226 - login: moonape1226
avatarUrl: https://avatars.githubusercontent.com/u/8532038?u=d9f8b855a429fff9397c3833c2ff83849ebf989d&v=4 avatarUrl: https://avatars.githubusercontent.com/u/8532038?u=d9f8b855a429fff9397c3833c2ff83849ebf989d&v=4
url: https://github.com/moonape1226 url: https://github.com/moonape1226
- - login: andrecorumba - login: harsh183
avatarUrl: https://avatars.githubusercontent.com/u/37807517?u=9b9be3b41da9bda60957da9ef37b50dbf65baa61&v=4 avatarUrl: https://avatars.githubusercontent.com/u/7780198?v=4
url: https://github.com/andrecorumba url: https://github.com/harsh183
- login: KOZ39 - login: katnoria
avatarUrl: https://avatars.githubusercontent.com/u/7674948?u=09767eb13e07e09496c5fee4e5ce21d9eac34a56&v=4
url: https://github.com/katnoria
- login: KentShikama
avatarUrl: https://avatars.githubusercontent.com/u/6329898?u=8b236810db9b96333230430837e1f021f9246da1&v=4
url: https://github.com/KentShikama
- login: Baghdady92
avatarUrl: https://avatars.githubusercontent.com/u/5708590?v=4
url: https://github.com/Baghdady92
- login: sdevkota
avatarUrl: https://avatars.githubusercontent.com/u/5250987?u=4ed9a120c89805a8aefda1cbdc0cf6512e64d1b4&v=4
url: https://github.com/sdevkota
- login: rangulvers
avatarUrl: https://avatars.githubusercontent.com/u/5235430?u=e254d4af4ace5a05fa58372ae677c7d26f0d5a53&v=4
url: https://github.com/rangulvers
- - login: KOZ39
avatarUrl: https://avatars.githubusercontent.com/u/38822500?u=9dfc0a697df1c9628f08e20dc3fb17b1afc4e5a7&v=4 avatarUrl: https://avatars.githubusercontent.com/u/38822500?u=9dfc0a697df1c9628f08e20dc3fb17b1afc4e5a7&v=4
url: https://github.com/KOZ39 url: https://github.com/KOZ39
- login: rwxd - login: rwxd
@ -365,27 +359,24 @@ sponsors:
- login: Olegt0rr - login: Olegt0rr
avatarUrl: https://avatars.githubusercontent.com/u/25399456?u=3e87b5239a2f4600975ba13be73054f8567c6060&v=4 avatarUrl: https://avatars.githubusercontent.com/u/25399456?u=3e87b5239a2f4600975ba13be73054f8567c6060&v=4
url: https://github.com/Olegt0rr url: https://github.com/Olegt0rr
- login: dinoz0rg
avatarUrl: https://avatars.githubusercontent.com/u/32940067?u=739cda1eb123a2dd5e1db45c361396f239e23f8b&v=4
url: https://github.com/dinoz0rg
- login: larsyngvelundin - login: larsyngvelundin
avatarUrl: https://avatars.githubusercontent.com/u/34173819?u=74958599695bf83ac9f1addd935a51548a10c6b0&v=4 avatarUrl: https://avatars.githubusercontent.com/u/34173819?u=74958599695bf83ac9f1addd935a51548a10c6b0&v=4
url: https://github.com/larsyngvelundin url: https://github.com/larsyngvelundin
- login: hippoley - login: andrecorumba
avatarUrl: https://avatars.githubusercontent.com/u/135493401?u=1164ef48a645a7c12664fabc1638fbb7e1c459b0&v=4 avatarUrl: https://avatars.githubusercontent.com/u/37807517?u=9b9be3b41da9bda60957da9ef37b50dbf65baa61&v=4
url: https://github.com/hippoley url: https://github.com/andrecorumba
- login: 4anklee
avatarUrl: https://avatars.githubusercontent.com/u/144109238?u=a79c0d581b2a3d8f3897e7ef4c012640a6c1eb3a&v=4
url: https://github.com/4anklee
- login: CoderDeltaLAN - login: CoderDeltaLAN
avatarUrl: https://avatars.githubusercontent.com/u/152043745?u=4ff541efffb7d134e60c5fcf2dd1e343f90bb782&v=4 avatarUrl: https://avatars.githubusercontent.com/u/152043745?u=4ff541efffb7d134e60c5fcf2dd1e343f90bb782&v=4
url: https://github.com/CoderDeltaLAN url: https://github.com/CoderDeltaLAN
- login: onestn - login: hippoley
avatarUrl: https://avatars.githubusercontent.com/u/62360849?u=746dd21c34e7e06eefb11b03e8bb01aaae3c2a4f&v=4 avatarUrl: https://avatars.githubusercontent.com/u/135493401?u=1164ef48a645a7c12664fabc1638fbb7e1c459b0&v=4
url: https://github.com/onestn url: https://github.com/hippoley
- login: nayasinghania - login: nayasinghania
avatarUrl: https://avatars.githubusercontent.com/u/74111380?u=752e99a5e139389fdc0a0677122adc08438eb076&v=4 avatarUrl: https://avatars.githubusercontent.com/u/74111380?u=752e99a5e139389fdc0a0677122adc08438eb076&v=4
url: https://github.com/nayasinghania url: https://github.com/nayasinghania
- login: onestn
avatarUrl: https://avatars.githubusercontent.com/u/62360849?u=746dd21c34e7e06eefb11b03e8bb01aaae3c2a4f&v=4
url: https://github.com/onestn
- login: Toothwitch - login: Toothwitch
avatarUrl: https://avatars.githubusercontent.com/u/1710406?u=5eebb23b46cd26e48643b9e5179536cad491c17a&v=4 avatarUrl: https://avatars.githubusercontent.com/u/1710406?u=5eebb23b46cd26e48643b9e5179536cad491c17a&v=4
url: https://github.com/Toothwitch url: https://github.com/Toothwitch

442
docs/en/data/topic_repos.yml

@ -1,495 +1,495 @@
- 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: 39475 stars: 40334
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: 33090 stars: 33628
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: 21798 stars: 21817
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: 20258 stars: 20409
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: 17212 stars: 17415
owner_login: fastapi owner_login: fastapi
owner_html_url: https://github.com/fastapi owner_html_url: https://github.com/fastapi
- name: Douyin_TikTok_Download_API
html_url: https://github.com/Evil0ctal/Douyin_TikTok_Download_API
stars: 15145
owner_login: Evil0ctal
owner_html_url: https://github.com/Evil0ctal
- 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: 14644 stars: 15776
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
html_url: https://github.com/Evil0ctal/Douyin_TikTok_Download_API
stars: 15588
owner_login: Evil0ctal
owner_html_url: https://github.com/Evil0ctal
- name: machine-learning-zoomcamp - name: machine-learning-zoomcamp
html_url: https://github.com/DataTalksClub/machine-learning-zoomcamp html_url: https://github.com/DataTalksClub/machine-learning-zoomcamp
stars: 12320 stars: 12447
owner_login: DataTalksClub owner_login: DataTalksClub
owner_html_url: https://github.com/DataTalksClub owner_html_url: https://github.com/DataTalksClub
- name: fastapi_mcp
html_url: https://github.com/tadata-org/fastapi_mcp
stars: 11174
owner_login: tadata-org
owner_html_url: https://github.com/tadata-org
- name: SurfSense - name: SurfSense
html_url: https://github.com/MODSetter/SurfSense html_url: https://github.com/MODSetter/SurfSense
stars: 10858 stars: 12128
owner_login: MODSetter owner_login: MODSetter
owner_html_url: https://github.com/MODSetter owner_html_url: https://github.com/MODSetter
- name: fastapi_mcp
html_url: https://github.com/tadata-org/fastapi_mcp
stars: 11326
owner_login: 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: 10758 stars: 10901
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: 9313 stars: 9584
owner_login: JoeanAmier owner_login: JoeanAmier
owner_html_url: https://github.com/JoeanAmier owner_html_url: https://github.com/JoeanAmier
- name: FastUI
html_url: https://github.com/pydantic/FastUI
stars: 8915
owner_login: pydantic
owner_html_url: https://github.com/pydantic
- name: polar - name: polar
html_url: https://github.com/polarsource/polar html_url: https://github.com/polarsource/polar
stars: 8339 stars: 8951
owner_login: polarsource owner_login: polarsource
owner_html_url: https://github.com/polarsource owner_html_url: https://github.com/polarsource
- name: FastUI
html_url: https://github.com/pydantic/FastUI
stars: 8934
owner_login: 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: 7721 stars: 7934
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: 7170 stars: 7248
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: 6253 stars: 6392
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: 5849 stars: 5899
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: 5756 stars: 5754
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: 4569 stars: 4577
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: chatgpt-web-share
html_url: https://github.com/chatpire/chatgpt-web-share
stars: 4294
owner_login: chatpire
owner_html_url: https://github.com/chatpire
- name: poem - name: poem
html_url: https://github.com/poem-web/poem html_url: https://github.com/poem-web/poem
stars: 4276 stars: 4303
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
html_url: https://github.com/chatpire/chatgpt-web-share
stars: 4287
owner_login: 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: 4202 stars: 4221
owner_login: dynaconf owner_login: dynaconf
owner_html_url: https://github.com/dynaconf owner_html_url: https://github.com/dynaconf
- name: atrilabs-engine
html_url: https://github.com/Atri-Labs/atrilabs-engine
stars: 4093
owner_login: Atri-Labs
owner_html_url: https://github.com/Atri-Labs
- name: Kokoro-FastAPI - name: Kokoro-FastAPI
html_url: https://github.com/remsky/Kokoro-FastAPI html_url: https://github.com/remsky/Kokoro-FastAPI
stars: 4019 stars: 4181
owner_login: remsky owner_login: remsky
owner_html_url: https://github.com/remsky owner_html_url: https://github.com/remsky
- name: atrilabs-engine
html_url: https://github.com/Atri-Labs/atrilabs-engine
stars: 4090
owner_login: 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: 3805 stars: 3896
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: 3719 stars: 3756
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: fastapi-admin
html_url: https://github.com/fastapi-admin/fastapi-admin
stars: 3632
owner_login: fastapi-admin
owner_html_url: https://github.com/fastapi-admin
- name: datamodel-code-generator
html_url: https://github.com/koxudaxi/datamodel-code-generator
stars: 3609
owner_login: koxudaxi
owner_html_url: https://github.com/koxudaxi
- name: huma - name: huma
html_url: https://github.com/danielgtaylor/huma html_url: https://github.com/danielgtaylor/huma
stars: 3603 stars: 3702
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
html_url: https://github.com/koxudaxi/datamodel-code-generator
stars: 3675
owner_login: koxudaxi
owner_html_url: https://github.com/koxudaxi
- name: fastapi-admin
html_url: https://github.com/fastapi-admin/fastapi-admin
stars: 3659
owner_login: 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: 3490 stars: 3497
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: 3379 stars: 3421
owner_login: TracecatHQ owner_login: TracecatHQ
owner_html_url: https://github.com/TracecatHQ owner_html_url: https://github.com/TracecatHQ
- name: opyrator - name: opyrator
html_url: https://github.com/ml-tooling/opyrator html_url: https://github.com/ml-tooling/opyrator
stars: 3135 stars: 3136
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
html_url: https://github.com/docarray/docarray html_url: https://github.com/docarray/docarray
stars: 3114 stars: 3111
owner_login: docarray owner_login: docarray
owner_html_url: https://github.com/docarray owner_html_url: https://github.com/docarray
- name: devpush
html_url: https://github.com/hunvreus/devpush
stars: 3097
owner_login: hunvreus
owner_html_url: https://github.com/hunvreus
- 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: 3050 stars: 3051
owner_login: nsidnev owner_login: nsidnev
owner_html_url: https://github.com/nsidnev owner_html_url: https://github.com/nsidnev
- name: uvicorn-gunicorn-fastapi-docker
html_url: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker
stars: 2911
owner_login: tiangolo
owner_html_url: https://github.com/tiangolo
- name: mcp-context-forge - name: mcp-context-forge
html_url: https://github.com/IBM/mcp-context-forge html_url: https://github.com/IBM/mcp-context-forge
stars: 2899 stars: 3034
owner_login: IBM owner_login: IBM
owner_html_url: https://github.com/IBM owner_html_url: https://github.com/IBM
- name: best-of-web-python - name: uvicorn-gunicorn-fastapi-docker
html_url: https://github.com/ml-tooling/best-of-web-python html_url: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker
stars: 2648 stars: 2904
owner_login: ml-tooling owner_login: tiangolo
owner_html_url: https://github.com/ml-tooling 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: 2637 stars: 2680
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
html_url: https://github.com/ml-tooling/best-of-web-python
stars: 2662
owner_login: 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: 2599 stars: 2614
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: fastapi-react
html_url: https://github.com/Buuntu/fastapi-react
stars: 2569
owner_login: Buuntu
owner_html_url: https://github.com/Buuntu
- name: Yuxi-Know
html_url: https://github.com/xerrors/Yuxi-Know
stars: 2563
owner_login: xerrors
owner_html_url: https://github.com/xerrors
- name: sqladmin - name: sqladmin
html_url: https://github.com/aminalaee/sqladmin html_url: https://github.com/aminalaee/sqladmin
stars: 2558 stars: 2587
owner_login: aminalaee owner_login: aminalaee
owner_html_url: https://github.com/aminalaee owner_html_url: https://github.com/aminalaee
- name: fastapi-react
html_url: https://github.com/Buuntu/fastapi-react
stars: 2566
owner_login: 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: 2451 stars: 2456
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: 2344 stars: 2394
owner_login: supabase owner_login: supabase
owner_html_url: https://github.com/supabase owner_html_url: https://github.com/supabase
- name: nextpy - name: nextpy
html_url: https://github.com/dot-agent/nextpy html_url: https://github.com/dot-agent/nextpy
stars: 2335 stars: 2338
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: 2291 stars: 2289
owner_login: fastapiutils owner_login: fastapiutils
owner_html_url: https://github.com/fastapiutils owner_html_url: https://github.com/fastapiutils
- name: 30-Days-of-Python
html_url: https://github.com/codingforentrepreneurs/30-Days-of-Python
stars: 2220
owner_login: codingforentrepreneurs
owner_html_url: https://github.com/codingforentrepreneurs
- name: langserve - name: langserve
html_url: https://github.com/langchain-ai/langserve html_url: https://github.com/langchain-ai/langserve
stars: 2215 stars: 2234
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
html_url: https://github.com/codingforentrepreneurs/30-Days-of-Python
stars: 2232
owner_login: codingforentrepreneurs
owner_html_url: https://github.com/codingforentrepreneurs
- name: solara - name: solara
html_url: https://github.com/widgetti/solara html_url: https://github.com/widgetti/solara
stars: 2122 stars: 2141
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: 2029 stars: 2046
owner_login: Kludex owner_login: Kludex
owner_html_url: https://github.com/Kludex owner_html_url: https://github.com/Kludex
- name: fastapi_best_architecture
html_url: https://github.com/fastapi-practices/fastapi_best_architecture
stars: 1963
owner_login: 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 - name: agentkit
html_url: https://github.com/BCG-X-Official/agentkit html_url: https://github.com/BCG-X-Official/agentkit
stars: 1912 stars: 1936
owner_login: BCG-X-Official owner_login: BCG-X-Official
owner_html_url: https://github.com/BCG-X-Official owner_html_url: https://github.com/BCG-X-Official
- name: vue-fastapi-admin
html_url: https://github.com/mizhexiaoxiao/vue-fastapi-admin
stars: 1909
owner_login: mizhexiaoxiao
owner_html_url: https://github.com/mizhexiaoxiao
- name: manage-fastapi - name: manage-fastapi
html_url: https://github.com/ycd/manage-fastapi html_url: https://github.com/ycd/manage-fastapi
stars: 1885 stars: 1887
owner_login: ycd owner_login: ycd
owner_html_url: https://github.com/ycd owner_html_url: https://github.com/ycd
- 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: 1862 stars: 1879
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: slowapi
html_url: https://github.com/laurentS/slowapi
stars: 1845
owner_login: 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: 1836 stars: 1843
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: vue-fastapi-admin
html_url: https://github.com/mizhexiaoxiao/vue-fastapi-admin
stars: 1831
owner_login: mizhexiaoxiao
owner_html_url: https://github.com/mizhexiaoxiao
- 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: 1817 stars: 1813
owner_login: rochacbruno owner_login: rochacbruno
owner_html_url: https://github.com/rochacbruno owner_html_url: https://github.com/rochacbruno
- name: slowapi
html_url: https://github.com/laurentS/slowapi
stars: 1798
owner_login: laurentS
owner_html_url: https://github.com/laurentS
- name: fastapi-cache - name: fastapi-cache
html_url: https://github.com/long2ice/fastapi-cache html_url: https://github.com/long2ice/fastapi-cache
stars: 1789 stars: 1805
owner_login: long2ice owner_login: long2ice
owner_html_url: https://github.com/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: 1783 stars: 1785
owner_login: collerek owner_login: collerek
owner_html_url: https://github.com/collerek owner_html_url: https://github.com/collerek
- name: termpair
html_url: https://github.com/cs01/termpair
stars: 1716
owner_login: cs01
owner_html_url: https://github.com/cs01
- name: FastAPI-boilerplate
html_url: https://github.com/benavlabs/FastAPI-boilerplate
stars: 1660
owner_login: benavlabs
owner_html_url: https://github.com/benavlabs
- name: fastapi-langgraph-agent-production-ready-template - name: fastapi-langgraph-agent-production-ready-template
html_url: https://github.com/wassim249/fastapi-langgraph-agent-production-ready-template html_url: https://github.com/wassim249/fastapi-langgraph-agent-production-ready-template
stars: 1638 stars: 1780
owner_login: wassim249 owner_login: wassim249
owner_html_url: https://github.com/wassim249 owner_html_url: https://github.com/wassim249
- name: FastAPI-boilerplate
html_url: https://github.com/benavlabs/FastAPI-boilerplate
stars: 1734
owner_login: benavlabs
owner_html_url: https://github.com/benavlabs
- name: termpair
html_url: https://github.com/cs01/termpair
stars: 1724
owner_login: cs01
owner_html_url: https://github.com/cs01
- name: fastapi-crudrouter
html_url: https://github.com/awtkns/fastapi-crudrouter
stars: 1671
owner_login: 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: 1635 stars: 1633
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: awesome-fastapi-projects
html_url: https://github.com/Kludex/awesome-fastapi-projects
stars: 1589
owner_login: Kludex
owner_html_url: https://github.com/Kludex
- name: fastapi-pagination - name: fastapi-pagination
html_url: https://github.com/uriyyo/fastapi-pagination html_url: https://github.com/uriyyo/fastapi-pagination
stars: 1585 stars: 1588
owner_login: uriyyo owner_login: uriyyo
owner_html_url: https://github.com/uriyyo owner_html_url: https://github.com/uriyyo
- name: awesome-fastapi-projects
html_url: https://github.com/Kludex/awesome-fastapi-projects
stars: 1583
owner_login: Kludex
owner_html_url: https://github.com/Kludex
- name: coronavirus-tracker-api - name: coronavirus-tracker-api
html_url: https://github.com/ExpDev07/coronavirus-tracker-api html_url: https://github.com/ExpDev07/coronavirus-tracker-api
stars: 1574 stars: 1571
owner_login: ExpDev07 owner_login: ExpDev07
owner_html_url: https://github.com/ExpDev07 owner_html_url: https://github.com/ExpDev07
- name: fastapi-crudrouter
html_url: https://github.com/awtkns/fastapi-crudrouter
stars: 1559
owner_login: awtkns
owner_html_url: https://github.com/awtkns
- name: bracket - name: bracket
html_url: https://github.com/evroon/bracket html_url: https://github.com/evroon/bracket
stars: 1489 stars: 1549
owner_login: evroon owner_login: evroon
owner_html_url: https://github.com/evroon owner_html_url: https://github.com/evroon
- 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: 1475 stars: 1491
owner_login: amisadmin owner_login: amisadmin
owner_html_url: https://github.com/amisadmin owner_html_url: https://github.com/amisadmin
- name: fastapi-boilerplate - name: fastapi-boilerplate
html_url: https://github.com/teamhide/fastapi-boilerplate html_url: https://github.com/teamhide/fastapi-boilerplate
stars: 1436 stars: 1452
owner_login: teamhide owner_login: teamhide
owner_html_url: https://github.com/teamhide owner_html_url: https://github.com/teamhide
- name: awesome-python-resources
html_url: https://github.com/DjangoEx/awesome-python-resources
stars: 1426
owner_login: DjangoEx
owner_html_url: https://github.com/DjangoEx
- name: fastcrud - name: fastcrud
html_url: https://github.com/benavlabs/fastcrud html_url: https://github.com/benavlabs/fastcrud
stars: 1414 stars: 1452
owner_login: benavlabs owner_login: benavlabs
owner_html_url: https://github.com/benavlabs owner_html_url: https://github.com/benavlabs
- name: awesome-python-resources
html_url: https://github.com/DjangoEx/awesome-python-resources
stars: 1430
owner_login: 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: 1388 stars: 1399
owner_login: trallnag owner_login: trallnag
owner_html_url: https://github.com/trallnag owner_html_url: https://github.com/trallnag
- name: fastapi_best_architecture
html_url: https://github.com/fastapi-practices/fastapi_best_architecture
stars: 1378
owner_login: fastapi-practices
owner_html_url: https://github.com/fastapi-practices
- 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: 1375 stars: 1371
owner_login: koxudaxi owner_login: koxudaxi
owner_html_url: https://github.com/koxudaxi owner_html_url: https://github.com/koxudaxi
- name: fastapi-tutorial
html_url: https://github.com/liaogx/fastapi-tutorial
stars: 1346
owner_login: 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: 1345
owner_login: ebhy owner_login: ebhy
owner_html_url: https://github.com/ebhy owner_html_url: https://github.com/ebhy
- name: fastapi-tutorial
html_url: https://github.com/liaogx/fastapi-tutorial
stars: 1327
owner_login: liaogx
owner_html_url: https://github.com/liaogx
- name: fastapi-alembic-sqlmodel-async
html_url: https://github.com/jonra1993/fastapi-alembic-sqlmodel-async
stars: 1259
owner_login: jonra1993
owner_html_url: https://github.com/jonra1993
- name: fastapi-scaff - name: fastapi-scaff
html_url: https://github.com/atpuxiner/fastapi-scaff html_url: https://github.com/atpuxiner/fastapi-scaff
stars: 1255 stars: 1331
owner_login: atpuxiner owner_login: atpuxiner
owner_html_url: https://github.com/atpuxiner owner_html_url: https://github.com/atpuxiner
- name: bedrock-chat
html_url: https://github.com/aws-samples/bedrock-chat
stars: 1254
owner_login: aws-samples
owner_html_url: https://github.com/aws-samples
- name: bolt-python - name: bolt-python
html_url: https://github.com/slackapi/bolt-python html_url: https://github.com/slackapi/bolt-python
stars: 1253 stars: 1266
owner_login: slackapi owner_login: slackapi
owner_html_url: https://github.com/slackapi owner_html_url: https://github.com/slackapi
- name: bedrock-chat
html_url: https://github.com/aws-samples/bedrock-chat
stars: 1266
owner_login: aws-samples
owner_html_url: https://github.com/aws-samples
- name: fastapi-alembic-sqlmodel-async
html_url: https://github.com/jonra1993/fastapi-alembic-sqlmodel-async
stars: 1260
owner_login: jonra1993
owner_html_url: https://github.com/jonra1993
- 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: 1217 stars: 1222
owner_login: zhanymkanov owner_login: zhanymkanov
owner_html_url: https://github.com/zhanymkanov owner_html_url: https://github.com/zhanymkanov
- name: langchain-extract - name: langchain-extract
html_url: https://github.com/langchain-ai/langchain-extract html_url: https://github.com/langchain-ai/langchain-extract
stars: 1176 stars: 1179
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: restish - name: restish
html_url: https://github.com/rest-sh/restish html_url: https://github.com/rest-sh/restish
stars: 1140 stars: 1152
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: odmantic - name: odmantic
html_url: https://github.com/art049/odmantic html_url: https://github.com/art049/odmantic
stars: 1138 stars: 1143
owner_login: art049 owner_login: art049
owner_html_url: https://github.com/art049 owner_html_url: https://github.com/art049
- name: authx - name: authx
html_url: https://github.com/yezz123/authx html_url: https://github.com/yezz123/authx
stars: 1119 stars: 1128
owner_login: yezz123 owner_login: yezz123
owner_html_url: https://github.com/yezz123 owner_html_url: https://github.com/yezz123
- name: NoteDiscovery - name: SAG
html_url: https://github.com/gamosoft/NoteDiscovery html_url: https://github.com/Zleap-AI/SAG
stars: 1107 stars: 1104
owner_login: gamosoft owner_login: Zleap-AI
owner_html_url: https://github.com/gamosoft owner_html_url: https://github.com/Zleap-AI
- name: aktools
html_url: https://github.com/akfamily/aktools
stars: 1072
owner_login: akfamily
owner_html_url: https://github.com/akfamily
- name: RuoYi-Vue3-FastAPI
html_url: https://github.com/insistence/RuoYi-Vue3-FastAPI
stars: 1063
owner_login: insistence
owner_html_url: https://github.com/insistence
- name: flock - name: flock
html_url: https://github.com/Onelevenvy/flock html_url: https://github.com/Onelevenvy/flock
stars: 1055 stars: 1059
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: 1038 stars: 1046
owner_login: blueswen owner_login: blueswen
owner_html_url: https://github.com/blueswen owner_html_url: https://github.com/blueswen
- name: aktools - name: enterprise-deep-research
html_url: https://github.com/akfamily/aktools html_url: https://github.com/SalesforceAIResearch/enterprise-deep-research
stars: 1027 stars: 1019
owner_login: akfamily owner_login: SalesforceAIResearch
owner_html_url: https://github.com/akfamily owner_html_url: https://github.com/SalesforceAIResearch
- name: RuoYi-Vue3-FastAPI - name: titiler
html_url: https://github.com/insistence/RuoYi-Vue3-FastAPI html_url: https://github.com/developmentseed/titiler
stars: 1016 stars: 1016
owner_login: insistence owner_login: developmentseed
owner_html_url: https://github.com/insistence owner_html_url: https://github.com/developmentseed
- name: every-pdf
html_url: https://github.com/DDULDDUCK/every-pdf
stars: 1004
owner_login: 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: 1002 stars: 1003
owner_login: viddexa owner_login: viddexa
owner_html_url: https://github.com/viddexa owner_html_url: https://github.com/viddexa
- name: titiler
html_url: https://github.com/developmentseed/titiler
stars: 999
owner_login: developmentseed
owner_html_url: https://github.com/developmentseed
- name: lanarky - name: lanarky
html_url: https://github.com/ajndkr/lanarky html_url: https://github.com/ajndkr/lanarky
stars: 994 stars: 996
owner_login: ajndkr owner_login: ajndkr
owner_html_url: https://github.com/ajndkr owner_html_url: https://github.com/ajndkr
- name: every-pdf
html_url: https://github.com/DDULDDUCK/every-pdf
stars: 985
owner_login: DDULDDUCK
owner_html_url: https://github.com/DDULDDUCK
- name: enterprise-deep-research
html_url: https://github.com/SalesforceAIResearch/enterprise-deep-research
stars: 973
owner_login: SalesforceAIResearch
owner_html_url: https://github.com/SalesforceAIResearch
- name: fastapi-mail
html_url: https://github.com/sabuhish/fastapi-mail
stars: 964
owner_login: sabuhish
owner_html_url: https://github.com/sabuhish

146
docs/en/data/translation_reviewers.yml

@ -15,7 +15,7 @@ sodaMelon:
url: https://github.com/sodaMelon url: https://github.com/sodaMelon
ceb10n: ceb10n:
login: ceb10n login: ceb10n
count: 116 count: 117
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:
@ -23,16 +23,16 @@ tokusumi:
count: 104 count: 104
avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4 avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4
url: https://github.com/tokusumi url: https://github.com/tokusumi
hard-coders:
login: hard-coders
count: 96
avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=78d12d1acdf853c817700145e73de7fd9e5d068b&v=4
url: https://github.com/hard-coders
hasansezertasan: hasansezertasan:
login: hasansezertasan login: hasansezertasan
count: 95 count: 95
avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4 avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
url: https://github.com/hasansezertasan url: https://github.com/hasansezertasan
hard-coders:
login: hard-coders
count: 93
avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4
url: https://github.com/hard-coders
alv2017: alv2017:
login: alv2017 login: alv2017
count: 88 count: 88
@ -40,7 +40,7 @@ alv2017:
url: https://github.com/alv2017 url: https://github.com/alv2017
nazarepiedady: nazarepiedady:
login: nazarepiedady login: nazarepiedady
count: 86 count: 87
avatarUrl: https://avatars.githubusercontent.com/u/31008635?u=f69ddc4ea8bda3bdfac7aa0e2ea38de282e6ee2d&v=4 avatarUrl: https://avatars.githubusercontent.com/u/31008635?u=f69ddc4ea8bda3bdfac7aa0e2ea38de282e6ee2d&v=4
url: https://github.com/nazarepiedady url: https://github.com/nazarepiedady
AlertRED: AlertRED:
@ -48,6 +48,11 @@ AlertRED:
count: 81 count: 81
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
tiangolo:
login: tiangolo
count: 73
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4
url: https://github.com/tiangolo
Alexandrhub: Alexandrhub:
login: Alexandrhub login: Alexandrhub
count: 68 count: 68
@ -63,21 +68,16 @@ cassiobotaro:
count: 62 count: 62
avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=a08022b191ddbd0a6159b2981d9d878b6d5bb71f&v=4 avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=a08022b191ddbd0a6159b2981d9d878b6d5bb71f&v=4
url: https://github.com/cassiobotaro url: https://github.com/cassiobotaro
mattwang44:
login: mattwang44
count: 61
avatarUrl: https://avatars.githubusercontent.com/u/24987826?u=58e37fb3927b9124b458945ac4c97aa0f1062d85&v=4
url: https://github.com/mattwang44
nilslindemann: nilslindemann:
login: nilslindemann login: nilslindemann
count: 59 count: 59
avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4 avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
url: https://github.com/nilslindemann url: https://github.com/nilslindemann
mattwang44:
login: mattwang44
count: 59
avatarUrl: https://avatars.githubusercontent.com/u/24987826?u=58e37fb3927b9124b458945ac4c97aa0f1062d85&v=4
url: https://github.com/mattwang44
tiangolo:
login: tiangolo
count: 56
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4
url: https://github.com/tiangolo
Laineyzhang55: Laineyzhang55:
login: Laineyzhang55 login: Laineyzhang55
count: 48 count: 48
@ -88,6 +88,11 @@ 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
@ -118,11 +123,6 @@ Winand:
count: 40 count: 40
avatarUrl: https://avatars.githubusercontent.com/u/53390?u=bb0e71a2fc3910a8e0ee66da67c33de40ea695f8&v=4 avatarUrl: https://avatars.githubusercontent.com/u/53390?u=bb0e71a2fc3910a8e0ee66da67c33de40ea695f8&v=4
url: https://github.com/Winand url: https://github.com/Winand
YuriiMotov:
login: YuriiMotov
count: 40
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=b9b13d598dddfab529a52d264df80a900bfe7060&v=4
url: https://github.com/YuriiMotov
solomein-sv: solomein-sv:
login: solomein-sv login: solomein-sv
count: 38 count: 38
@ -138,6 +138,11 @@ alejsdev:
count: 37 count: 37
avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=85ceac49fb87138aebe8d663912e359447329090&v=4 avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=85ceac49fb87138aebe8d663912e359447329090&v=4
url: https://github.com/alejsdev url: https://github.com/alejsdev
mezgoodle:
login: mezgoodle
count: 37
avatarUrl: https://avatars.githubusercontent.com/u/41520940?u=4a9c765af688389d54296845d18b8f6cd6ddf09a&v=4
url: https://github.com/mezgoodle
stlucasgarcia: stlucasgarcia:
login: stlucasgarcia login: stlucasgarcia
count: 36 count: 36
@ -153,11 +158,6 @@ timothy-jeong:
count: 36 count: 36
avatarUrl: https://avatars.githubusercontent.com/u/53824764?u=db3d0cea2f5fab64d810113c5039a369699a2774&v=4 avatarUrl: https://avatars.githubusercontent.com/u/53824764?u=db3d0cea2f5fab64d810113c5039a369699a2774&v=4
url: https://github.com/timothy-jeong url: https://github.com/timothy-jeong
mezgoodle:
login: mezgoodle
count: 35
avatarUrl: https://avatars.githubusercontent.com/u/41520940?u=4a9c765af688389d54296845d18b8f6cd6ddf09a&v=4
url: https://github.com/mezgoodle
rjNemo: rjNemo:
login: rjNemo login: rjNemo
count: 34 count: 34
@ -173,6 +173,11 @@ akarev0:
count: 33 count: 33
avatarUrl: https://avatars.githubusercontent.com/u/53393089?u=6e528bb4789d56af887ce6fe237bea4010885406&v=4 avatarUrl: https://avatars.githubusercontent.com/u/53393089?u=6e528bb4789d56af887ce6fe237bea4010885406&v=4
url: https://github.com/akarev0 url: https://github.com/akarev0
Vincy1230:
login: Vincy1230
count: 33
avatarUrl: https://avatars.githubusercontent.com/u/81342412?u=ab5e256a4077a4a91f3f9cd2115ba80780454cbe&v=4
url: https://github.com/Vincy1230
romashevchenko: romashevchenko:
login: romashevchenko login: romashevchenko
count: 32 count: 32
@ -183,11 +188,6 @@ LorhanSohaky:
count: 30 count: 30
avatarUrl: https://avatars.githubusercontent.com/u/16273730?u=095b66f243a2cd6a0aadba9a095009f8aaf18393&v=4 avatarUrl: https://avatars.githubusercontent.com/u/16273730?u=095b66f243a2cd6a0aadba9a095009f8aaf18393&v=4
url: https://github.com/LorhanSohaky url: https://github.com/LorhanSohaky
Vincy1230:
login: Vincy1230
count: 30
avatarUrl: https://avatars.githubusercontent.com/u/81342412?u=ab5e256a4077a4a91f3f9cd2115ba80780454cbe&v=4
url: https://github.com/Vincy1230
black-redoc: black-redoc:
login: black-redoc login: black-redoc
count: 29 count: 29
@ -250,7 +250,7 @@ mycaule:
url: https://github.com/mycaule url: https://github.com/mycaule
Aruelius: Aruelius:
login: Aruelius login: Aruelius
count: 24 count: 25
avatarUrl: https://avatars.githubusercontent.com/u/25380989?u=574f8cfcda3ea77a3f81884f6b26a97068e36a9d&v=4 avatarUrl: https://avatars.githubusercontent.com/u/25380989?u=574f8cfcda3ea77a3f81884f6b26a97068e36a9d&v=4
url: https://github.com/Aruelius url: https://github.com/Aruelius
wisderfin: wisderfin:
@ -263,6 +263,11 @@ OzgunCaglarArslan:
count: 24 count: 24
avatarUrl: https://avatars.githubusercontent.com/u/86166426?v=4 avatarUrl: https://avatars.githubusercontent.com/u/86166426?v=4
url: https://github.com/OzgunCaglarArslan url: https://github.com/OzgunCaglarArslan
ycd:
login: ycd
count: 23
avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=f1e7bae394a315da950912c92dc861a8eaf95d4c&v=4
url: https://github.com/ycd
sh0nk: sh0nk:
login: sh0nk login: sh0nk
count: 23 count: 23
@ -288,11 +293,6 @@ Attsun1031:
count: 20 count: 20
avatarUrl: https://avatars.githubusercontent.com/u/1175560?v=4 avatarUrl: https://avatars.githubusercontent.com/u/1175560?v=4
url: https://github.com/Attsun1031 url: https://github.com/Attsun1031
ycd:
login: ycd
count: 20
avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=f1e7bae394a315da950912c92dc861a8eaf95d4c&v=4
url: https://github.com/ycd
delhi09: delhi09:
login: delhi09 login: delhi09
count: 20 count: 20
@ -418,6 +418,11 @@ 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
@ -443,6 +448,11 @@ impocode:
count: 13 count: 13
avatarUrl: https://avatars.githubusercontent.com/u/109408819?u=9cdfc5ccb31a2094c520f41b6087012fa9048982&v=4 avatarUrl: https://avatars.githubusercontent.com/u/109408819?u=9cdfc5ccb31a2094c520f41b6087012fa9048982&v=4
url: https://github.com/impocode url: https://github.com/impocode
waketzheng:
login: waketzheng
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/35413830?u=df19e4fd5bb928e7d086e053ef26a46aad23bf84&v=4
url: https://github.com/waketzheng
wesinalves: wesinalves:
login: wesinalves login: wesinalves
count: 13 count: 13
@ -538,21 +548,16 @@ Lufa1u:
count: 11 count: 11
avatarUrl: https://avatars.githubusercontent.com/u/112495876?u=087658920ed9e74311597bdd921d8d2de939d276&v=4 avatarUrl: https://avatars.githubusercontent.com/u/112495876?u=087658920ed9e74311597bdd921d8d2de939d276&v=4
url: https://github.com/Lufa1u url: https://github.com/Lufa1u
waketzheng:
login: waketzheng
count: 11
avatarUrl: https://avatars.githubusercontent.com/u/35413830?u=df19e4fd5bb928e7d086e053ef26a46aad23bf84&v=4
url: https://github.com/waketzheng
KNChiu: KNChiu:
login: KNChiu login: KNChiu
count: 11 count: 11
avatarUrl: https://avatars.githubusercontent.com/u/36751646?v=4 avatarUrl: https://avatars.githubusercontent.com/u/36751646?v=4
url: https://github.com/KNChiu url: https://github.com/KNChiu
maru0123-2004: Zhongheng-Cheng:
login: maru0123-2004 login: Zhongheng-Cheng
count: 11 count: 11
avatarUrl: https://avatars.githubusercontent.com/u/43961566?u=16ed8603a4d6a4665cb6c53a7aece6f31379b769&v=4 avatarUrl: https://avatars.githubusercontent.com/u/95612344?u=a0f7730a3cc7486827965e01a119ad610bda4b0a&v=4
url: https://github.com/maru0123-2004 url: https://github.com/Zhongheng-Cheng
mariacamilagl: mariacamilagl:
login: mariacamilagl login: mariacamilagl
count: 10 count: 10
@ -608,16 +613,16 @@ 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=7227a2de948c68fb8396d5beff1ee5b0e057c42e&v=4
url: https://github.com/nick-cjyx9 url: https://github.com/nick-cjyx9
marcelomarkus:
login: marcelomarkus
count: 10
avatarUrl: https://avatars.githubusercontent.com/u/20115018?u=dda090ce9160ef0cd2ff69b1e5ea741283425cba&v=4
url: https://github.com/marcelomarkus
lucasbalieiro: lucasbalieiro:
login: lucasbalieiro login: lucasbalieiro
count: 10 count: 10
avatarUrl: https://avatars.githubusercontent.com/u/37416577?u=dad91601ee4f40458d691774ec439aff308344d7&v=4 avatarUrl: https://avatars.githubusercontent.com/u/37416577?u=d144221c34c08adac8b20e1833d776ffa1c4b1d0&v=4
url: https://github.com/lucasbalieiro url: https://github.com/lucasbalieiro
Zhongheng-Cheng:
login: Zhongheng-Cheng
count: 10
avatarUrl: https://avatars.githubusercontent.com/u/95612344?u=a0f7730a3cc7486827965e01a119ad610bda4b0a&v=4
url: https://github.com/Zhongheng-Cheng
RunningIkkyu: RunningIkkyu:
login: RunningIkkyu login: RunningIkkyu
count: 9 count: 9
@ -668,11 +673,6 @@ yodai-yodai:
count: 9 count: 9
avatarUrl: https://avatars.githubusercontent.com/u/7031039?u=4f3593f5931892b931a745cfab846eff6e9332e7&v=4 avatarUrl: https://avatars.githubusercontent.com/u/7031039?u=4f3593f5931892b931a745cfab846eff6e9332e7&v=4
url: https://github.com/yodai-yodai url: https://github.com/yodai-yodai
marcelomarkus:
login: marcelomarkus
count: 9
avatarUrl: https://avatars.githubusercontent.com/u/20115018?u=dda090ce9160ef0cd2ff69b1e5ea741283425cba&v=4
url: https://github.com/marcelomarkus
JoaoGustavoRogel: JoaoGustavoRogel:
login: JoaoGustavoRogel login: JoaoGustavoRogel
count: 9 count: 9
@ -683,6 +683,11 @@ 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
@ -1023,6 +1028,11 @@ 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
@ -1163,6 +1173,11 @@ AbolfazlKameli:
count: 4 count: 4
avatarUrl: https://avatars.githubusercontent.com/u/120686133?u=af8f025278cce0d489007071254e4055df60b78c&v=4 avatarUrl: https://avatars.githubusercontent.com/u/120686133?u=af8f025278cce0d489007071254e4055df60b78c&v=4
url: https://github.com/AbolfazlKameli url: https://github.com/AbolfazlKameli
SBillion:
login: SBillion
count: 4
avatarUrl: https://avatars.githubusercontent.com/u/1070649?u=3ab493dfc88b39da0eb1600e3b8e7df1c90a5dee&v=4
url: https://github.com/SBillion
tyronedamasceno: tyronedamasceno:
login: tyronedamasceno login: tyronedamasceno
count: 3 count: 3
@ -1211,7 +1226,7 @@ phamquanganh31101998:
peebbv6364: peebbv6364:
login: peebbv6364 login: peebbv6364
count: 3 count: 3
avatarUrl: https://avatars.githubusercontent.com/u/26784747?u=75583df215ee01a5cd2dc646aecb81e7dbd33d06&v=4 avatarUrl: https://avatars.githubusercontent.com/u/26784747?u=3bf07017eb4f4fa3639ba8d4ed19980a34bf8f90&v=4
url: https://github.com/peebbv6364 url: https://github.com/peebbv6364
mrparalon: mrparalon:
login: mrparalon login: mrparalon
@ -1413,11 +1428,6 @@ Mohammad222PR:
count: 3 count: 3
avatarUrl: https://avatars.githubusercontent.com/u/116789737?u=25810a5fe049d2f1618e2e7417cea011cc353ce4&v=4 avatarUrl: https://avatars.githubusercontent.com/u/116789737?u=25810a5fe049d2f1618e2e7417cea011cc353ce4&v=4
url: https://github.com/Mohammad222PR url: https://github.com/Mohammad222PR
EdmilsonRodrigues:
login: EdmilsonRodrigues
count: 3
avatarUrl: https://avatars.githubusercontent.com/u/62777025?u=217d6f3cd6cc750bb8818a3af7726c8d74eb7c2d&v=4
url: https://github.com/EdmilsonRodrigues
blaisep: blaisep:
login: blaisep login: blaisep
count: 2 count: 2
@ -1838,11 +1848,11 @@ NavesSapnis:
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/79222417?u=b5b10291b8e9130ca84fd20f0a641e04ed94b6b1&v=4 avatarUrl: https://avatars.githubusercontent.com/u/79222417?u=b5b10291b8e9130ca84fd20f0a641e04ed94b6b1&v=4
url: https://github.com/NavesSapnis url: https://github.com/NavesSapnis
eqsdxr: isgin01:
login: eqsdxr login: isgin01
count: 2 count: 2
avatarUrl: https://avatars.githubusercontent.com/u/157279130?u=7927dc0366995334f9a18c3204a41d3a34d6d96f&v=4 avatarUrl: https://avatars.githubusercontent.com/u/157279130?u=ddffde10876b50f35dc90d1337f507a630530a6a&v=4
url: https://github.com/eqsdxr url: https://github.com/isgin01
syedasamina56: syedasamina56:
login: syedasamina56 login: syedasamina56
count: 2 count: 2

26
docs/en/data/translators.yml

@ -1,6 +1,6 @@
nilslindemann: nilslindemann:
login: nilslindemann login: nilslindemann
count: 125 count: 130
avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4 avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
url: https://github.com/nilslindemann url: https://github.com/nilslindemann
jaystone776: jaystone776:
@ -28,6 +28,11 @@ 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
@ -46,7 +51,7 @@ AlertRED:
hard-coders: hard-coders:
login: hard-coders login: hard-coders
count: 15 count: 15
avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&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
Joao-Pedro-P-Holanda: Joao-Pedro-P-Holanda:
login: Joao-Pedro-P-Holanda login: Joao-Pedro-P-Holanda
@ -103,11 +108,6 @@ 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
tiangolo:
login: tiangolo
count: 7
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=cb5d06e73a9e1998141b1641aa88e443c6717651&v=4
url: https://github.com/tiangolo
ptt3199: ptt3199:
login: ptt3199 login: ptt3199
count: 7 count: 7
@ -126,13 +126,18 @@ batlopes:
lucasbalieiro: lucasbalieiro:
login: lucasbalieiro login: lucasbalieiro
count: 6 count: 6
avatarUrl: https://avatars.githubusercontent.com/u/37416577?u=dad91601ee4f40458d691774ec439aff308344d7&v=4 avatarUrl: https://avatars.githubusercontent.com/u/37416577?u=d144221c34c08adac8b20e1833d776ffa1c4b1d0&v=4
url: https://github.com/lucasbalieiro url: https://github.com/lucasbalieiro
Alexandrhub: Alexandrhub:
login: Alexandrhub login: 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
@ -358,11 +363,6 @@ ruzia:
count: 3 count: 3
avatarUrl: https://avatars.githubusercontent.com/u/24503?v=4 avatarUrl: https://avatars.githubusercontent.com/u/24503?v=4
url: https://github.com/ruzia url: https://github.com/ruzia
YuriiMotov:
login: YuriiMotov
count: 3
avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=b9b13d598dddfab529a52d264df80a900bfe7060&v=4
url: https://github.com/YuriiMotov
izaguerreiro: izaguerreiro:
login: izaguerreiro login: izaguerreiro
count: 2 count: 2

2
docs/en/docs/_llm-test.md

@ -6,7 +6,7 @@ Tests added here will be seen by all designers of language specific prompts.
Use as follows: Use as follows:
* Have a language specific prompt `docs/{language code}/llm-prompt.md`. * Have a language specific prompt - `docs/{language code}/llm-prompt.md`.
* Do a fresh translation of this document into your desired target language (see e.g. the `translate-page` command of the `translate.py`). This will create the translation under `docs/{language code}/docs/_llm-test.md`. * Do a fresh translation of this document into your desired target language (see e.g. the `translate-page` command of the `translate.py`). This will create the translation under `docs/{language code}/docs/_llm-test.md`.
* Check if things are okay in the translation. * Check if things are okay in the translation.
* If necessary, improve your language specific prompt, the general prompt, or the English document. * If necessary, improve your language specific prompt, the general prompt, or the English document.

32
docs/en/docs/contributing.md

@ -6,44 +6,20 @@ First, you might want to see the basic ways to [help FastAPI and get help](help-
If you already cloned the <a href="https://github.com/fastapi/fastapi" class="external-link" target="_blank">fastapi repository</a> and you want to deep dive in the code, here are some guidelines to set up your environment. If you already cloned the <a href="https://github.com/fastapi/fastapi" class="external-link" target="_blank">fastapi repository</a> and you want to deep dive in the code, here are some guidelines to set up your environment.
### Virtual environment
Follow the instructions to create and activate a [virtual environment](virtual-environments.md){.internal-link target=_blank} for the internal code of `fastapi`.
### Install requirements ### Install requirements
After activating the environment, install the required packages: Create a virtual environment and install the required packages with <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">`uv`</a>:
//// tab | `pip`
<div class="termy">
```console
$ pip install -r requirements.txt
---> 100%
```
</div>
////
//// tab | `uv`
If you have <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">`uv`</a>:
<div class="termy"> <div class="termy">
```console ```console
$ uv pip install -r requirements.txt $ uv sync
---> 100% ---> 100%
``` ```
</div> </div>
////
It will install all the dependencies and your local FastAPI in your local environment. It will install all the dependencies and your local FastAPI in your local environment.
### Using your local FastAPI ### Using your local FastAPI
@ -56,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 this included `requirements.txt` instead of running `pip install fastapi` directly. This only happens when you install using `uv sync` instead of running `pip install fastapi` directly.
That is because inside the `requirements.txt` file, the local version of FastAPI is marked to be installed in "editable" mode, with the `-e` option. That is because `uv sync` will install the local version of FastAPI in "editable" mode by default.
/// ///

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

@ -7,14 +7,29 @@ hide:
## Latest Changes ## Latest Changes
### Docs
* 📝 Specify language code for code block. PR [#14656](https://github.com/fastapi/fastapi/pull/14656) by [@YuriiMotov](https://github.com/YuriiMotov).
### Translations ### Translations
* 🌐 Update translations for es (update-outdated). PR [#14686](https://github.com/fastapi/fastapi/pull/14686) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add LLM prompt file for Turkish, generated from the existing translations. PR [#14547](https://github.com/fastapi/fastapi/pull/14547) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add LLM prompt file for Turkish, generated from the existing translations. PR [#14547](https://github.com/fastapi/fastapi/pull/14547) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add LLM prompt file for Traditional Chinese, generated from the existing translations. PR [#14550](https://github.com/fastapi/fastapi/pull/14550) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add LLM prompt file for Traditional Chinese, generated from the existing translations. PR [#14550](https://github.com/fastapi/fastapi/pull/14550) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add LLM prompt file for Simplified Chinese, generated from the existing translations. PR [#14549](https://github.com/fastapi/fastapi/pull/14549) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add LLM prompt file for Simplified Chinese, generated from the existing translations. PR [#14549](https://github.com/fastapi/fastapi/pull/14549) by [@tiangolo](https://github.com/tiangolo).
### Internal ### Internal
* 🔨 Refactor translation script to allow committing in place. PR [#14687](https://github.com/fastapi/fastapi/pull/14687) by [@tiangolo](https://github.com/tiangolo).
* 🐛 Fix translation script path. PR [#14685](https://github.com/fastapi/fastapi/pull/14685) by [@tiangolo](https://github.com/tiangolo).
* ✅ Enable tests in CI for scripts. PR [#14684](https://github.com/fastapi/fastapi/pull/14684) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add pre-commit local script to fix language translations. PR [#14683](https://github.com/fastapi/fastapi/pull/14683) by [@tiangolo](https://github.com/tiangolo).
* ⬆️ Migrate to uv. PR [#14676](https://github.com/fastapi/fastapi/pull/14676) by [@DoctorJohn](https://github.com/DoctorJohn).
* 🔨 Add LLM translations tool fixer. PR [#14652](https://github.com/fastapi/fastapi/pull/14652) by [@YuriiMotov](https://github.com/YuriiMotov).
* 👥 Update FastAPI People - Sponsors. PR [#14626](https://github.com/fastapi/fastapi/pull/14626) by [@tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI GitHub topic repositories. PR [#14630](https://github.com/fastapi/fastapi/pull/14630) by [@tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People - Contributors and Translators. PR [#14625](https://github.com/fastapi/fastapi/pull/14625) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Update translation prompts. PR [#14619](https://github.com/fastapi/fastapi/pull/14619) by [@tiangolo](https://github.com/tiangolo).
* 🔨 Update LLM translation script to guide reviewers to change the prompt. PR [#14614](https://github.com/fastapi/fastapi/pull/14614) by [@tiangolo](https://github.com/tiangolo). * 🔨 Update LLM translation script to guide reviewers to change the prompt. PR [#14614](https://github.com/fastapi/fastapi/pull/14614) by [@tiangolo](https://github.com/tiangolo).
* 👷 Do not run translations on cron while finishing updating existing languages. PR [#14613](https://github.com/fastapi/fastapi/pull/14613) by [@tiangolo](https://github.com/tiangolo). * 👷 Do not run translations on cron while finishing updating existing languages. PR [#14613](https://github.com/fastapi/fastapi/pull/14613) by [@tiangolo](https://github.com/tiangolo).
* 🔥 Remove test variants for Pydantic v1 in test_request_params. PR [#14612](https://github.com/fastapi/fastapi/pull/14612) by [@tiangolo](https://github.com/tiangolo). * 🔥 Remove test variants for Pydantic v1 in test_request_params. PR [#14612](https://github.com/fastapi/fastapi/pull/14612) by [@tiangolo](https://github.com/tiangolo).

2
docs/en/docs/tutorial/bigger-applications.md

@ -56,7 +56,7 @@ from app.routers import items
The same file structure with comments: The same file structure with comments:
``` ```bash
. .
├── app # "app" is a Python package ├── app # "app" is a Python package
│   ├── __init__.py # this file makes "app" a "Python package" │   ├── __init__.py # this file makes "app" a "Python package"

46
docs/es/docs/_llm-test.md

@ -1,17 +1,17 @@
# Archivo de prueba de LLM { #llm-test-file } # Archivo de prueba de LLM { #llm-test-file }
Este documento prueba si el <abbr title="Large Language Model Modelo de lenguaje grande">LLM</abbr>, que traduce la documentación, entiende el `general_prompt` en `scripts/translate.py` y el prompt específico del idioma en `docs/{language code}/llm-prompt.md`. El prompt específico del idioma se agrega al final de `general_prompt`. Este documento prueba si el <abbr title="Large Language Model - Modelo de lenguaje grande">LLM</abbr>, que traduce la documentación, entiende el `general_prompt` en `scripts/translate.py` y el prompt específico del idioma en `docs/{language code}/llm-prompt.md`. El prompt específico del idioma se agrega al final de `general_prompt`.
Las pruebas añadidas aquí serán vistas por todas las personas que diseñan prompts específicos del idioma. Las pruebas añadidas aquí serán vistas por todas las personas que diseñan prompts específicos del idioma.
Úsalo de la siguiente manera: Úsalo de la siguiente manera:
* Ten un prompt específico del idioma `docs/{language code}/llm-prompt.md`. * Ten un prompt específico del idioma - `docs/{language code}/llm-prompt.md`.
* Haz una traducción fresca de este documento a tu idioma destino (mira, por ejemplo, el comando `translate-page` de `translate.py`). Esto creará la traducción en `docs/{language code}/docs/_llm-test.md`. * Haz una traducción fresca de este documento a tu idioma destino (mira, por ejemplo, el comando `translate-page` de `translate.py`). Esto creará la traducción en `docs/{language code}/docs/_llm-test.md`.
* Comprueba si todo está bien en la traducción. * Revisa si las cosas están bien en la traducción.
* Si es necesario, mejora tu prompt específico del idioma, el prompt general, o el documento en inglés. * Si es necesario, mejora tu prompt específico del idioma, el prompt general, o el documento en inglés.
* Luego corrige manualmente los problemas restantes en la traducción para que sea una buena traducción. * Luego corrige manualmente los problemas restantes en la traducción para que sea una buena traducción.
* Vuelve a traducir, teniendo la buena traducción en su lugar. El resultado ideal sería que el LLM ya no hiciera cambios a la traducción. Eso significa que el prompt general y tu prompt específico del idioma están tan bien como pueden estar (a veces hará algunos cambios aparentemente aleatorios; la razón es que <a href="https://doublespeak.chat/#/handbook#deterministic-output" class="external-link" target="_blank">los LLMs no son algoritmos deterministas</a>). * Vuelve a traducir, teniendo la buena traducción en su lugar. El resultado ideal sería que el LLM ya no hiciera cambios a la traducción. Eso significa que el prompt general y tu prompt específico del idioma están tan bien como pueden estar (A veces hará algunos cambios aparentemente aleatorios; la razón es que <a href="https://doublespeak.chat/#/handbook#deterministic-output" class="external-link" target="_blank">los LLMs no son algoritmos deterministas</a>).
Las pruebas: Las pruebas:
@ -23,7 +23,7 @@ Este es un fragmento de código: `foo`. Y este es otro fragmento de código: `ba
//// ////
//// tab | Información //// tab | Info
El contenido de los fragmentos de código debe dejarse tal cual. El contenido de los fragmentos de código debe dejarse tal cual.
@ -45,7 +45,7 @@ El LLM probablemente traducirá esto mal. Lo interesante es si mantiene la tradu
//// ////
//// tab | Información //// tab | Info
La persona que diseña el prompt puede elegir si quiere convertir comillas neutras a comillas tipográficas. También está bien dejarlas como están. La persona que diseña el prompt puede elegir si quiere convertir comillas neutras a comillas tipográficas. También está bien dejarlas como están.
@ -67,7 +67,7 @@ Hardcore: `Yesterday, my friend wrote: "If you spell incorrectly correctly, you
//// ////
//// tab | Información //// tab | Info
... Sin embargo, las comillas dentro de fragmentos de código deben quedarse tal cual. ... Sin embargo, las comillas dentro de fragmentos de código deben quedarse tal cual.
@ -112,7 +112,7 @@ works(foo="bar") # Esto funciona 🎉
//// ////
//// tab | Información //// tab | Info
El código en bloques de código no debe modificarse, con la excepción de los comentarios. El código en bloques de código no debe modificarse, con la excepción de los comentarios.
@ -154,7 +154,7 @@ Algo de texto
//// ////
//// tab | Información //// tab | Info
Las pestañas y los bloques `Info`/`Note`/`Warning`/etc. deben tener la traducción de su título añadida después de una barra vertical (`|`). Las pestañas y los bloques `Info`/`Note`/`Warning`/etc. deben tener la traducción de su título añadida después de una barra vertical (`|`).
@ -181,7 +181,7 @@ El texto del enlace debe traducirse, la dirección del enlace debe apuntar a la
//// ////
//// tab | Información //// tab | Info
Los enlaces deben traducirse, pero su dirección debe permanecer sin cambios. Una excepción son los enlaces absolutos a páginas de la documentación de FastAPI. En ese caso deben enlazar a la traducción. Los enlaces deben traducirse, pero su dirección debe permanecer sin cambios. Una excepción son los enlaces absolutos a páginas de la documentación de FastAPI. En ese caso deben enlazar a la traducción.
@ -197,10 +197,10 @@ Aquí algunas cosas envueltas en elementos HTML "abbr" (algunas son inventadas):
### El abbr da una frase completa { #the-abbr-gives-a-full-phrase } ### El abbr da una frase completa { #the-abbr-gives-a-full-phrase }
* <abbr title="Getting Things Done Hacer las cosas">GTD</abbr> * <abbr title="Getting Things Done - Hacer las cosas">GTD</abbr>
* <abbr title="less than menor que"><code>lt</code></abbr> * <abbr title="less than - menor que"><code>lt</code></abbr>
* <abbr title="XML Web Token Token web XML">XWT</abbr> * <abbr title="XML Web Token - Token web XML">XWT</abbr>
* <abbr title="Parallel Server Gateway Interface Interfaz de pasarela de servidor paralela">PSGI</abbr> * <abbr title="Parallel Server Gateway Interface - Interfaz de pasarela de servidor paralela">PSGI</abbr>
### El abbr da una explicación { #the-abbr-gives-an-explanation } ### El abbr da una explicación { #the-abbr-gives-an-explanation }
@ -209,12 +209,12 @@ Aquí algunas cosas envueltas en elementos HTML "abbr" (algunas son inventadas):
### El abbr da una frase completa y una explicación { #the-abbr-gives-a-full-phrase-and-an-explanation } ### El abbr da una frase completa y una explicación { #the-abbr-gives-a-full-phrase-and-an-explanation }
* <abbr title="Mozilla Developer Network Red de Desarrolladores de Mozilla: documentación para desarrolladores, escrita por la gente de Firefox">MDN</abbr> * <abbr title="Mozilla Developer Network - Red de Desarrolladores de Mozilla: documentación para desarrolladores, escrita por la gente de Firefox">MDN</abbr>
* <abbr title="Input/Output – Entrada/Salida: lectura o escritura de disco, comunicaciones de red.">I/O</abbr>. * <abbr title="Input/Output: lectura o escritura de disco, comunicaciones de red.">I/O</abbr>.
//// ////
//// tab | Información //// tab | Info
Los atributos "title" de los elementos "abbr" se traducen siguiendo instrucciones específicas. Los atributos "title" de los elementos "abbr" se traducen siguiendo instrucciones específicas.
@ -242,7 +242,7 @@ Hola de nuevo.
//// ////
//// tab | Información //// tab | Info
La única regla estricta para los encabezados es que el LLM deje la parte del hash dentro de llaves sin cambios, lo que asegura que los enlaces no se rompan. La única regla estricta para los encabezados es que el LLM deje la parte del hash dentro de llaves sin cambios, lo que asegura que los enlaces no se rompan.
@ -355,7 +355,7 @@ Para instrucciones específicas del idioma, mira p. ej. la sección `### Heading
* los headers * los headers
* el header de autorización * el header de autorización
* el header `Authorization` * el header `Authorization`
* el header Forwarded * el header forwarded
* el sistema de inyección de dependencias * el sistema de inyección de dependencias
* la dependencia * la dependencia
@ -368,7 +368,7 @@ Para instrucciones específicas del idioma, mira p. ej. la sección `### Heading
* paralelismo * paralelismo
* multiprocesamiento * multiprocesamiento
* la variable de entorno * la env var
* la variable de entorno * la variable de entorno
* el `PATH` * el `PATH`
* la variable `PATH` * la variable `PATH`
@ -433,7 +433,7 @@ Para instrucciones específicas del idioma, mira p. ej. la sección `### Heading
* el motor de plantillas * el motor de plantillas
* la anotación de tipos * la anotación de tipos
* la anotación de tipos * las anotaciones de tipos
* el worker del servidor * el worker del servidor
* el worker de Uvicorn * el worker de Uvicorn
@ -468,7 +468,7 @@ Para instrucciones específicas del idioma, mira p. ej. la sección `### Heading
* el ítem * el ítem
* el paquete * el paquete
* el lifespan * el lifespan
* el bloqueo * el lock
* el middleware * el middleware
* la aplicación móvil * la aplicación móvil
* el módulo * el módulo
@ -494,7 +494,7 @@ Para instrucciones específicas del idioma, mira p. ej. la sección `### Heading
//// ////
//// tab | Información //// tab | Info
Esta es una lista no completa y no normativa de términos (mayormente) técnicos vistos en la documentación. Puede ayudar a la persona que diseña el prompt a identificar para qué términos el LLM necesita una mano. Por ejemplo cuando sigue revirtiendo una buena traducción a una traducción subóptima. O cuando tiene problemas conjugando/declinando un término en tu idioma. Esta es una lista no completa y no normativa de términos (mayormente) técnicos vistos en la documentación. Puede ayudar a la persona que diseña el prompt a identificar para qué términos el LLM necesita una mano. Por ejemplo cuando sigue revirtiendo una buena traducción a una traducción subóptima. O cuando tiene problemas conjugando/declinando un término en tu idioma.

40
docs/es/docs/advanced/path-operation-advanced-configuration.md

@ -10,7 +10,7 @@ Si no eres un "experto" en OpenAPI, probablemente no necesites esto.
Puedes establecer el `operationId` de OpenAPI para ser usado en tu *path operation* con el parámetro `operation_id`. Puedes establecer el `operationId` de OpenAPI para ser usado en tu *path operation* con el parámetro `operation_id`.
Tienes que asegurarte de que sea único para cada operación. Tendrías que asegurarte de que sea único para cada operación.
{* ../../docs_src/path_operation_advanced_configuration/tutorial001_py39.py hl[6] *} {* ../../docs_src/path_operation_advanced_configuration/tutorial001_py39.py hl[6] *}
@ -46,7 +46,7 @@ Para excluir una *path operation* del esquema OpenAPI generado (y por lo tanto,
Puedes limitar las líneas usadas del docstring de una *path operation function* para OpenAPI. Puedes limitar las líneas usadas del docstring de una *path operation function* para OpenAPI.
Añadir un `\f` (un carácter de separación de página escapado) hace que **FastAPI** trunque la salida usada para OpenAPI en este punto. Añadir un `\f` (un carácter "form feed" escapado) hace que **FastAPI** trunque la salida usada para OpenAPI en este punto.
No aparecerá en la documentación, pero otras herramientas (como Sphinx) podrán usar el resto. No aparecerá en la documentación, pero otras herramientas (como Sphinx) podrán usar el resto.
@ -141,9 +141,9 @@ Podrías hacer eso con `openapi_extra`:
{* ../../docs_src/path_operation_advanced_configuration/tutorial006_py39.py hl[19:36, 39:40] *} {* ../../docs_src/path_operation_advanced_configuration/tutorial006_py39.py hl[19:36, 39:40] *}
En este ejemplo, no declaramos ningún modelo Pydantic. De hecho, el cuerpo del request ni siquiera se <abbr title="convertido de algún formato plano, como bytes, a objetos de Python">parse</abbr> como JSON, se lee directamente como `bytes`, y la función `magic_data_reader()` sería la encargada de parsearlo de alguna manera. En este ejemplo, no declaramos ningún modelo Pydantic. De hecho, el request body ni siquiera se <abbr title="converted from some plain format, like bytes, into Python objects - convertido de algún formato plano, como bytes, a objetos de Python">parse</abbr> como JSON, se lee directamente como `bytes`, y la función `magic_data_reader()` sería la encargada de parsearlo de alguna manera.
Sin embargo, podemos declarar el esquema esperado para el cuerpo del request. Sin embargo, podemos declarar el esquema esperado para el request body.
### Tipo de contenido personalizado de OpenAPI { #custom-openapi-content-type } ### Tipo de contenido personalizado de OpenAPI { #custom-openapi-content-type }
@ -153,48 +153,16 @@ Y podrías hacer esto incluso si el tipo de datos en el request no es JSON.
Por ejemplo, en esta aplicación no usamos la funcionalidad integrada de FastAPI para extraer el JSON Schema de los modelos Pydantic ni la validación automática para JSON. De hecho, estamos declarando el tipo de contenido del request como YAML, no JSON: Por ejemplo, en esta aplicación no usamos la funcionalidad integrada de FastAPI para extraer el JSON Schema de los modelos Pydantic ni la validación automática para JSON. De hecho, estamos declarando el tipo de contenido del request como YAML, no JSON:
//// tab | Pydantic v2
{* ../../docs_src/path_operation_advanced_configuration/tutorial007_py39.py hl[15:20, 22] *} {* ../../docs_src/path_operation_advanced_configuration/tutorial007_py39.py hl[15:20, 22] *}
////
//// tab | Pydantic v1
{* ../../docs_src/path_operation_advanced_configuration/tutorial007_pv1_py39.py hl[15:20, 22] *}
////
/// info | Información
En la versión 1 de Pydantic el método para obtener el JSON Schema para un modelo se llamaba `Item.schema()`, en la versión 2 de Pydantic, el método se llama `Item.model_json_schema()`.
///
Sin embargo, aunque no estamos usando la funcionalidad integrada por defecto, aún estamos usando un modelo Pydantic para generar manualmente el JSON Schema para los datos que queremos recibir en YAML. Sin embargo, aunque no estamos usando la funcionalidad integrada por defecto, aún estamos usando un modelo Pydantic para generar manualmente el JSON Schema para los datos que queremos recibir en YAML.
Luego usamos el request directamente, y extraemos el cuerpo como `bytes`. Esto significa que FastAPI ni siquiera intentará parsear la carga útil del request como JSON. Luego usamos el request directamente, y extraemos el cuerpo como `bytes`. Esto significa que FastAPI ni siquiera intentará parsear la carga útil del request como JSON.
Y luego en nuestro código, parseamos ese contenido YAML directamente, y nuevamente estamos usando el mismo modelo Pydantic para validar el contenido YAML: Y luego en nuestro código, parseamos ese contenido YAML directamente, y nuevamente estamos usando el mismo modelo Pydantic para validar el contenido YAML:
//// tab | Pydantic v2
{* ../../docs_src/path_operation_advanced_configuration/tutorial007_py39.py hl[24:31] *} {* ../../docs_src/path_operation_advanced_configuration/tutorial007_py39.py hl[24:31] *}
////
//// tab | Pydantic v1
{* ../../docs_src/path_operation_advanced_configuration/tutorial007_pv1_py39.py hl[24:31] *}
////
/// info | Información
En la versión 1 de Pydantic el método para parsear y validar un objeto era `Item.parse_obj()`, en la versión 2 de Pydantic, el método se llama `Item.model_validate()`.
///
/// tip | Consejo /// tip | Consejo
Aquí reutilizamos el mismo modelo Pydantic. Aquí reutilizamos el mismo modelo Pydantic.

56
docs/es/docs/advanced/settings.md

@ -46,12 +46,6 @@ $ pip install "fastapi[all]"
</div> </div>
/// info | Información
En Pydantic v1 venía incluido con el paquete principal. Ahora se distribuye como este paquete independiente para que puedas elegir si instalarlo o no si no necesitas esa funcionalidad.
///
### Crear el objeto `Settings` { #create-the-settings-object } ### Crear el objeto `Settings` { #create-the-settings-object }
Importa `BaseSettings` de Pydantic y crea una sub-clase, muy similar a un modelo de Pydantic. Importa `BaseSettings` de Pydantic y crea una sub-clase, muy similar a un modelo de Pydantic.
@ -60,31 +54,15 @@ De la misma forma que con los modelos de Pydantic, declaras atributos de clase c
Puedes usar todas las mismas funcionalidades de validación y herramientas que usas para los modelos de Pydantic, como diferentes tipos de datos y validaciones adicionales con `Field()`. Puedes usar todas las mismas funcionalidades de validación y herramientas que usas para los modelos de Pydantic, como diferentes tipos de datos y validaciones adicionales con `Field()`.
//// tab | Pydantic v2
{* ../../docs_src/settings/tutorial001_py39.py hl[2,5:8,11] *} {* ../../docs_src/settings/tutorial001_py39.py hl[2,5:8,11] *}
////
//// tab | Pydantic v1
/// info | Información
En Pydantic v1 importarías `BaseSettings` directamente desde `pydantic` en lugar de desde `pydantic_settings`.
///
{* ../../docs_src/settings/tutorial001_pv1_py39.py hl[2,5:8,11] *}
////
/// tip | Consejo /// tip | Consejo
Si quieres algo rápido para copiar y pegar, no uses este ejemplo, usa el último más abajo. Si quieres algo rápido para copiar y pegar, no uses este ejemplo, usa el último más abajo.
/// ///
Luego, cuando creas una instance de esa clase `Settings` (en este caso, en el objeto `settings`), Pydantic leerá las variables de entorno de una manera indiferente a mayúsculas y minúsculas, por lo que una variable en mayúsculas `APP_NAME` aún será leída para el atributo `app_name`. Luego, cuando creas un instance de esa clase `Settings` (en este caso, en el objeto `settings`), Pydantic leerá las variables de entorno de una manera indiferente a mayúsculas y minúsculas, por lo que una variable en mayúsculas `APP_NAME` aún será leída para el atributo `app_name`.
Luego convertirá y validará los datos. Así que, cuando uses ese objeto `settings`, tendrás datos de los tipos que declaraste (por ejemplo, `items_per_user` será un `int`). Luego convertirá y validará los datos. Así que, cuando uses ese objeto `settings`, tendrás datos de los tipos que declaraste (por ejemplo, `items_per_user` será un `int`).
@ -110,7 +88,7 @@ $ ADMIN_EMAIL="[email protected]" APP_NAME="ChimichangApp" fastapi run main.p
/// tip | Consejo /// tip | Consejo
Para establecer múltiples variables de entorno para un solo comando, simplemente sepáralas con un espacio y ponlas todas antes del comando. Para establecer múltiples env vars para un solo comando, simplemente sepáralas con un espacio y ponlas todas antes del comando.
/// ///
@ -150,7 +128,7 @@ Proveniente del ejemplo anterior, tu archivo `config.py` podría verse como:
{* ../../docs_src/settings/app02_an_py39/config.py hl[10] *} {* ../../docs_src/settings/app02_an_py39/config.py hl[10] *}
Nota que ahora no creamos una instance por defecto `settings = Settings()`. Nota que ahora no creamos un instance por defecto `settings = Settings()`.
### El archivo principal de la app { #the-main-app-file } ### El archivo principal de la app { #the-main-app-file }
@ -172,11 +150,11 @@ Y luego podemos requerirlo desde la *path operation function* como una dependenc
### Configuraciones y pruebas { #settings-and-testing } ### Configuraciones y pruebas { #settings-and-testing }
Luego sería muy fácil proporcionar un objeto de configuraciones diferente durante las pruebas al sobrescribir una dependencia para `get_settings`: Luego sería muy fácil proporcionar un objeto de configuraciones diferente durante las pruebas al crear una sobrescritura de dependencia para `get_settings`:
{* ../../docs_src/settings/app02_an_py39/test_main.py hl[9:10,13,21] *} {* ../../docs_src/settings/app02_an_py39/test_main.py hl[9:10,13,21] *}
En la dependencia sobreescrita establecemos un nuevo valor para el `admin_email` al crear el nuevo objeto `Settings`, y luego devolvemos ese nuevo objeto. En la sobrescritura de dependencia establecemos un nuevo valor para el `admin_email` al crear el nuevo objeto `Settings`, y luego devolvemos ese nuevo objeto.
Luego podemos probar que se está usando. Luego podemos probar que se está usando.
@ -215,8 +193,6 @@ APP_NAME="ChimichangApp"
Y luego actualizar tu `config.py` con: Y luego actualizar tu `config.py` con:
//// tab | Pydantic v2
{* ../../docs_src/settings/app03_an_py39/config.py hl[9] *} {* ../../docs_src/settings/app03_an_py39/config.py hl[9] *}
/// tip | Consejo /// tip | Consejo
@ -225,26 +201,6 @@ El atributo `model_config` se usa solo para configuración de Pydantic. Puedes l
/// ///
////
//// tab | Pydantic v1
{* ../../docs_src/settings/app03_an_py39/config_pv1.py hl[9:10] *}
/// tip | Consejo
La clase `Config` se usa solo para configuración de Pydantic. Puedes leer más en <a href="https://docs.pydantic.dev/1.10/usage/model_config/" class="external-link" target="_blank">Pydantic Model Config</a>.
///
////
/// info | Información
En la versión 1 de Pydantic la configuración se hacía en una clase interna `Config`, en la versión 2 de Pydantic se hace en un atributo `model_config`. Este atributo toma un `dict`, y para obtener autocompletado y errores en línea, puedes importar y usar `SettingsConfigDict` para definir ese `dict`.
///
Aquí definimos la configuración `env_file` dentro de tu clase Pydantic `Settings`, y establecemos el valor en el nombre del archivo con el archivo dotenv que queremos usar. Aquí definimos la configuración `env_file` dentro de tu clase Pydantic `Settings`, y establecemos el valor en el nombre del archivo con el archivo dotenv que queremos usar.
### Creando el `Settings` solo una vez con `lru_cache` { #creating-the-settings-only-once-with-lru-cache } ### Creando el `Settings` solo una vez con `lru_cache` { #creating-the-settings-only-once-with-lru-cache }
@ -331,7 +287,7 @@ participant execute as Ejecutar función
end end
``` ```
En el caso de nuestra dependencia `get_settings()`, la función ni siquiera toma argumentos, por lo que siempre devolverá el mismo valor. En el caso de nuestra dependencia `get_settings()`, la función ni siquiera toma argumentos, por lo que siempre devuelve el mismo valor.
De esa manera, se comporta casi como si fuera solo una variable global. Pero como usa una función de dependencia, entonces podemos sobrescribirla fácilmente para las pruebas. De esa manera, se comporta casi como si fuera solo una variable global. Pero como usa una función de dependencia, entonces podemos sobrescribirla fácilmente para las pruebas.

26
docs/es/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md

@ -2,21 +2,23 @@
Si tienes una app de FastAPI antigua, podrías estar usando Pydantic versión 1. Si tienes una app de FastAPI antigua, podrías estar usando Pydantic versión 1.
FastAPI ha tenido compatibilidad con Pydantic v1 o v2 desde la versión 0.100.0. FastAPI versión 0.100.0 tenía compatibilidad con Pydantic v1 o v2. Usaba la que tuvieras instalada.
Si tenías instalado Pydantic v2, lo usaba. Si en cambio tenías Pydantic v1, usaba ese. FastAPI versión 0.119.0 introdujo compatibilidad parcial con Pydantic v1 desde dentro de Pydantic v2 (como `pydantic.v1`), para facilitar la migración a v2.
Pydantic v1 está deprecado y su soporte se eliminará en las próximas versiones de FastAPI, deberías migrar a Pydantic v2. Así obtendrás las funcionalidades, mejoras y correcciones más recientes. FastAPI 0.126.0 eliminó la compatibilidad con Pydantic v1, aunque siguió soportando `pydantic.v1` por un poquito más de tiempo.
/// warning | Advertencia /// warning | Advertencia
Además, el equipo de Pydantic dejó de dar soporte a Pydantic v1 para las versiones más recientes de Python, comenzando con Python 3.14. El equipo de Pydantic dejó de dar soporte a Pydantic v1 para las versiones más recientes de Python, comenzando con **Python 3.14**.
Esto incluye `pydantic.v1`, que ya no está soportado en Python 3.14 y superiores.
Si quieres usar las funcionalidades más recientes de Python, tendrás que asegurarte de usar Pydantic v2. Si quieres usar las funcionalidades más recientes de Python, tendrás que asegurarte de usar Pydantic v2.
/// ///
Si tienes una app de FastAPI antigua con Pydantic v1, aquí te muestro cómo migrarla a Pydantic v2 y las nuevas funcionalidades en FastAPI 0.119.0 para ayudarte con una migración gradual. Si tienes una app de FastAPI antigua con Pydantic v1, aquí te muestro cómo migrarla a Pydantic v2, y las **funcionalidades en FastAPI 0.119.0** para ayudarte con una migración gradual.
## Guía oficial { #official-guide } ## Guía oficial { #official-guide }
@ -44,9 +46,9 @@ Después de esto, puedes ejecutar los tests y revisa si todo funciona. Si es as
## Pydantic v1 en v2 { #pydantic-v1-in-v2 } ## Pydantic v1 en v2 { #pydantic-v1-in-v2 }
Pydantic v2 incluye todo lo de Pydantic v1 como un submódulo `pydantic.v1`. Pydantic v2 incluye todo lo de Pydantic v1 como un submódulo `pydantic.v1`. Pero esto ya no está soportado en versiones por encima de Python 3.13.
Esto significa que puedes instalar la versión más reciente de Pydantic v2 e importar y usar los componentes viejos de Pydantic v1 desde ese submódulo, como si tuvieras instalado el Pydantic v1 antiguo. Esto significa que puedes instalar la versión más reciente de Pydantic v2 e importar y usar los componentes viejos de Pydantic v1 desde este submódulo, como si tuvieras instalado el Pydantic v1 antiguo.
{* ../../docs_src/pydantic_v1_in_v2/tutorial001_an_py310.py hl[1,4] *} {* ../../docs_src/pydantic_v1_in_v2/tutorial001_an_py310.py hl[1,4] *}
@ -66,7 +68,7 @@ Ten en cuenta que, como el equipo de Pydantic ya no da soporte a Pydantic v1 en
### Pydantic v1 y v2 en la misma app { #pydantic-v1-and-v2-on-the-same-app } ### Pydantic v1 y v2 en la misma app { #pydantic-v1-and-v2-on-the-same-app }
No está soportado por Pydantic tener un modelo de Pydantic v2 con sus propios campos definidos como modelos de Pydantic v1 o viceversa. **No está soportado** por Pydantic tener un modelo de Pydantic v2 con sus propios campos definidos como modelos de Pydantic v1 o viceversa.
```mermaid ```mermaid
graph TB graph TB
@ -106,7 +108,7 @@ graph TB
style V2Field fill:#f9fff3 style V2Field fill:#f9fff3
``` ```
En algunos casos, incluso es posible tener modelos de Pydantic v1 y v2 en la misma path operation de tu app de FastAPI: En algunos casos, incluso es posible tener modelos de Pydantic v1 y v2 en la misma **path operation** de tu app de FastAPI:
{* ../../docs_src/pydantic_v1_in_v2/tutorial003_an_py310.py hl[2:3,6,12,21:22] *} {* ../../docs_src/pydantic_v1_in_v2/tutorial003_an_py310.py hl[2:3,6,12,21:22] *}
@ -122,12 +124,12 @@ Si necesitas usar algunas de las herramientas específicas de FastAPI para pará
/// tip | Consejo /// tip | Consejo
Primero prueba con `bump-pydantic`; si tus tests pasan y eso funciona, entonces terminaste con un solo comando. ✨ Primero prueba con `bump-pydantic`, si tus tests pasan y eso funciona, entonces terminaste con un solo comando. ✨
/// ///
Si `bump-pydantic` no funciona para tu caso, puedes usar la compatibilidad de modelos Pydantic v1 y v2 en la misma app para hacer la migración a Pydantic v2 de forma gradual. Si `bump-pydantic` no funciona para tu caso de uso, puedes usar la compatibilidad de modelos Pydantic v1 y v2 en la misma app para hacer la migración a Pydantic v2 de forma gradual.
Podrías primero actualizar Pydantic para usar la última versión 2 y cambiar los imports para usar `pydantic.v1` para todos tus modelos. Podrías primero actualizar Pydantic para usar la última versión 2, y cambiar los imports para usar `pydantic.v1` para todos tus modelos.
Luego puedes empezar a migrar tus modelos de Pydantic v1 a v2 por grupos, en pasos graduales. 🚶 Luego puedes empezar a migrar tus modelos de Pydantic v1 a v2 por grupos, en pasos graduales. 🚶

6
docs/es/docs/how-to/separate-openapi-schemas.md

@ -1,6 +1,6 @@
# Separación de Esquemas OpenAPI para Entrada y Salida o No { #separate-openapi-schemas-for-input-and-output-or-not } # Separación de Esquemas OpenAPI para Entrada y Salida o No { #separate-openapi-schemas-for-input-and-output-or-not }
Al usar **Pydantic v2**, el OpenAPI generado es un poco más exacto y **correcto** que antes. 😎 Desde que se lanzó **Pydantic v2**, el OpenAPI generado es un poco más exacto y **correcto** que antes. 😎
De hecho, en algunos casos, incluso tendrá **dos JSON Schemas** en OpenAPI para el mismo modelo Pydantic, para entrada y salida, dependiendo de si tienen **valores por defecto**. De hecho, en algunos casos, incluso tendrá **dos JSON Schemas** en OpenAPI para el mismo modelo Pydantic, para entrada y salida, dependiendo de si tienen **valores por defecto**.
@ -85,7 +85,7 @@ Probablemente el caso principal para esto es si ya tienes algún código cliente
En ese caso, puedes desactivar esta funcionalidad en **FastAPI**, con el parámetro `separate_input_output_schemas=False`. En ese caso, puedes desactivar esta funcionalidad en **FastAPI**, con el parámetro `separate_input_output_schemas=False`.
/// info | Información /// info
El soporte para `separate_input_output_schemas` fue agregado en FastAPI `0.102.0`. 🤓 El soporte para `separate_input_output_schemas` fue agregado en FastAPI `0.102.0`. 🤓
@ -100,5 +100,3 @@ Y ahora habrá un único esquema para entrada y salida para el modelo, solo `Ite
<div class="screenshot"> <div class="screenshot">
<img src="/img/tutorial/separate-openapi-schemas/image05.png"> <img src="/img/tutorial/separate-openapi-schemas/image05.png">
</div> </div>
Este es el mismo comportamiento que en Pydantic v1. 🤓

26
docs/es/docs/index.md

@ -93,13 +93,13 @@ Las funcionalidades clave son:
"_Estoy súper emocionado con **FastAPI**. ¡Es tan divertido!_" "_Estoy súper emocionado con **FastAPI**. ¡Es tan divertido!_"
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong><a href="https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855" target="_blank">host del podcast Python Bytes</a></strong> <a href="https://x.com/brianokken/status/1112220079972728832" target="_blank"><small>(ref)</small></a></div> <div style="text-align: right; margin-right: 10%;">Brian Okken - <strong><a href="https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855" target="_blank">Python Bytes</a> host del podcast</strong> <a href="https://x.com/brianokken/status/1112220079972728832" target="_blank"><small>(ref)</small></a></div>
--- ---
"_Honestamente, lo que has construido parece súper sólido y pulido. En muchos aspectos, es lo que quería que **Hug** fuera; es realmente inspirador ver a alguien construir eso._" "_Honestamente, lo que has construido parece súper sólido y pulido. En muchos aspectos, es lo que quería que **Hug** fuera; es realmente inspirador ver a alguien construir eso._"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong><a href="https://github.com/hugapi/hug" target="_blank">creador de Hug</a></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> creador</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div>
--- ---
@ -117,6 +117,12 @@ Las funcionalidades clave son:
--- ---
## Mini documental de FastAPI { #fastapi-mini-documentary }
Hay un <a href="https://www.youtube.com/watch?v=mpR8ngthqiE" class="external-link" target="_blank">mini documental de FastAPI</a> lanzado a finales de 2025, puedes verlo online:
<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**, el FastAPI de las CLIs { #typer-the-fastapi-of-clis } ## **Typer**, el FastAPI de las CLIs { #typer-the-fastapi-of-clis }
<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> <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>
@ -268,7 +274,7 @@ Verás la documentación interactiva automática de la API (proporcionada por <a
![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)
### Documentación de API Alternativa { #alternative-api-docs } ### Documentación alternativa de la API { #alternative-api-docs }
Y ahora, ve a <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>. Y ahora, ve a <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
@ -276,7 +282,7 @@ Verás la documentación alternativa automática (proporcionada por <a href="htt
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png) ![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
## Actualización del Ejemplo { #example-upgrade } ## Actualización del ejemplo { #example-upgrade }
Ahora modifica el archivo `main.py` para recibir un body desde un request `PUT`. Ahora modifica el archivo `main.py` para recibir un body desde un request `PUT`.
@ -314,7 +320,7 @@ def update_item(item_id: int, item: Item):
El servidor `fastapi dev` debería recargarse automáticamente. El servidor `fastapi dev` debería recargarse automáticamente.
### Actualización de la Documentación Interactiva de la API { #interactive-api-docs-upgrade } ### Actualización de la documentación interactiva de la API { #interactive-api-docs-upgrade }
Ahora ve a <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>. Ahora ve a <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
@ -330,7 +336,7 @@ Ahora ve a <a href="http://127.0.0.1:8000/docs" class="external-link" target="_b
![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)
### Actualización de la Documentación Alternativa de la API { #alternative-api-docs-upgrade } ### Actualización de la documentación alternativa de la API { #alternative-api-docs-upgrade }
Y ahora, ve a <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>. Y ahora, ve a <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
@ -393,13 +399,13 @@ Volviendo al ejemplo de código anterior, **FastAPI**:
* Validará que haya un `item_id` en el path para requests `GET` y `PUT`. * Validará que haya un `item_id` en el path para requests `GET` y `PUT`.
* Validará que el `item_id` sea del tipo `int` para requests `GET` y `PUT`. * Validará que el `item_id` sea del tipo `int` para requests `GET` y `PUT`.
* Si no lo es, el cliente verá un error útil y claro. * Si no lo es, el cliente verá un error útil y claro.
* Comprobará si hay un parámetro de query opcional llamado `q` (como en `http://127.0.0.1:8000/items/foo?q=somequery`) para requests `GET`. * Revisa si hay un parámetro de query opcional llamado `q` (como en `http://127.0.0.1:8000/items/foo?q=somequery`) para requests `GET`.
* Como el parámetro `q` está declarado con `= None`, es opcional. * Como el parámetro `q` está declarado con `= None`, es opcional.
* Sin el `None` sería requerido (como lo es el body en el caso con `PUT`). * Sin el `None` sería requerido (como lo es el body en el caso con `PUT`).
* Para requests `PUT` a `/items/{item_id}`, leerá el body como JSON: * Para requests `PUT` a `/items/{item_id}`, leerá el body como JSON:
* Comprobará que tiene un atributo requerido `name` que debe ser un `str`. * Revisa que tiene un atributo requerido `name` que debe ser un `str`.
* Comprobará que tiene un atributo requerido `price` que debe ser un `float`. * Revisa que tiene un atributo requerido `price` que debe ser un `float`.
* Comprobará que tiene un atributo opcional `is_offer`, que debe ser un `bool`, si está presente. * Revisa que tiene un atributo opcional `is_offer`, que debe ser un `bool`, si está presente.
* Todo esto también funcionaría para objetos JSON profundamente anidados. * Todo esto también funcionaría para objetos JSON profundamente anidados.
* Convertirá de y a JSON automáticamente. * Convertirá de y a JSON automáticamente.
* Documentará todo con OpenAPI, que puede ser usado por: * Documentará todo con OpenAPI, que puede ser usado por:

28
docs/es/docs/tutorial/bigger-applications.md

@ -56,7 +56,7 @@ from app.routers import items
La misma estructura de archivos con comentarios: La misma estructura de archivos con comentarios:
``` ```bash
. .
├── app # "app" es un paquete de Python ├── app # "app" es un paquete de Python
│   ├── __init__.py # este archivo hace que "app" sea un "paquete de Python" │   ├── __init__.py # este archivo hace que "app" sea un "paquete de Python"
@ -185,7 +185,7 @@ El resultado final es que los paths de item son ahora:
* Todos incluirán las `responses` predefinidas. * Todos incluirán las `responses` predefinidas.
* Todas estas *path operations* tendrán la lista de `dependencies` evaluadas/ejecutadas antes de ellas. * Todas estas *path operations* tendrán la lista de `dependencies` evaluadas/ejecutadas antes de ellas.
* Si también declaras dependencias en una *path operation* específica, **también se ejecutarán**. * Si también declaras dependencias en una *path operation* específica, **también se ejecutarán**.
* Las dependencias del router se ejecutan primero, luego las [dependencias en el decorador](dependencies/dependencies-in-path-operation-decorators.md){.internal-link target=_blank}, y luego las dependencias de parámetros normales. * Las dependencias del router se ejecutan primero, luego las [`dependencies` en el decorador](dependencies/dependencies-in-path-operation-decorators.md){.internal-link target=_blank}, y luego las dependencias de parámetros normales.
* También puedes agregar [dependencias de `Security` con `scopes`](../advanced/security/oauth2-scopes.md){.internal-link target=_blank}. * También puedes agregar [dependencias de `Security` con `scopes`](../advanced/security/oauth2-scopes.md){.internal-link target=_blank}.
/// tip | Consejo /// tip | Consejo
@ -214,7 +214,7 @@ Así que usamos un import relativo con `..` para las dependencias:
/// tip | Consejo /// tip | Consejo
Si sabes perfectamente cómo funcionan los imports, continúa a la siguiente sección. Si sabes perfectamente cómo funcionan los imports, continúa a la siguiente sección abajo.
/// ///
@ -271,7 +271,7 @@ eso significaría:
Eso se referiría a algún paquete arriba de `app/`, con su propio archivo `__init__.py`, etc. Pero no tenemos eso. Así que, eso lanzaría un error en nuestro ejemplo. 🚨 Eso se referiría a algún paquete arriba de `app/`, con su propio archivo `__init__.py`, etc. Pero no tenemos eso. Así que, eso lanzaría un error en nuestro ejemplo. 🚨
Pero ahora sabes cómo funciona, para que puedas usar imports relativos en tus propias aplicaciones sin importar cuán complejas sean. 🤓 Pero ahora sabes cómo funciona, para que puedas usar imports relativos en tus propias apps sin importar cuán complejas sean. 🤓
### Agregar algunos `tags`, `responses`, y `dependencies` personalizados { #add-some-custom-tags-responses-and-dependencies } ### Agregar algunos `tags`, `responses`, y `dependencies` personalizados { #add-some-custom-tags-responses-and-dependencies }
@ -283,7 +283,7 @@ Pero aún podemos agregar _más_ `tags` que se aplicarán a una *path operation*
/// tip | Consejo /// tip | Consejo
Esta última *path operation* tendrá la combinación de tags: `["items", "custom"]`. Esta última path operation tendrá la combinación de tags: `["items", "custom"]`.
Y también tendrá ambas responses en la documentación, una para `404` y otra para `403`. Y también tendrá ambas responses en la documentación, una para `404` y otra para `403`.
@ -301,7 +301,7 @@ Y como la mayor parte de tu lógica ahora vivirá en su propio módulo específi
### Importar `FastAPI` { #import-fastapi } ### Importar `FastAPI` { #import-fastapi }
Importas y creas una clase `FastAPI` como de costumbre. Importas y creas una clase `FastAPI` como normalmente.
Y podemos incluso declarar [dependencias globales](dependencies/global-dependencies.md){.internal-link target=_blank} que se combinarán con las dependencias para cada `APIRouter`: Y podemos incluso declarar [dependencias globales](dependencies/global-dependencies.md){.internal-link target=_blank} que se combinarán con las dependencias para cada `APIRouter`:
@ -398,7 +398,7 @@ Incluirá todas las rutas de ese router como parte de ella.
En realidad creará internamente una *path operation* para cada *path operation* que fue declarada en el `APIRouter`. En realidad creará internamente una *path operation* para cada *path operation* que fue declarada en el `APIRouter`.
Así, detrás de escena, funcionará como si todo fuera la misma única aplicación. Así, detrás de escena, funcionará como si todo fuera la misma única app.
/// ///
@ -430,20 +430,20 @@ Podemos declarar todo eso sin tener que modificar el `APIRouter` original pasand
De esa manera, el `APIRouter` original permanecerá sin modificar, por lo que aún podemos compartir ese mismo archivo `app/internal/admin.py` con otros proyectos en la organización. De esa manera, el `APIRouter` original permanecerá sin modificar, por lo que aún podemos compartir ese mismo archivo `app/internal/admin.py` con otros proyectos en la organización.
El resultado es que, en nuestra aplicación, cada una de las *path operations* del módulo `admin` tendrá: El resultado es que, en nuestra app, cada una de las *path operations* del módulo `admin` tendrá:
* El prefix `/admin`. * El prefix `/admin`.
* El tag `admin`. * El tag `admin`.
* La dependencia `get_token_header`. * La dependencia `get_token_header`.
* La response `418`. 🍵 * La response `418`. 🍵
Pero eso solo afectará a ese `APIRouter` en nuestra aplicación, no en ningún otro código que lo utilice. Pero eso solo afectará a ese `APIRouter` en nuestra app, no en ningún otro código que lo utilice.
Así, por ejemplo, otros proyectos podrían usar el mismo `APIRouter` con un método de autenticación diferente. Así, por ejemplo, otros proyectos podrían usar el mismo `APIRouter` con un método de autenticación diferente.
### Incluir una *path operation* { #include-a-path-operation } ### Incluir una *path operation* { #include-a-path-operation }
También podemos agregar *path operations* directamente a la aplicación de `FastAPI`. También podemos agregar *path operations* directamente a la app de `FastAPI`.
Aquí lo hacemos... solo para mostrar que podemos 🤷: Aquí lo hacemos... solo para mostrar que podemos 🤷:
@ -461,13 +461,13 @@ Los `APIRouter`s no están "montados", no están aislados del resto de la aplica
Esto se debe a que queremos incluir sus *path operations* en el esquema de OpenAPI y las interfaces de usuario. Esto se debe a que queremos incluir sus *path operations* en el esquema de OpenAPI y las interfaces de usuario.
Como no podemos simplemente aislarlos y "montarlos" independientemente del resto, se "clonan" las *path operations* (se vuelven a crear), no se incluyen directamente. Como no podemos simplemente aislarlos y "montarlos" independientemente del resto, las *path operations* se "clonan" (se vuelven a crear), no se incluyen directamente.
/// ///
## Revisa la documentación automática de la API { #check-the-automatic-api-docs } ## Revisa la documentación automática de la API { #check-the-automatic-api-docs }
Ahora, ejecuta tu aplicación: Ahora, ejecuta tu app:
<div class="termy"> <div class="termy">
@ -481,7 +481,7 @@ $ fastapi dev app/main.py
Y abre la documentación en <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>. Y abre la documentación en <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
Verás la documentación automática de la API, incluyendo los paths de todos los submódulos, usando los paths correctos (y prefijos) y las tags correctas: Verás la documentación automática de la API, incluyendo los paths de todos los submódulos, usando los paths correctos (y prefijos) y los tags correctos:
<img src="/img/tutorial/bigger-applications/image01.png"> <img src="/img/tutorial/bigger-applications/image01.png">
@ -501,4 +501,4 @@ De la misma manera que puedes incluir un `APIRouter` en una aplicación `FastAPI
router.include_router(other_router) router.include_router(other_router)
``` ```
Asegúrate de hacerlo antes de incluir `router` en la aplicación de `FastAPI`, para que las *path operations* de `other_router` también se incluyan. Asegúrate de hacerlo antes de incluir `router` en la app de `FastAPI`, para que las *path operations* de `other_router` también se incluyan.

22
docs/es/docs/tutorial/body-updates.md

@ -1,4 +1,4 @@
# Cuerpo - Actualizaciones { #body-updates } # Body - Actualizaciones { #body-updates }
## Actualización reemplazando con `PUT` { #update-replacing-with-put } ## Actualización reemplazando con `PUT` { #update-replacing-with-put }
@ -50,14 +50,6 @@ Si quieres recibir actualizaciones parciales, es muy útil usar el parámetro `e
Como `item.model_dump(exclude_unset=True)`. Como `item.model_dump(exclude_unset=True)`.
/// info | Información
En Pydantic v1 el método se llamaba `.dict()`, fue deprecado (pero aún soportado) en Pydantic v2, y renombrado a `.model_dump()`.
Los ejemplos aquí usan `.dict()` para compatibilidad con Pydantic v1, pero deberías usar `.model_dump()` si puedes usar Pydantic v2.
///
Eso generaría un `dict` solo con los datos que se establecieron al crear el modelo `item`, excluyendo los valores por defecto. Eso generaría un `dict` solo con los datos que se establecieron al crear el modelo `item`, excluyendo los valores por defecto.
Luego puedes usar esto para generar un `dict` solo con los datos que se establecieron (enviados en el request), omitiendo los valores por defecto: Luego puedes usar esto para generar un `dict` solo con los datos que se establecieron (enviados en el request), omitiendo los valores por defecto:
@ -68,14 +60,6 @@ Luego puedes usar esto para generar un `dict` solo con los datos que se establec
Ahora, puedes crear una copia del modelo existente usando `.model_copy()`, y pasar el parámetro `update` con un `dict` que contenga los datos a actualizar. Ahora, puedes crear una copia del modelo existente usando `.model_copy()`, y pasar el parámetro `update` con un `dict` que contenga los datos a actualizar.
/// info | Información
En Pydantic v1 el método se llamaba `.copy()`, fue deprecado (pero aún soportado) en Pydantic v2, y renombrado a `.model_copy()`.
Los ejemplos aquí usan `.copy()` para compatibilidad con Pydantic v1, pero deberías usar `.model_copy()` si puedes usar Pydantic v2.
///
Como `stored_item_model.model_copy(update=update_data)`: Como `stored_item_model.model_copy(update=update_data)`:
{* ../../docs_src/body_updates/tutorial002_py310.py hl[33] *} {* ../../docs_src/body_updates/tutorial002_py310.py hl[33] *}
@ -90,9 +74,9 @@ En resumen, para aplicar actualizaciones parciales deberías:
* Generar un `dict` sin valores por defecto del modelo de entrada (usando `exclude_unset`). * Generar un `dict` sin valores por defecto del modelo de entrada (usando `exclude_unset`).
* De esta manera puedes actualizar solo los valores realmente establecidos por el usuario, en lugar de sobrescribir valores ya almacenados con valores por defecto en tu modelo. * De esta manera puedes actualizar solo los valores realmente establecidos por el usuario, en lugar de sobrescribir valores ya almacenados con valores por defecto en tu modelo.
* Crear una copia del modelo almacenado, actualizando sus atributos con las actualizaciones parciales recibidas (usando el parámetro `update`). * Crear una copia del modelo almacenado, actualizando sus atributos con las actualizaciones parciales recibidas (usando el parámetro `update`).
* Convertir el modelo copiado en algo que pueda almacenarse en tu base de datos (por ejemplo, usando el `jsonable_encoder`). * Convertir el modelo copiado en algo que pueda almacenarse en tu DB (por ejemplo, usando el `jsonable_encoder`).
* Esto es comparable a usar el método `.model_dump()` del modelo de nuevo, pero asegura (y convierte) los valores a tipos de datos que pueden convertirse a JSON, por ejemplo, `datetime` a `str`. * Esto es comparable a usar el método `.model_dump()` del modelo de nuevo, pero asegura (y convierte) los valores a tipos de datos que pueden convertirse a JSON, por ejemplo, `datetime` a `str`.
* Guardar los datos en tu base de datos. * Guardar los datos en tu DB.
* Devolver el modelo actualizado. * Devolver el modelo actualizado.
{* ../../docs_src/body_updates/tutorial002_py310.py hl[28:35] *} {* ../../docs_src/body_updates/tutorial002_py310.py hl[28:35] *}

14
docs/es/docs/tutorial/body.md

@ -32,7 +32,8 @@ Usa tipos estándar de Python para todos los atributos:
{* ../../docs_src/body/tutorial001_py310.py hl[5:9] *} {* ../../docs_src/body/tutorial001_py310.py hl[5:9] *}
Al igual que al declarar parámetros de query, cuando un atributo del modelo tiene un valor por defecto, no es obligatorio. De lo contrario, es obligatorio. Usa `None` para hacerlo opcional.
Al igual que al declarar parámetros de query, cuando un atributo del modelo tiene un valor por defecto, no es obligatorio. De lo contrario, es obligatorio. Usa `None` para hacerlo solo opcional.
Por ejemplo, el modelo anterior declara un “`object`” JSON (o `dict` en Python) como: Por ejemplo, el modelo anterior declara un “`object`” JSON (o `dict` en Python) como:
@ -127,14 +128,6 @@ Dentro de la función, puedes acceder a todos los atributos del objeto modelo di
{* ../../docs_src/body/tutorial002_py310.py *} {* ../../docs_src/body/tutorial002_py310.py *}
/// info | Información
En Pydantic v1 el método se llamaba `.dict()`, se marcó como obsoleto (pero sigue soportado) en Pydantic v2, y se renombró a `.model_dump()`.
Los ejemplos aquí usan `.dict()` por compatibilidad con Pydantic v1, pero deberías usar `.model_dump()` si puedes usar Pydantic v2.
///
## Request body + parámetros de path { #request-body-path-parameters } ## Request body + parámetros de path { #request-body-path-parameters }
Puedes declarar parámetros de path y request body al mismo tiempo. Puedes declarar parámetros de path y request body al mismo tiempo.
@ -143,6 +136,7 @@ Puedes declarar parámetros de path y request body al mismo tiempo.
{* ../../docs_src/body/tutorial003_py310.py hl[15:16] *} {* ../../docs_src/body/tutorial003_py310.py hl[15:16] *}
## Request body + path + parámetros de query { #request-body-path-query-parameters } ## Request body + path + parámetros de query { #request-body-path-query-parameters }
También puedes declarar parámetros de **body**, **path** y **query**, todos al mismo tiempo. También puedes declarar parámetros de **body**, **path** y **query**, todos al mismo tiempo.
@ -155,7 +149,7 @@ Los parámetros de la función se reconocerán de la siguiente manera:
* Si el parámetro también se declara en el **path**, se utilizará como un parámetro de path. * Si el parámetro también se declara en el **path**, se utilizará como un parámetro de path.
* Si el parámetro es de un **tipo singular** (como `int`, `float`, `str`, `bool`, etc.), se interpretará como un parámetro de **query**. * Si el parámetro es de un **tipo singular** (como `int`, `float`, `str`, `bool`, etc.), se interpretará como un parámetro de **query**.
* Si el parámetro se declara como del tipo de un **modelo de Pydantic**, se interpretará como un **request body**. * Si el parámetro se declara como del tipo de un **modelo de Pydantic**, se interpretará como un **body** de request.
/// note | Nota /// note | Nota

39
docs/es/docs/tutorial/extra-models.md

@ -22,21 +22,13 @@ Aquí tienes una idea general de cómo podrían ser los modelos con sus campos d
{* ../../docs_src/extra_models/tutorial001_py310.py hl[7,9,14,20,22,27:28,31:33,38:39] *} {* ../../docs_src/extra_models/tutorial001_py310.py hl[7,9,14,20,22,27:28,31:33,38:39] *}
/// info | Información ### Acerca de `**user_in.model_dump()` { #about-user-in-model-dump }
En Pydantic v1 el método se llamaba `.dict()`, fue deprecado (pero aún soportado) en Pydantic v2, y renombrado a `.model_dump()`. #### `.model_dump()` de Pydantic { #pydantics-model-dump }
Los ejemplos aquí usan `.dict()` para compatibilidad con Pydantic v1, pero deberías usar `.model_dump()` en su lugar si puedes usar Pydantic v2.
///
### Acerca de `**user_in.dict()` { #about-user-in-dict }
#### `.dict()` de Pydantic { #pydantics-dict }
`user_in` es un modelo Pydantic de la clase `UserIn`. `user_in` es un modelo Pydantic de la clase `UserIn`.
Los modelos Pydantic tienen un método `.dict()` que devuelve un `dict` con los datos del modelo. Los modelos Pydantic tienen un método `.model_dump()` que devuelve un `dict` con los datos del modelo.
Así que, si creamos un objeto Pydantic `user_in` como: Así que, si creamos un objeto Pydantic `user_in` como:
@ -47,7 +39,7 @@ user_in = UserIn(username="john", password="secret", email="[email protected]
y luego llamamos a: y luego llamamos a:
```Python ```Python
user_dict = user_in.dict() user_dict = user_in.model_dump()
``` ```
ahora tenemos un `dict` con los datos en la variable `user_dict` (es un `dict` en lugar de un objeto modelo Pydantic). ahora tenemos un `dict` con los datos en la variable `user_dict` (es un `dict` en lugar de un objeto modelo Pydantic).
@ -58,7 +50,7 @@ Y si llamamos a:
print(user_dict) print(user_dict)
``` ```
obtendremos un `dict` de Python con: obtendríamos un `dict` de Python con:
```Python ```Python
{ {
@ -103,20 +95,20 @@ UserInDB(
#### Un modelo Pydantic a partir del contenido de otro { #a-pydantic-model-from-the-contents-of-another } #### Un modelo Pydantic a partir del contenido de otro { #a-pydantic-model-from-the-contents-of-another }
Como en el ejemplo anterior obtuvimos `user_dict` de `user_in.dict()`, este código: Como en el ejemplo anterior obtuvimos `user_dict` de `user_in.model_dump()`, este código:
```Python ```Python
user_dict = user_in.dict() user_dict = user_in.model_dump()
UserInDB(**user_dict) UserInDB(**user_dict)
``` ```
sería equivalente a: sería equivalente a:
```Python ```Python
UserInDB(**user_in.dict()) UserInDB(**user_in.model_dump())
``` ```
...porque `user_in.dict()` es un `dict`, y luego hacemos que Python lo "desempaquete" al pasarlo a `UserInDB` con el prefijo `**`. ...porque `user_in.model_dump()` es un `dict`, y luego hacemos que Python lo "desempaquete" al pasarlo a `UserInDB` con el prefijo `**`.
Así, obtenemos un modelo Pydantic a partir de los datos en otro modelo Pydantic. Así, obtenemos un modelo Pydantic a partir de los datos en otro modelo Pydantic.
@ -125,7 +117,7 @@ Así, obtenemos un modelo Pydantic a partir de los datos en otro modelo Pydantic
Y luego agregando el argumento de palabra clave adicional `hashed_password=hashed_password`, como en: Y luego agregando el argumento de palabra clave adicional `hashed_password=hashed_password`, como en:
```Python ```Python
UserInDB(**user_in.dict(), hashed_password=hashed_password) UserInDB(**user_in.model_dump(), hashed_password=hashed_password)
``` ```
...termina siendo como: ...termina siendo como:
@ -156,7 +148,7 @@ Y estos modelos están compartiendo muchos de los datos y duplicando nombres y t
Podríamos hacerlo mejor. Podríamos hacerlo mejor.
Podemos declarar un modelo `UserBase` que sirva como base para nuestros otros modelos. Y luego podemos hacer subclases de ese modelo que heredan sus atributos (anotaciones de tipos, validación, etc). Podemos declarar un modelo `UserBase` que sirva como base para nuestros otros modelos. Y luego podemos hacer subclases de ese modelo que heredan sus atributos (declaraciones de tipos, validación, etc).
Toda la conversión de datos, validación, documentación, etc. seguirá funcionando normalmente. Toda la conversión de datos, validación, documentación, etc. seguirá funcionando normalmente.
@ -180,20 +172,19 @@ Al definir una <a href="https://docs.pydantic.dev/latest/concepts/types/#unions"
{* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *} {* ../../docs_src/extra_models/tutorial003_py310.py hl[1,14:15,18:20,33] *}
### `Union` en Python 3.10 { #union-in-python-3-10 } ### `Union` en Python 3.10 { #union-in-python-3-10 }
En este ejemplo pasamos `Union[PlaneItem, CarItem]` como el valor del argumento `response_model`. En este ejemplo pasamos `Union[PlaneItem, CarItem]` como el valor del argumento `response_model`.
Porque lo estamos pasando como un **valor a un argumento** en lugar de ponerlo en **anotaciones de tipos**, tenemos que usar `Union` incluso en Python 3.10. Porque lo estamos pasando como un **valor a un argumento** en lugar de ponerlo en una **anotación de tipos**, tenemos que usar `Union` incluso en Python 3.10.
Si estuviera en anotaciones de tipos podríamos haber usado la barra vertical, como: Si estuviera en una anotación de tipos podríamos haber usado la barra vertical, como:
```Python ```Python
some_variable: PlaneItem | CarItem some_variable: PlaneItem | CarItem
``` ```
Pero si ponemos eso en la asignación `response_model=PlaneItem | CarItem` obtendríamos un error, porque Python intentaría realizar una **operación inválida** entre `PlaneItem` y `CarItem` en lugar de interpretar eso como anotaciones de tipos. Pero si ponemos eso en la asignación `response_model=PlaneItem | CarItem` obtendríamos un error, porque Python intentaría realizar una **operación inválida** entre `PlaneItem` y `CarItem` en lugar de interpretar eso como una anotación de tipos.
## Lista de modelos { #list-of-models } ## Lista de modelos { #list-of-models }
@ -203,7 +194,6 @@ Para eso, usa el `typing.List` estándar de Python (o simplemente `list` en Pyth
{* ../../docs_src/extra_models/tutorial004_py39.py hl[18] *} {* ../../docs_src/extra_models/tutorial004_py39.py hl[18] *}
## Response con `dict` arbitrario { #response-with-arbitrary-dict } ## Response con `dict` arbitrario { #response-with-arbitrary-dict }
También puedes declarar un response usando un `dict` arbitrario plano, declarando solo el tipo de las claves y valores, sin usar un modelo Pydantic. También puedes declarar un response usando un `dict` arbitrario plano, declarando solo el tipo de las claves y valores, sin usar un modelo Pydantic.
@ -214,7 +204,6 @@ En este caso, puedes usar `typing.Dict` (o solo `dict` en Python 3.9 y posterior
{* ../../docs_src/extra_models/tutorial005_py39.py hl[6] *} {* ../../docs_src/extra_models/tutorial005_py39.py hl[6] *}
## Recapitulación { #recap } ## Recapitulación { #recap }
Usa múltiples modelos Pydantic y hereda libremente para cada caso. Usa múltiples modelos Pydantic y hereda libremente para cada caso.

26
docs/es/docs/tutorial/query-params-str-validations.md

@ -109,7 +109,7 @@ FastAPI ahora:
## Alternativa (antigua): `Query` como valor por defecto { #alternative-old-query-as-the-default-value } ## Alternativa (antigua): `Query` como valor por defecto { #alternative-old-query-as-the-default-value }
Versiones anteriores de FastAPI (antes de <abbr title="antes de 2023-03">0.95.0</abbr>) requerían que usaras `Query` como el valor por defecto de tu parámetro, en lugar de ponerlo en `Annotated`, hay una alta probabilidad de que veas código usándolo alrededor, así que te lo explicaré. Versiones anteriores de FastAPI (antes de <abbr title="before 2023-03 - antes de 2023-03">0.95.0</abbr>) requerían que usaras `Query` como el valor por defecto de tu parámetro, en lugar de ponerlo en `Annotated`, hay una alta probabilidad de que veas código usándolo alrededor, así que te lo explicaré.
/// tip | Consejo /// tip | Consejo
@ -192,7 +192,7 @@ También puedes agregar un parámetro `min_length`:
## Agregar expresiones regulares { #add-regular-expressions } ## Agregar expresiones regulares { #add-regular-expressions }
Puedes definir un <abbr title="Una expresión regular, regex o regexp es una secuencia de caracteres que define un patrón de búsqueda para strings.">expresión regular</abbr> `pattern` que el parámetro debe coincidir: Puedes definir una <abbr title="Una expresión regular, regex o regexp es una secuencia de caracteres que define un patrón de búsqueda para strings.">expresión regular</abbr> `pattern` que el parámetro debe coincidir:
{* ../../docs_src/query_params_str_validations/tutorial004_an_py310.py hl[11] *} {* ../../docs_src/query_params_str_validations/tutorial004_an_py310.py hl[11] *}
@ -206,20 +206,6 @@ Si te sientes perdido con todas estas ideas de **"expresión regular"**, no te p
Ahora sabes que cuando las necesites puedes usarlas en **FastAPI**. Ahora sabes que cuando las necesites puedes usarlas en **FastAPI**.
### Pydantic v1 `regex` en lugar de `pattern` { #pydantic-v1-regex-instead-of-pattern }
Antes de la versión 2 de Pydantic y antes de FastAPI 0.100.0, el parámetro se llamaba `regex` en lugar de `pattern`, pero ahora está en desuso.
Todavía podrías ver algo de código que lo usa:
//// tab | Pydantic v1
{* ../../docs_src/query_params_str_validations/tutorial004_regex_an_py310.py hl[11] *}
////
Pero que sepas que esto está deprecado y debería actualizarse para usar el nuevo parámetro `pattern`. 🤓
## Valores por defecto { #default-values } ## Valores por defecto { #default-values }
Puedes, por supuesto, usar valores por defecto diferentes de `None`. Puedes, por supuesto, usar valores por defecto diferentes de `None`.
@ -280,7 +266,7 @@ Entonces, con una URL como:
http://localhost:8000/items/?q=foo&q=bar http://localhost:8000/items/?q=foo&q=bar
``` ```
recibirías los múltiples valores del *query parameter* `q` (`foo` y `bar`) en una `list` de Python dentro de tu *path operation function*, en el *parámetro de función* `q`. recibirías los múltiples valores de los *query parameters* `q` (`foo` y `bar`) en una `list` de Python dentro de tu *path operation function*, en el *parámetro de función* `q`.
Entonces, el response a esa URL sería: Entonces, el response a esa URL sería:
@ -386,7 +372,7 @@ Entonces puedes declarar un `alias`, y ese alias será usado para encontrar el v
Ahora digamos que ya no te gusta este parámetro. Ahora digamos que ya no te gusta este parámetro.
Tienes que dejarlo allí por un tiempo porque hay clientes usándolo, pero quieres que la documentación lo muestre claramente como <abbr title="obsoleto, se recomienda no usarlo">deprecated</abbr>. Tienes que dejarlo allí por un tiempo porque hay clientes usándolo, pero quieres que la documentación lo muestre claramente como <abbr title="obsolete, recommended not to use it - obsoleto, se recomienda no usarlo">deprecated</abbr>.
Luego pasa el parámetro `deprecated=True` a `Query`: Luego pasa el parámetro `deprecated=True` a `Query`:
@ -416,7 +402,7 @@ Pydantic también tiene <a href="https://docs.pydantic.dev/latest/concepts/valid
/// ///
Por ejemplo, este validador personalizado comprueba que el ID del ítem empiece con `isbn-` para un número de libro <abbr title="International Standard Book Number – Número Estándar Internacional de Libro">ISBN</abbr> o con `imdb-` para un ID de URL de película de <abbr title="IMDB (Internet Movie Database) es un sitio web con información sobre películas">IMDB</abbr>: Por ejemplo, este validador personalizado comprueba que el ID del ítem empiece con `isbn-` para un número de libro <abbr title="ISBN means International Standard Book Number - ISBN significa International Standard Book Number">ISBN</abbr> o con `imdb-` para un ID de URL de película de <abbr title="IMDB (Internet Movie Database) is a website with information about movies - IMDB (Internet Movie Database) es un sitio web con información sobre películas">IMDB</abbr>:
{* ../../docs_src/query_params_str_validations/tutorial015_an_py310.py hl[5,16:19,24] *} {* ../../docs_src/query_params_str_validations/tutorial015_an_py310.py hl[5,16:19,24] *}
@ -450,7 +436,7 @@ Pero si te da curiosidad este ejemplo de código específico y sigues entretenid
#### Un ítem aleatorio { #a-random-item } #### Un ítem aleatorio { #a-random-item }
Con `data.items()` obtenemos un <abbr title="Algo que podemos iterar con un for, como una list, set, etc.">objeto iterable</abbr> con tuplas que contienen la clave y el valor para cada elemento del diccionario. Con `data.items()` obtenemos un <abbr title="Algo que podemos iterar con un for loop, como una list, set, etc.">objeto iterable</abbr> con tuplas que contienen la clave y el valor para cada elemento del diccionario.
Convertimos este objeto iterable en una `list` propiamente dicha con `list(data.items())`. Convertimos este objeto iterable en una `list` propiamente dicha con `list(data.items())`.

20
docs/es/docs/tutorial/response-model.md

@ -2,7 +2,7 @@
Puedes declarar el tipo utilizado para el response anotando el **tipo de retorno** de la *path operation function*. Puedes declarar el tipo utilizado para el response anotando el **tipo de retorno** de la *path operation function*.
Puedes utilizar **anotaciones de tipos** de la misma manera que lo harías para datos de entrada en **parámetros** de función, puedes utilizar modelos de Pydantic, list, diccionarios, valores escalares como enteros, booleanos, etc. Puedes utilizar **anotaciones de tipos** de la misma manera que lo harías para datos de entrada en **parámetros** de función, puedes utilizar modelos de Pydantic, lists, diccionarios, valores escalares como enteros, booleanos, etc.
{* ../../docs_src/response_model/tutorial001_01_py310.py hl[16,21] *} {* ../../docs_src/response_model/tutorial001_01_py310.py hl[16,21] *}
@ -27,7 +27,7 @@ Por ejemplo, podrías querer **devolver un diccionario** u objeto de base de dat
Si añadiste la anotación del tipo de retorno, las herramientas y editores se quejarían con un error (correcto) diciéndote que tu función está devolviendo un tipo (por ejemplo, un dict) que es diferente de lo que declaraste (por ejemplo, un modelo de Pydantic). Si añadiste la anotación del tipo de retorno, las herramientas y editores se quejarían con un error (correcto) diciéndote que tu función está devolviendo un tipo (por ejemplo, un dict) que es diferente de lo que declaraste (por ejemplo, un modelo de Pydantic).
En esos casos, puedes usar el parámetro del decorador de path operation `response_model` en lugar del tipo de retorno. En esos casos, puedes usar el parámetro del *decorador de path operation* `response_model` en lugar del tipo de retorno.
Puedes usar el parámetro `response_model` en cualquiera de las *path operations*: Puedes usar el parámetro `response_model` en cualquiera de las *path operations*:
@ -153,7 +153,7 @@ Primero vamos a ver cómo los editores, mypy y otras herramientas verían esto.
`BaseUser` tiene los campos base. Luego `UserIn` hereda de `BaseUser` y añade el campo `password`, por lo que incluirá todos los campos de ambos modelos. `BaseUser` tiene los campos base. Luego `UserIn` hereda de `BaseUser` y añade el campo `password`, por lo que incluirá todos los campos de ambos modelos.
Anotamos el tipo de retorno de la función como `BaseUser`, pero en realidad estamos devolviendo un instance de `UserIn`. Anotamos el tipo de retorno de la función como `BaseUser`, pero en realidad estamos devolviendo un `UserIn` instance.
El editor, mypy y otras herramientas no se quejarán de esto porque, en términos de tipificación, `UserIn` es una subclase de `BaseUser`, lo que significa que es un tipo *válido* cuando se espera algo que es un `BaseUser`. El editor, mypy y otras herramientas no se quejarán de esto porque, en términos de tipificación, `UserIn` es una subclase de `BaseUser`, lo que significa que es un tipo *válido* cuando se espera algo que es un `BaseUser`.
@ -252,20 +252,6 @@ Entonces, si envías un request a esa *path operation* para el ítem con ID `foo
/// info | Información /// info | Información
En Pydantic v1 el método se llamaba `.dict()`, fue deprecado (pero aún soportado) en Pydantic v2, y renombrado a `.model_dump()`.
Los ejemplos aquí usan `.dict()` para compatibilidad con Pydantic v1, pero deberías usar `.model_dump()` en su lugar si puedes usar Pydantic v2.
///
/// info | Información
FastAPI usa el método `.dict()` del modelo de Pydantic con <a href="https://docs.pydantic.dev/1.10/usage/exporting_models/#modeldict" class="external-link" target="_blank">su parámetro `exclude_unset`</a> para lograr esto.
///
/// info | Información
También puedes usar: También puedes usar:
* `response_model_exclude_defaults=True` * `response_model_exclude_defaults=True`

38
docs/es/docs/tutorial/schema-extra-example.md

@ -8,35 +8,13 @@ Aquí tienes varias formas de hacerlo.
Puedes declarar `examples` para un modelo de Pydantic que se añadirá al JSON Schema generado. Puedes declarar `examples` para un modelo de Pydantic que se añadirá al JSON Schema generado.
//// tab | Pydantic v2
{* ../../docs_src/schema_extra_example/tutorial001_py310.py hl[13:24] *} {* ../../docs_src/schema_extra_example/tutorial001_py310.py hl[13:24] *}
//// Esa información extra se añadirá tal cual al **JSON Schema** resultante para ese modelo, y se usará en la documentación de la API.
//// tab | Pydantic v1
{* ../../docs_src/schema_extra_example/tutorial001_pv1_py310.py hl[13:23] *}
////
Esa información extra se añadirá tal cual al **JSON Schema** generado para ese modelo, y se usará en la documentación de la API.
//// tab | Pydantic v2
En Pydantic versión 2, usarías el atributo `model_config`, que toma un `dict` como se describe en <a href="https://docs.pydantic.dev/latest/api/config/" class="external-link" target="_blank">la documentación de Pydantic: Configuración</a>.
Puedes establecer `"json_schema_extra"` con un `dict` que contenga cualquier dato adicional que desees que aparezca en el JSON Schema generado, incluyendo `examples`.
////
//// tab | Pydantic v1
En Pydantic versión 1, usarías una clase interna `Config` y `schema_extra`, como se describe en <a href="https://docs.pydantic.dev/1.10/usage/schema/#schema-customization" class="external-link" target="_blank">la documentación de Pydantic: Personalización de Esquema</a>.
Puedes establecer `schema_extra` con un `dict` que contenga cualquier dato adicional que desees que aparezca en el JSON Schema generado, incluyendo `examples`. Puedes usar el atributo `model_config` que toma un `dict` como se describe en <a href="https://docs.pydantic.dev/latest/api/config/" class="external-link" target="_blank">la documentación de Pydantic: Configuración</a>.
//// Puedes establecer `"json_schema_extra"` con un `dict` que contenga cualquier dato adicional que te gustaría que aparezca en el JSON Schema generado, incluyendo `examples`.
/// tip | Consejo /// tip | Consejo
@ -50,7 +28,7 @@ Por ejemplo, podrías usarlo para añadir metadatos para una interfaz de usuario
OpenAPI 3.1.0 (usado desde FastAPI 0.99.0) añadió soporte para `examples`, que es parte del estándar de **JSON Schema**. OpenAPI 3.1.0 (usado desde FastAPI 0.99.0) añadió soporte para `examples`, que es parte del estándar de **JSON Schema**.
Antes de eso, solo soportaba la palabra clave `example` con un solo ejemplo. Eso aún es soportado por OpenAPI 3.1.0, pero está obsoleto y no es parte del estándar de JSON Schema. Así que se recomienda migrar de `example` a `examples`. 🤓 Antes de eso, solo soportaba la palabra clave `example` con un solo ejemplo. Eso aún es soportado por OpenAPI 3.1.0, pero está obsoleto y no es parte del estándar de JSON Schema. Así que se te anima a migrar `example` a `examples`. 🤓
Puedes leer más al final de esta página. Puedes leer más al final de esta página.
@ -94,7 +72,7 @@ Por supuesto, también puedes pasar múltiples `examples`:
{* ../../docs_src/schema_extra_example/tutorial004_an_py310.py hl[23:38] *} {* ../../docs_src/schema_extra_example/tutorial004_an_py310.py hl[23:38] *}
Cuando haces esto, los ejemplos serán parte del **JSON Schema** interno para esos datos de body. Cuando haces esto, los ejemplos serán parte del **JSON Schema** interno para esos datos del body.
Sin embargo, al <abbr title="2023-08-26">momento de escribir esto</abbr>, Swagger UI, la herramienta encargada de mostrar la interfaz de documentación, no soporta mostrar múltiples ejemplos para los datos en **JSON Schema**. Pero lee más abajo para una solución alternativa. Sin embargo, al <abbr title="2023-08-26">momento de escribir esto</abbr>, Swagger UI, la herramienta encargada de mostrar la interfaz de documentación, no soporta mostrar múltiples ejemplos para los datos en **JSON Schema**. Pero lee más abajo para una solución alternativa.
@ -203,17 +181,17 @@ Debido a eso, las versiones de FastAPI anteriores a 0.99.0 todavía usaban versi
### `examples` de Pydantic y FastAPI { #pydantic-and-fastapi-examples } ### `examples` de Pydantic y FastAPI { #pydantic-and-fastapi-examples }
Cuando añades `examples` dentro de un modelo de Pydantic, usando `schema_extra` o `Field(examples=["algo"])`, ese ejemplo se añade al **JSON Schema** para ese modelo de Pydantic. Cuando añades `examples` dentro de un modelo de Pydantic, usando `schema_extra` o `Field(examples=["something"])`, ese ejemplo se añade al **JSON Schema** para ese modelo de Pydantic.
Y ese **JSON Schema** del modelo de Pydantic se incluye en el **OpenAPI** de tu API, y luego se usa en la interfaz de documentación. Y ese **JSON Schema** del modelo de Pydantic se incluye en el **OpenAPI** de tu API, y luego se usa en la interfaz de documentación.
En las versiones de FastAPI antes de 0.99.0 (0.99.0 y superior usan el nuevo OpenAPI 3.1.0) cuando usabas `example` o `examples` con cualquiera de las otras utilidades (`Query()`, `Body()`, etc.) esos ejemplos no se añadían al JSON Schema que describe esos datos (ni siquiera a la propia versión de JSON Schema de OpenAPI), se añadían directamente a la declaración de la *path operation* en OpenAPI (fuera de las partes de OpenAPI que usan JSON Schema). En las versiones de FastAPI antes de 0.99.0 (0.99.0 y superiores usan el nuevo OpenAPI 3.1.0) cuando usabas `example` o `examples` con cualquiera de las otras utilidades (`Query()`, `Body()`, etc.) esos ejemplos no se añadían al JSON Schema que describe esos datos (ni siquiera a la propia versión de JSON Schema de OpenAPI), se añadían directamente a la declaración de la *path operation* en OpenAPI (fuera de las partes de OpenAPI que usan JSON Schema).
Pero ahora que FastAPI 0.99.0 y superiores usa OpenAPI 3.1.0, que usa JSON Schema 2020-12, y Swagger UI 5.0.0 y superiores, todo es más consistente y los ejemplos se incluyen en JSON Schema. Pero ahora que FastAPI 0.99.0 y superiores usa OpenAPI 3.1.0, que usa JSON Schema 2020-12, y Swagger UI 5.0.0 y superiores, todo es más consistente y los ejemplos se incluyen en JSON Schema.
### Swagger UI y `examples` específicos de OpenAPI { #swagger-ui-and-openapi-specific-examples } ### Swagger UI y `examples` específicos de OpenAPI { #swagger-ui-and-openapi-specific-examples }
Ahora, como Swagger UI no soportaba múltiples ejemplos de JSON Schema (a fecha de 2023-08-26), los usuarios no tenían una forma de mostrar múltiples ejemplos en los documentos. Ahora, como Swagger UI no soportaba múltiples ejemplos de JSON Schema (a fecha de 2023-08-26), los usuarios no tenían una forma de mostrar múltiples ejemplos en la documentación.
Para resolver eso, FastAPI `0.103.0` **añadió soporte** para declarar el mismo viejo campo **específico de OpenAPI** `examples` con el nuevo parámetro `openapi_examples`. 🤓 Para resolver eso, FastAPI `0.103.0` **añadió soporte** para declarar el mismo viejo campo **específico de OpenAPI** `examples` con el nuevo parámetro `openapi_examples`. 🤓

16
docs/ja/llm-prompt.md

@ -6,23 +6,23 @@ Language code: ja.
### Grammar and tone ### Grammar and tone
1) Use polite, instructional Japanese (です/ます調). - Use polite, instructional Japanese (です/ます調).
2) Keep the tone concise and technical (match existing Japanese FastAPI docs). - Keep the tone concise and technical (match existing Japanese FastAPI docs).
### Headings ### Headings
1) Follow the existing Japanese style: short, descriptive headings (often noun phrases), e.g. 「チェック」. - Follow the existing Japanese style: short, descriptive headings (often noun phrases), e.g. 「チェック」.
2) Do not add a trailing period at the end of headings. - Do not add a trailing period at the end of headings.
### Quotes ### Quotes
1) Prefer Japanese corner brackets 「」 in normal prose when quoting a term. - Prefer Japanese corner brackets 「」 in normal prose when quoting a term.
2) Do not change quotes inside inline code, code blocks, URLs, or file paths. - Do not change quotes inside inline code, code blocks, URLs, or file paths.
### Ellipsis ### Ellipsis
1) Keep ellipsis style consistent with existing Japanese docs (commonly `...`). - Keep ellipsis style consistent with existing Japanese docs (commonly `...`).
2) Never change `...` in code, URLs, or CLI examples. - Never change `...` in code, URLs, or CLI examples.
### Preferred translations / glossary ### Preferred translations / glossary

16
docs/ko/llm-prompt.md

@ -6,23 +6,23 @@ Language code: ko.
### Grammar and tone ### Grammar and tone
1) Use polite, instructional Korean (e.g. 합니다/하세요 style). - Use polite, instructional Korean (e.g. 합니다/하세요 style).
2) Keep the tone consistent with the existing Korean FastAPI docs. - Keep the tone consistent with the existing Korean FastAPI docs.
### Headings ### Headings
1) Follow existing Korean heading style (short, action-oriented headings like “확인하기”). - Follow existing Korean heading style (short, action-oriented headings like “확인하기”).
2) Do not add trailing punctuation to headings. - Do not add trailing punctuation to headings.
### Quotes ### Quotes
1) Keep quote style consistent with the existing Korean docs. - Keep quote style consistent with the existing Korean docs.
2) Never change quotes inside inline code, code blocks, URLs, or file paths. - Never change quotes inside inline code, code blocks, URLs, or file paths.
### Ellipsis ### Ellipsis
1) Keep ellipsis style consistent with existing Korean docs (often `...`). - Keep ellipsis style consistent with existing Korean docs (often `...`).
2) Never change `...` in code, URLs, or CLI examples. - Never change `...` in code, URLs, or CLI examples.
### Preferred translations / glossary ### Preferred translations / glossary

2
docs/missing-translation.md

@ -4,6 +4,6 @@ This page hasn’t been translated into your language yet. 🌍
We’re currently switching to an automated translation system 🤖, which will help keep all translations complete and up to date. We’re currently switching to an automated translation system 🤖, which will help keep all translations complete and up to date.
Learn more: [Contributing Translations](https://fastapi.tiangolo.com/contributing/#translations){.internal-link target=_blank} Learn more: [Contributing - Translations](https://fastapi.tiangolo.com/contributing/#translations){.internal-link target=_blank}
/// ///

18
docs/pt/llm-prompt.md

@ -14,15 +14,15 @@ When translating documentation into Portuguese, use neutral and widely understan
For the next terms, use the following translations: For the next terms, use the following translations:
* «/// check»: «/// check | Verifique» * /// check: /// check | Verifique
* «/// danger»: «/// danger | Cuidado» * /// danger: /// danger | Cuidado
* «/// info»: «/// info | Informação» * /// info: /// info | Informação
* «/// note | Technical Details»: «/// note | Detalhes Técnicos» * /// note | Technical Details: /// note | Detalhes Técnicos
* «/// info | Very Technical Details»: «/// note | Detalhes Técnicos Avançados» * /// info | Very Technical Details: /// note | Detalhes Técnicos Avançados
* «/// note»: «/// note | Nota» * /// note: /// note | Nota
* «/// tip»: «/// tip | Dica» * /// tip: /// tip | Dica
* «/// warning»: «/// warning | Atenção» * /// warning: /// warning | Atenção
* «(you should)»: «(você deveria)» * (you should): (você deveria)
* async context manager: gerenciador de contexto assíncrono * async context manager: gerenciador de contexto assíncrono
* autocomplete: autocompletar * autocomplete: autocompletar
* autocompletion: preenchimento automático * autocompletion: preenchimento automático

18
docs/tr/llm-prompt.md

@ -6,22 +6,22 @@ Language code: tr.
### Grammar and tone ### Grammar and tone
1) Use instructional Turkish, consistent with existing Turkish docs. - Use instructional Turkish, consistent with existing Turkish docs.
2) Use imperative/guide language when appropriate (e.g. “açalım”, “gidin”, “kopyalayalım”). - Use imperative/guide language when appropriate (e.g. “açalım”, “gidin”, “kopyalayalım”).
### Headings ### Headings
1) Follow existing Turkish heading style (Title Case where used; no trailing period). - Follow existing Turkish heading style (Title Case where used; no trailing period).
### Quotes ### Quotes
1) Keep quote style consistent with the existing Turkish docs (they frequently use ASCII quotes in prose). - Alıntı stili mevcut Türkçe dokümanlarla tutarlı tutun (genellikle metin içinde ASCII tırnak işaretleri kullanılır).
2) Never change quotes inside inline code, code blocks, URLs, or file paths. - Satır içi kod, kod blokları, URL'ler veya dosya yolları içindeki tırnak işaretlerini asla değiştirmeyin.
### Ellipsis ### Ellipsis
1) Keep ellipsis style consistent with existing Turkish docs. - Üç nokta (...) stili mevcut Türkçe dokümanlarla tutarlı tutun.
2) Never change `...` in code, URLs, or CLI examples. - Kod, URL veya CLI örneklerindeki `...` ifadesini asla değiştirmeyin.
### Preferred translations / glossary ### Preferred translations / glossary
@ -39,8 +39,8 @@ Do not translate technical terms like path, route, request, response, query, bod
### `///` admonitions ### `///` admonitions
1) Keep the admonition keyword in English (do not translate `note`, `tip`, etc.). - Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
2) If a title is present, prefer these canonical titles: - If a title is present, prefer these canonical titles:
- `/// note | Not` - `/// note | Not`
- `/// note | Teknik Detaylar` - `/// note | Teknik Detaylar`

20
docs/uk/llm-prompt.md

@ -6,23 +6,23 @@ Language code: uk.
### Grammar and tone ### Grammar and tone
1) Use polite/formal address consistent with existing Ukrainian docs (use “ви/ваш”). - Use polite/formal address consistent with existing Ukrainian docs (use “ви/ваш”).
2) Keep the tone concise and technical. - Keep the tone concise and technical.
### Headings ### Headings
1) Follow existing Ukrainian heading style; keep headings short and instructional. - Follow existing Ukrainian heading style; keep headings short and instructional.
2) Do not add trailing punctuation to headings. - Do not add trailing punctuation to headings.
### Quotes ### Quotes
1) Prefer Ukrainian guillemets «…» for quoted terms in prose, matching existing Ukrainian docs. - Prefer Ukrainian guillemets «…» for quoted terms in prose, matching existing Ukrainian docs.
2) Never change quotes inside inline code, code blocks, URLs, or file paths. - Never change quotes inside inline code, code blocks, URLs, or file paths.
### Ellipsis ### Ellipsis
1) Keep ellipsis style consistent with existing Ukrainian docs. - Keep ellipsis style consistent with existing Ukrainian docs.
2) Never change `...` in code, URLs, or CLI examples. - Never change `...` in code, URLs, or CLI examples.
### Preferred translations / glossary ### Preferred translations / glossary
@ -35,8 +35,8 @@ Use the following preferred translations when they apply in documentation prose:
### `///` admonitions ### `///` admonitions
1) Keep the admonition keyword in English (do not translate `note`, `tip`, etc.). - Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
2) If a title is present, prefer these canonical titles (choose one canonical form where variants exist): - If a title is present, prefer these canonical titles (choose one canonical form where variants exist):
- `/// note | Примітка` - `/// note | Примітка`
- `/// note | Технічні деталі` - `/// note | Технічні деталі`

34
docs/zh-hant/llm-prompt.md

@ -6,30 +6,30 @@ Language code: zh-hant.
### Grammar and tone ### Grammar and tone
1) Use clear, concise technical Traditional Chinese consistent with existing docs. - Use clear, concise technical Traditional Chinese consistent with existing docs.
2) Address the reader naturally (commonly using “你/你的”). - Address the reader naturally (commonly using “你/你的”).
### Headings ### Headings
1) Follow existing Traditional Chinese heading style (short and descriptive). - Follow existing Traditional Chinese heading style (short and descriptive).
2) Do not add trailing punctuation to headings. - Do not add trailing punctuation to headings.
### Quotes and punctuation ### Quotes and punctuation
1) Keep punctuation style consistent with existing Traditional Chinese docs (they often mix English terms like “FastAPI” with Chinese text). - Keep punctuation style consistent with existing Traditional Chinese docs (they often mix English terms like “FastAPI” with Chinese text).
2) Never change punctuation inside inline code, code blocks, URLs, or file paths. - Never change punctuation inside inline code, code blocks, URLs, or file paths.
3) For more details, please follow the [Chinese Copywriting Guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines). - For more details, please follow the [Chinese Copywriting Guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines).
### Ellipsis ### Ellipsis
1) Keep ellipsis style consistent within each document, prefer `...` over `……`. - Keep ellipsis style consistent within each document, prefer `...` over `……`.
2) Never change ellipsis in code, URLs, or CLI examples. - Never change ellipsis in code, URLs, or CLI examples.
### Preferred translations / glossary ### Preferred translations / glossary
1. Should avoid using simplified Chinese characters and terms. Always examine if the translation can be easily comprehended by the Traditional Chinese readers. - Should avoid using simplified Chinese characters and terms. Always examine if the translation can be easily comprehended by the Traditional Chinese readers.
2. For some Python-specific terms like "pickle", "list", "dict" etc, we don't have to translate them. - For some Python-specific terms like "pickle", "list", "dict" etc, we don't have to translate them.
3. Use the following preferred translations when they apply in documentation prose: - Use the following preferred translations when they apply in documentation prose:
- request (HTTP): 請求 - request (HTTP): 請求
- response (HTTP): 回應 - response (HTTP): 回應
@ -50,5 +50,11 @@ Notes:
- `details` blocks exist; keep `/// details` as-is and translate only the title after `|`. - `details` blocks exist; keep `/// details` as-is and translate only the title after `|`.
- Example canonical titles used in existing docs: - Example canonical titles used in existing docs:
- `/// details | 上述指令的含義`
- `/// details | 關於 `requirements.txt`` ```
/// details | 上述指令的含義
```
```
/// details | 關於 `requirements.txt`
```

22
docs/zh/llm-prompt.md

@ -6,24 +6,24 @@ Language code: zh.
### Grammar and tone ### Grammar and tone
1) Use clear, concise technical Chinese consistent with existing docs. - Use clear, concise technical Chinese consistent with existing docs.
2) Address the reader naturally (commonly using “你/你的”). - Address the reader naturally (commonly using “你/你的”).
### Headings ### Headings
1) Follow existing Simplified Chinese heading style (short and descriptive). - Follow existing Simplified Chinese heading style (short and descriptive).
2) Do not add trailing punctuation to headings. - Do not add trailing punctuation to headings.
3) If a heading contains only the name of a FastAPI feature, do not translate it. - If a heading contains only the name of a FastAPI feature, do not translate it.
### Quotes and punctuation ### Quotes and punctuation
1) Keep punctuation style consistent with existing Simplified Chinese docs (they often mix English terms like “FastAPI” with Chinese text). - Keep punctuation style consistent with existing Simplified Chinese docs (they often mix English terms like “FastAPI” with Chinese text).
2) Never change punctuation inside inline code, code blocks, URLs, or file paths. - Never change punctuation inside inline code, code blocks, URLs, or file paths.
### Ellipsis ### Ellipsis
1) Keep ellipsis style consistent within each document, prefer `...` over `……`. - Keep ellipsis style consistent within each document, prefer `...` over `……`.
2) Never change ellipsis in code, URLs, or CLI examples. - Never change ellipsis in code, URLs, or CLI examples.
### Preferred translations / glossary ### Preferred translations / glossary
@ -36,8 +36,8 @@ Use the following preferred translations when they apply in documentation prose:
### `///` admonitions ### `///` admonitions
1) Keep the admonition keyword in English (do not translate `note`, `tip`, etc.). - Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
2) If a title is present, prefer these canonical titles: - If a title is present, prefer these canonical titles:
- `/// tip | 提示` - `/// tip | 提示`
- `/// note | 注意` - `/// note | 注意`

63
pyproject.toml

@ -123,6 +123,68 @@ all = [
[project.scripts] [project.scripts]
fastapi = "fastapi.cli:main" fastapi = "fastapi.cli:main"
[dependency-groups]
dev = [
{ include-group = "tests" },
{ include-group = "docs" },
{ include-group = "translations" },
"playwright>=1.57.0",
"prek==0.2.22",
]
docs = [
{ include-group = "docs-tests" },
"black==25.1.0",
"cairosvg==2.8.2",
"griffe-typingdoc==0.3.0",
"griffe-warnings-deprecated==1.1.0",
"jieba==0.42.1",
"markdown-include-variants==0.0.8",
"mdx-include>=1.4.1,<2.0.0",
"mkdocs-macros-plugin==1.4.1",
"mkdocs-material==9.7.0",
"mkdocs-redirects>=1.2.1,<1.3.0",
"mkdocstrings[python]==0.30.1",
"pillow==11.3.0",
"python-slugify==8.0.4",
"pyyaml>=5.3.1,<7.0.0",
"typer==0.16.0",
]
docs-tests = [
"httpx>=0.23.0,<1.0.0",
"ruff==0.14.3",
]
github-actions = [
"httpx>=0.27.0,<1.0.0",
"pydantic>=2.5.3,<3.0.0",
"pydantic-settings>=2.1.0,<3.0.0",
"pygithub>=2.3.0,<3.0.0",
"pyyaml>=5.3.1,<7.0.0",
"smokeshow>=0.5.0",
]
tests = [
{ include-group = "docs-tests" },
"anyio[trio]>=3.2.1,<5.0.0",
"coverage[toml]>=6.5.0,<8.0",
"dirty-equals==0.9.0",
"flask>=1.1.2,<4.0.0",
"inline-snapshot>=0.21.1",
"mypy==1.14.1",
"pwdlib[argon2]>=0.2.1",
"pyjwt==2.9.0",
"pytest>=7.1.3,<9.0.0",
"pytest-codspeed==4.2.0",
"pyyaml>=5.3.1,<7.0.0",
"sqlmodel==0.0.27",
"strawberry-graphql>=0.200.0,<1.0.0",
"types-orjson==3.6.2",
"types-ujson==5.10.0.20240515",
]
translations = [
"gitpython==3.1.45",
"pydantic-ai==0.4.10",
"pygithub==2.8.1",
]
[tool.pdm] [tool.pdm]
version = { source = "file", path = "fastapi/__init__.py" } version = { source = "file", path = "fastapi/__init__.py" }
distribution = true distribution = true
@ -131,7 +193,6 @@ distribution = true
source-includes = [ source-includes = [
"tests/", "tests/",
"docs_src/", "docs_src/",
"requirements*.txt",
"scripts/", "scripts/",
# For a test # For a test
"docs/en/docs/img/favicon.png", "docs/en/docs/img/favicon.png",

4
requirements-docs-tests.txt

@ -1,4 +0,0 @@
# For mkdocstrings and tests
httpx >=0.23.0,<1.0.0
# For linting and generating docs versions
ruff ==0.14.3

21
requirements-docs.txt

@ -1,21 +0,0 @@
-e .
-r requirements-docs-tests.txt
mkdocs-material==9.7.0
mdx-include >=1.4.1,<2.0.0
mkdocs-redirects>=1.2.1,<1.3.0
typer == 0.16.0
pyyaml >=5.3.1,<7.0.0
# For Material for MkDocs, Chinese search
jieba==0.42.1
# For image processing by Material for MkDocs
pillow==11.3.0
# For image processing by Material for MkDocs
cairosvg==2.8.2
mkdocstrings[python]==0.30.1
griffe-typingdoc==0.3.0
griffe-warnings-deprecated==1.1.0
# For griffe, it formats with black
black==25.1.0
mkdocs-macros-plugin==1.4.1
markdown-include-variants==0.0.8
python-slugify==8.0.4

6
requirements-github-actions.txt

@ -1,6 +0,0 @@
PyGithub>=2.3.0,<3.0.0
pydantic>=2.5.3,<3.0.0
pydantic-settings>=2.1.0,<3.0.0
httpx>=0.27.0,<1.0.0
pyyaml >=5.3.1,<7.0.0
smokeshow

18
requirements-tests.txt

@ -1,18 +0,0 @@
-e .[all]
-r requirements-docs-tests.txt
pytest >=7.1.3,<9.0.0
coverage[toml] >= 6.5.0,< 8.0
mypy ==1.14.1
dirty-equals ==0.9.0
sqlmodel==0.0.27
flask >=1.1.2,<4.0.0
strawberry-graphql >=0.200.0,< 1.0.0
anyio[trio] >=3.2.1,<5.0.0
PyJWT==2.9.0
pyyaml >=5.3.1,<7.0.0
pwdlib[argon2] >=0.2.1
inline-snapshot>=0.21.1
pytest-codspeed==4.2.0
# types
types-ujson ==5.10.0.20240515
types-orjson ==3.6.2

3
requirements-translations.txt

@ -1,3 +0,0 @@
pydantic-ai==0.4.10
GitPython==3.1.45
pygithub==2.8.1

7
requirements.txt

@ -1,7 +0,0 @@
-e .[all]
-r requirements-tests.txt
-r requirements-docs.txt
-r requirements-translations.txt
prek==0.2.22
# For generating screenshots
playwright

733
scripts/doc_parsing_utils.py

@ -0,0 +1,733 @@
import re
from typing import TypedDict, Union
CODE_INCLUDE_RE = re.compile(r"^\{\*\s*(\S+)\s*(.*)\*\}$")
CODE_INCLUDE_PLACEHOLDER = "<CODE_INCLUDE>"
HEADER_WITH_PERMALINK_RE = re.compile(r"^(#{1,6}) (.+?)(\s*\{\s*#.*\s*\})?\s*$")
HEADER_LINE_RE = re.compile(r"^(#{1,6}) (.+?)(?:\s*\{\s*(#.*)\s*\})?\s*$")
TIANGOLO_COM = "https://fastapi.tiangolo.com"
ASSETS_URL_PREFIXES = ("/img/", "/css/", "/js/")
MARKDOWN_LINK_RE = re.compile(
r"(?<!\\)(?<!\!)" # not an image ![...] and not escaped \[...]
r"\[(?P<text>.*?)\]" # link text (non-greedy)
r"\("
r"(?P<url>[^)\s]+)" # url (no spaces and `)`)
r'(?:\s+["\'](?P<title>.*?)["\'])?' # optional title in "" or ''
r"\)"
r"(?:\s*\{(?P<attrs>[^}]*)\})?" # optional attributes in {}
)
HTML_LINK_RE = re.compile(r"<a\s+[^>]*>.*?</a>")
HTML_LINK_TEXT_RE = re.compile(r"<a\b([^>]*)>(.*?)</a>")
HTML_LINK_OPEN_TAG_RE = re.compile(r"<a\b([^>]*)>")
HTML_ATTR_RE = re.compile(r'(\w+)\s*=\s*([\'"])(.*?)\2')
CODE_BLOCK_LANG_RE = re.compile(r"^`{3,4}([\w-]*)", re.MULTILINE)
SLASHES_COMMENT_RE = re.compile(
r"^(?P<code>.*?)(?P<comment>(?:(?<= )// .*)|(?:^// .*))?$"
)
HASH_COMMENT_RE = re.compile(r"^(?P<code>.*?)(?P<comment>(?:(?<= )# .*)|(?:^# .*))?$")
class CodeIncludeInfo(TypedDict):
line_no: int
line: str
class HeaderPermalinkInfo(TypedDict):
line_no: int
hashes: str
title: str
permalink: str
class MarkdownLinkInfo(TypedDict):
line_no: int
url: str
text: str
title: Union[str, None]
attributes: Union[str, None]
full_match: str
class HTMLLinkAttribute(TypedDict):
name: str
quote: str
value: str
class HtmlLinkInfo(TypedDict):
line_no: int
full_tag: str
attributes: list[HTMLLinkAttribute]
text: str
class MultilineCodeBlockInfo(TypedDict):
lang: str
start_line_no: int
content: list[str]
# Code includes
# --------------------------------------------------------------------------------------
def extract_code_includes(lines: list[str]) -> list[CodeIncludeInfo]:
"""
Extract lines that contain code includes.
Return list of CodeIncludeInfo, where each dict contains:
- `line_no` - line number (1-based)
- `line` - text of the line
"""
includes: list[CodeIncludeInfo] = []
for line_no, line in enumerate(lines, start=1):
if CODE_INCLUDE_RE.match(line):
includes.append(CodeIncludeInfo(line_no=line_no, line=line))
return includes
def replace_code_includes_with_placeholders(text: list[str]) -> list[str]:
"""
Replace code includes with placeholders.
"""
modified_text = text.copy()
includes = extract_code_includes(text)
for include in includes:
modified_text[include["line_no"] - 1] = CODE_INCLUDE_PLACEHOLDER
return modified_text
def replace_placeholders_with_code_includes(
text: list[str], original_includes: list[CodeIncludeInfo]
) -> list[str]:
"""
Replace code includes placeholders with actual code includes from the original (English) document.
Fail if the number of placeholders does not match the number of original includes.
"""
code_include_lines = [
line_no
for line_no, line in enumerate(text)
if line.strip() == CODE_INCLUDE_PLACEHOLDER
]
if len(code_include_lines) != len(original_includes):
raise ValueError(
"Number of code include placeholders does not match the number of code includes "
"in the original document "
f"({len(code_include_lines)} vs {len(original_includes)})"
)
modified_text = text.copy()
for i, line_no in enumerate(code_include_lines):
modified_text[line_no] = original_includes[i]["line"]
return modified_text
# Header permalinks
# --------------------------------------------------------------------------------------
def extract_header_permalinks(lines: list[str]) -> list[HeaderPermalinkInfo]:
"""
Extract list of header permalinks from the given lines.
Return list of HeaderPermalinkInfo, where each dict contains:
- `line_no` - line number (1-based)
- `hashes` - string of hashes representing header level (e.g., "###")
- `permalink` - permalink string (e.g., "{#permalink}")
"""
headers: list[HeaderPermalinkInfo] = []
in_code_block3 = False
in_code_block4 = False
for line_no, line in enumerate(lines, start=1):
if not (in_code_block3 or in_code_block4):
if line.startswith("```"):
count = len(line) - len(line.lstrip("`"))
if count == 3:
in_code_block3 = True
continue
elif count >= 4:
in_code_block4 = True
continue
header_match = HEADER_WITH_PERMALINK_RE.match(line)
if header_match:
hashes, title, permalink = header_match.groups()
headers.append(
HeaderPermalinkInfo(
hashes=hashes, line_no=line_no, permalink=permalink, title=title
)
)
elif in_code_block3:
if line.startswith("```"):
count = len(line) - len(line.lstrip("`"))
if count == 3:
in_code_block3 = False
continue
elif in_code_block4:
if line.startswith("````"):
count = len(line) - len(line.lstrip("`"))
if count >= 4:
in_code_block4 = False
continue
return headers
def remove_header_permalinks(lines: list[str]) -> list[str]:
"""
Remove permalinks from headers in the given lines.
"""
modified_lines: list[str] = []
for line in lines:
header_match = HEADER_WITH_PERMALINK_RE.match(line)
if header_match:
hashes, title, _permalink = header_match.groups()
modified_line = f"{hashes} {title}"
modified_lines.append(modified_line)
else:
modified_lines.append(line)
return modified_lines
def replace_header_permalinks(
text: list[str],
header_permalinks: list[HeaderPermalinkInfo],
original_header_permalinks: list[HeaderPermalinkInfo],
) -> list[str]:
"""
Replace permalinks in the given text with the permalinks from the original document.
Fail if the number or level of headers does not match the original.
"""
modified_text: list[str] = text.copy()
if len(header_permalinks) != len(original_header_permalinks):
raise ValueError(
"Number of headers with permalinks does not match the number in the "
"original document "
f"({len(header_permalinks)} vs {len(original_header_permalinks)})"
)
for header_no in range(len(header_permalinks)):
header_info = header_permalinks[header_no]
original_header_info = original_header_permalinks[header_no]
if header_info["hashes"] != original_header_info["hashes"]:
raise ValueError(
"Header levels do not match between document and original document"
f" (found {header_info['hashes']}, expected {original_header_info['hashes']})"
f" for header №{header_no + 1} in line {header_info['line_no']}"
)
line_no = header_info["line_no"] - 1
hashes = header_info["hashes"]
title = header_info["title"]
permalink = original_header_info["permalink"]
modified_text[line_no] = f"{hashes} {title}{permalink}"
return modified_text
# Markdown links
# --------------------------------------------------------------------------------------
def extract_markdown_links(lines: list[str]) -> list[MarkdownLinkInfo]:
"""
Extract all markdown links from the given lines.
Return list of MarkdownLinkInfo, where each dict contains:
- `line_no` - line number (1-based)
- `url` - link URL
- `text` - link text
- `title` - link title (if any)
"""
links: list[MarkdownLinkInfo] = []
for line_no, line in enumerate(lines, start=1):
for m in MARKDOWN_LINK_RE.finditer(line):
links.append(
MarkdownLinkInfo(
line_no=line_no,
url=m.group("url"),
text=m.group("text"),
title=m.group("title"),
attributes=m.group("attrs"),
full_match=m.group(0),
)
)
return links
def _add_lang_code_to_url(url: str, lang_code: str) -> str:
if url.startswith(TIANGOLO_COM):
rel_url = url[len(TIANGOLO_COM) :]
if not rel_url.startswith(ASSETS_URL_PREFIXES):
url = url.replace(TIANGOLO_COM, f"{TIANGOLO_COM}/{lang_code}")
return url
def _construct_markdown_link(
url: str,
text: str,
title: Union[str, None],
attributes: Union[str, None],
lang_code: str,
) -> str:
"""
Construct a markdown link, adjusting the URL for the given language code if needed.
"""
url = _add_lang_code_to_url(url, lang_code)
if title:
link = f'[{text}]({url} "{title}")'
else:
link = f"[{text}]({url})"
if attributes:
link += f"{{{attributes}}}"
return link
def replace_markdown_links(
text: list[str],
links: list[MarkdownLinkInfo],
original_links: list[MarkdownLinkInfo],
lang_code: str,
) -> list[str]:
"""
Replace markdown links in the given text with the original links.
Fail if the number of links does not match the original.
"""
if len(links) != len(original_links):
raise ValueError(
"Number of markdown links does not match the number in the "
"original document "
f"({len(links)} vs {len(original_links)})"
)
modified_text = text.copy()
for i, link_info in enumerate(links):
link_text = link_info["text"]
link_title = link_info["title"]
original_link_info = original_links[i]
# Replace
replacement_link = _construct_markdown_link(
url=original_link_info["url"],
text=link_text,
title=link_title,
attributes=original_link_info["attributes"],
lang_code=lang_code,
)
line_no = link_info["line_no"] - 1
modified_line = modified_text[line_no]
modified_line = modified_line.replace(
link_info["full_match"], replacement_link, 1
)
modified_text[line_no] = modified_line
return modified_text
# HTML links
# --------------------------------------------------------------------------------------
def extract_html_links(lines: list[str]) -> list[HtmlLinkInfo]:
"""
Extract all HTML links from the given lines.
Return list of HtmlLinkInfo, where each dict contains:
- `line_no` - line number (1-based)
- `full_tag` - full HTML link tag
- `attributes` - list of HTMLLinkAttribute (name, quote, value)
- `text` - link text
"""
links = []
for line_no, line in enumerate(lines, start=1):
for html_link in HTML_LINK_RE.finditer(line):
link_str = html_link.group(0)
link_text_match = HTML_LINK_TEXT_RE.match(link_str)
assert link_text_match is not None
link_text = link_text_match.group(2)
assert isinstance(link_text, str)
link_open_tag_match = HTML_LINK_OPEN_TAG_RE.match(link_str)
assert link_open_tag_match is not None
link_open_tag = link_open_tag_match.group(1)
assert isinstance(link_open_tag, str)
attributes: list[HTMLLinkAttribute] = []
for attr_name, attr_quote, attr_value in re.findall(
HTML_ATTR_RE, link_open_tag
):
assert isinstance(attr_name, str)
assert isinstance(attr_quote, str)
assert isinstance(attr_value, str)
attributes.append(
HTMLLinkAttribute(
name=attr_name, quote=attr_quote, value=attr_value
)
)
links.append(
HtmlLinkInfo(
line_no=line_no,
full_tag=link_str,
attributes=attributes,
text=link_text,
)
)
return links
def _construct_html_link(
link_text: str,
attributes: list[HTMLLinkAttribute],
lang_code: str,
) -> str:
"""
Reconstruct HTML link, adjusting the URL for the given language code if needed.
"""
attributes_upd: list[HTMLLinkAttribute] = []
for attribute in attributes:
if attribute["name"] == "href":
original_url = attribute["value"]
url = _add_lang_code_to_url(original_url, lang_code)
attributes_upd.append(
HTMLLinkAttribute(name="href", quote=attribute["quote"], value=url)
)
else:
attributes_upd.append(attribute)
attrs_str = " ".join(
f"{attribute['name']}={attribute['quote']}{attribute['value']}{attribute['quote']}"
for attribute in attributes_upd
)
return f"<a {attrs_str}>{link_text}</a>"
def replace_html_links(
text: list[str],
links: list[HtmlLinkInfo],
original_links: list[HtmlLinkInfo],
lang_code: str,
) -> list[str]:
"""
Replace HTML links in the given text with the links from the original document.
Adjust URLs for the given language code.
Fail if the number of links does not match the original.
"""
if len(links) != len(original_links):
raise ValueError(
"Number of HTML links does not match the number in the "
"original document "
f"({len(links)} vs {len(original_links)})"
)
modified_text = text.copy()
for link_index, link in enumerate(links):
original_link_info = original_links[link_index]
# Replace in the document text
replacement_link = _construct_html_link(
link_text=link["text"],
attributes=original_link_info["attributes"],
lang_code=lang_code,
)
line_no = link["line_no"] - 1
modified_text[line_no] = modified_text[line_no].replace(
link["full_tag"], replacement_link, 1
)
return modified_text
# Multiline code blocks
# --------------------------------------------------------------------------------------
def get_code_block_lang(line: str) -> str:
match = CODE_BLOCK_LANG_RE.match(line)
if match:
return match.group(1)
return ""
def extract_multiline_code_blocks(text: list[str]) -> list[MultilineCodeBlockInfo]:
blocks: list[MultilineCodeBlockInfo] = []
in_code_block3 = False
in_code_block4 = False
current_block_lang = ""
current_block_start_line = -1
current_block_lines = []
for line_no, line in enumerate(text, start=1):
stripped = line.lstrip()
# --- Detect opening fence ---
if not (in_code_block3 or in_code_block4):
if stripped.startswith("```"):
current_block_start_line = line_no
count = len(stripped) - len(stripped.lstrip("`"))
if count == 3:
in_code_block3 = True
current_block_lang = get_code_block_lang(stripped)
current_block_lines = [line]
continue
elif count >= 4:
in_code_block4 = True
current_block_lang = get_code_block_lang(stripped)
current_block_lines = [line]
continue
# --- Detect closing fence ---
elif in_code_block3:
if stripped.startswith("```"):
count = len(stripped) - len(stripped.lstrip("`"))
if count == 3:
current_block_lines.append(line)
blocks.append(
MultilineCodeBlockInfo(
lang=current_block_lang,
start_line_no=current_block_start_line,
content=current_block_lines,
)
)
in_code_block3 = False
current_block_lang = ""
current_block_start_line = -1
current_block_lines = []
continue
current_block_lines.append(line)
elif in_code_block4:
if stripped.startswith("````"):
count = len(stripped) - len(stripped.lstrip("`"))
if count >= 4:
current_block_lines.append(line)
blocks.append(
MultilineCodeBlockInfo(
lang=current_block_lang,
start_line_no=current_block_start_line,
content=current_block_lines,
)
)
in_code_block4 = False
current_block_lang = ""
current_block_start_line = -1
current_block_lines = []
continue
current_block_lines.append(line)
return blocks
def _split_hash_comment(line: str) -> tuple[str, Union[str, None]]:
match = HASH_COMMENT_RE.match(line)
if match:
code = match.group("code").rstrip()
comment = match.group("comment")
return code, comment
return line.rstrip(), None
def _split_slashes_comment(line: str) -> tuple[str, Union[str, None]]:
match = SLASHES_COMMENT_RE.match(line)
if match:
code = match.group("code").rstrip()
comment = match.group("comment")
return code, comment
return line, None
def replace_multiline_code_block(
block_a: MultilineCodeBlockInfo, block_b: MultilineCodeBlockInfo
) -> list[str]:
"""
Replace multiline code block `a` with block `b` leaving comments intact.
Syntax of comments depends on the language of the code block.
Raises ValueError if the blocks are not compatible (different languages or different number of lines).
"""
start_line = block_a["start_line_no"]
end_line_no = start_line + len(block_a["content"]) - 1
if block_a["lang"] != block_b["lang"]:
raise ValueError(
f"Code block (lines {start_line}-{end_line_no}) "
"has different language than the original block "
f"('{block_a['lang']}' vs '{block_b['lang']}')"
)
if len(block_a["content"]) != len(block_b["content"]):
raise ValueError(
f"Code block (lines {start_line}-{end_line_no}) "
"has different number of lines than the original block "
f"({len(block_a['content'])} vs {len(block_b['content'])})"
)
block_language = block_a["lang"].lower()
if block_language in {"mermaid"}:
if block_a != block_b:
print(
f"Skipping mermaid code block replacement (lines {start_line}-{end_line_no}). "
"This should be checked manually."
)
return block_a["content"].copy() # We don't handle mermaid code blocks for now
code_block: list[str] = []
for line_a, line_b in zip(block_a["content"], block_b["content"]):
line_a_comment: Union[str, None] = None
line_b_comment: Union[str, None] = None
# Handle comments based on language
if block_language in {
"python",
"py",
"sh",
"bash",
"dockerfile",
"requirements",
"gitignore",
"toml",
"yaml",
"yml",
"hash-style-comments",
}:
_line_a_code, line_a_comment = _split_hash_comment(line_a)
_line_b_code, line_b_comment = _split_hash_comment(line_b)
res_line = line_b
if line_b_comment:
res_line = res_line.replace(line_b_comment, line_a_comment, 1)
code_block.append(res_line)
elif block_language in {"console", "json", "slash-style-comments"}:
_line_a_code, line_a_comment = _split_slashes_comment(line_a)
_line_b_code, line_b_comment = _split_slashes_comment(line_b)
res_line = line_b
if line_b_comment:
res_line = res_line.replace(line_b_comment, line_a_comment, 1)
code_block.append(res_line)
else:
code_block.append(line_b)
return code_block
def replace_multiline_code_blocks_in_text(
text: list[str],
code_blocks: list[MultilineCodeBlockInfo],
original_code_blocks: list[MultilineCodeBlockInfo],
) -> list[str]:
"""
Update each code block in `text` with the corresponding code block from
`original_code_blocks` with comments taken from `code_blocks`.
Raises ValueError if the number, language, or shape of code blocks do not match.
"""
if len(code_blocks) != len(original_code_blocks):
raise ValueError(
"Number of code blocks does not match the number in the original document "
f"({len(code_blocks)} vs {len(original_code_blocks)})"
)
modified_text = text.copy()
for block, original_block in zip(code_blocks, original_code_blocks):
updated_content = replace_multiline_code_block(block, original_block)
start_line_index = block["start_line_no"] - 1
for i, updated_line in enumerate(updated_content):
modified_text[start_line_index + i] = updated_line
return modified_text
# All checks
# --------------------------------------------------------------------------------------
def check_translation(
doc_lines: list[str],
en_doc_lines: list[str],
lang_code: str,
auto_fix: bool,
path: str,
) -> list[str]:
# Fix code includes
en_code_includes = extract_code_includes(en_doc_lines)
doc_lines_with_placeholders = replace_code_includes_with_placeholders(doc_lines)
fixed_doc_lines = replace_placeholders_with_code_includes(
doc_lines_with_placeholders, en_code_includes
)
if auto_fix and (fixed_doc_lines != doc_lines):
print(f"Fixing code includes in: {path}")
doc_lines = fixed_doc_lines
# Fix permalinks
en_permalinks = extract_header_permalinks(en_doc_lines)
doc_permalinks = extract_header_permalinks(doc_lines)
fixed_doc_lines = replace_header_permalinks(
doc_lines, doc_permalinks, en_permalinks
)
if auto_fix and (fixed_doc_lines != doc_lines):
print(f"Fixing header permalinks in: {path}")
doc_lines = fixed_doc_lines
# Fix markdown links
en_markdown_links = extract_markdown_links(en_doc_lines)
doc_markdown_links = extract_markdown_links(doc_lines)
fixed_doc_lines = replace_markdown_links(
doc_lines, doc_markdown_links, en_markdown_links, lang_code
)
if auto_fix and (fixed_doc_lines != doc_lines):
print(f"Fixing markdown links in: {path}")
doc_lines = fixed_doc_lines
# Fix HTML links
en_html_links = extract_html_links(en_doc_lines)
doc_html_links = extract_html_links(doc_lines)
fixed_doc_lines = replace_html_links(
doc_lines, doc_html_links, en_html_links, lang_code
)
if auto_fix and (fixed_doc_lines != doc_lines):
print(f"Fixing HTML links in: {path}")
doc_lines = fixed_doc_lines
# Fix multiline code blocks
en_code_blocks = extract_multiline_code_blocks(en_doc_lines)
doc_code_blocks = extract_multiline_code_blocks(doc_lines)
fixed_doc_lines = replace_multiline_code_blocks_in_text(
doc_lines, doc_code_blocks, en_code_blocks
)
if auto_fix and (fixed_doc_lines != doc_lines):
print(f"Fixing multiline code blocks in: {path}")
doc_lines = fixed_doc_lines
return doc_lines

2
scripts/docs.py

@ -239,7 +239,7 @@ def generate_readme() -> None:
Generate README.md content from main index.md Generate README.md content from main index.md
""" """
readme_path = Path("README.md") readme_path = Path("README.md")
old_content = readme_path.read_text() old_content = readme_path.read_text("utf-8")
new_content = generate_readme_content() new_content = generate_readme_content()
if new_content != old_content: if new_content != old_content:
print("README.md outdated from the latest index.md") print("README.md outdated from the latest index.md")

528
scripts/general-llm-prompt.md

@ -0,0 +1,528 @@
### Your task
Translate an English original content to a target language.
The original content is written in Markdown, write the translation in Markdown as well.
The original content will be surrounded by triple percentage signs (%%%). Do not include the triple percentage signs in the translation.
### Technical terms in English
For technical terms in English that don't have a common translation term, use the original term in English.
### Content of code snippets
Do not translate the content of code snippets, keep the original in English. For example, `list`, `dict`, keep them as is.
### Content of code blocks
Do not translate the content of code blocks, except for comments in the language which the code block uses.
Examples:
Source (English) - The code block is a bash code example with one comment:
```bash
# Print greeting
echo "Hello, World!"
```
Result (German):
```bash
# Gruß ausgeben
echo "Hello, World!"
```
Source (English) - The code block is a console example containing HTML tags. No comments, so nothing to change here:
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
Result (German):
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
Source (English) - The code block is a console example containing 5 comments:
```console
// Go to the home directory
$ cd
// Create a directory for all your code projects
$ mkdir code
// Enter into that code directory
$ cd code
// Create a directory for this project
$ mkdir awesome-project
// Enter into that project directory
$ cd awesome-project
```
Result (German):
```console
// Gehe zum Home-Verzeichnis
$ cd
// Erstelle ein Verzeichnis für alle Ihre Code-Projekte
$ mkdir code
// Gehe in dieses Code-Verzeichnis
$ cd code
// Erstelle ein Verzeichnis für dieses Projekt
$ mkdir awesome-project
// Gehe in dieses Projektverzeichnis
$ cd awesome-project
```
If there is an existing translation and its Mermaid diagram is in sync with the Mermaid diagram in the English source, except a few translated words, then use the Mermaid diagram of the existing translation. The human editor of the translation translated these words in the Mermaid diagram. Keep these translations, do not revert them back to the English source.
Example:
Source (English):
```mermaid
flowchart LR
subgraph global[global env]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone project]
stone(philosophers-stone) -->|requires| harry-1
end
```
Existing translation (German) - has three translations:
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
Result (German) - you change nothing:
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
### Special blocks
There are special blocks of notes, tips and others that look like:
/// note
Here goes a note
///
To translate it, keep the same line and add the translation after a vertical bar.
For example, if you were translating to Spanish, you would write:
/// note | Nota
Some examples in Spanish:
Source (English):
/// tip
Result (Spanish):
/// tip | Consejo
Source (English):
/// details | Preview
Result (Spanish):
/// details | Vista previa
### Tab blocks
There are special blocks surrounded by four slashes (////). They mark text, which will be rendered as part of a tab in the final document. The scheme is:
//// tab | {tab title}
{tab content, may span many lines}
////
Keep everything before the vertical bar (|) as is, including the vertical bar. Translate the tab title. Translate the tab content, applying the rules you know. Keep the four block closing slashes as is.
Examples:
Source (English):
//// tab | Python 3.8+ non-Annotated
Hello
////
Result (German):
//// tab | Python 3.8+ nicht annotiert
Hallo
////
Source (English) - Here there is nothing to translate in the tab title:
//// tab | Linux, macOS, Windows Bash
Hello again
////
Result (German):
//// tab | Linux, macOS, Windows Bash
Hallo wieder
////
### Headings
Every Markdown heading in the English text (all levels) ends with a part inside curly brackets. This part denotes the hash of this heading, which is used in links to this heading. In translations, translate the heading, but do not translate this hash part, so that links do not break.
Examples of how to translate a heading:
Source (English):
```
## Alternative API docs { #alternative-api-docs }
```
Result (Spanish):
```
## Documentación de la API alternativa { #alternative-api-docs }
```
Source (English):
```
### Example { #example }
```
Result (German):
```
### Beispiel { #example }
```
### Links
Use the following rules for links (apply both to Markdown-style links ([text](url)) and to HTML-style <a href="url">text</a> tags):
- For relative URLs, only translate the link text. Do not translate the URL or its parts.
Example:
Source (English):
```
[One of the fastest Python frameworks available](#performance)
```
Result (German):
```
[Eines der schnellsten verfügbaren Python-Frameworks](#performance)
```
- For absolute URLs which DO NOT start EXACTLY with https://fastapi.tiangolo.com, only translate the link text and leave the URL unchanged.
Example:
Source (English):
```
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel docs</a>
```
Result (German):
```
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel-Dokumentation</a>
```
- For absolute URLs which DO start EXACTLY with https://fastapi.tiangolo.com, only translate the link text and change the URL by adding the language code (https://fastapi.tiangolo.com/{language_code}[rest part of the url]).
Example:
Source (English):
```
<a href="https://fastapi.tiangolo.com/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentation</a>
```
Result (Spanish):
```
<a href="https://fastapi.tiangolo.com/es/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentación</a>
```
- Do not add language codes for URLs that point to static assets (e.g., images, CSS, JavaScript).
Example:
Source (English):
```
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Something</a>
```
Result (Spanish):
```
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Algo</a>
```
- For internal links, only translate link text.
Example:
Source (English):
```
[Create Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
```
Result (German):
```
[Pull Requests erzeugen](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
```
- Do not translate anchor fragments in links (the part after `#`), as they must remain the same to work correctly.
- If an existing translation has a link with an anchor fragment different to the anchor fragment in the English source, then this is an error. Fix this by using the anchor fragment of the English source.
Example:
Source (English):
```
[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}
```
Existing wrong translation (German) - notice the wrongly translated anchor fragment:
```
[Body - Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#einzelne-werte-im-body){.internal-link target=_blank}.
```
Result (German) - you fix the anchor fragment:
```
[Body - Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
```
- Do not add anchor fragments at will, even if this makes sense. If the English source has no anchor, don't add one.
Example:
Source (English):
```
Create a [virtual environment](../virtual-environments.md){.internal-link target=_blank}
```
Wrong translation in German - Anchor added to the URL.
```
Erstelle eine [virtuelle Umgebung](../virtual-environments.md#create-a-virtual-environment){.internal-link target=_blank}
```
Good translation (German) - URL stays like in the English source.
```
Erstelle eine [Virtuelle Umgebung](../virtual-environments.md){.internal-link target=_blank}
```
### HTML abbr elements
Translate HTML abbr elements (`<abbr title="description">text</abbr>`) as follows:
- If the text surrounded by the abbr element is an abbreviation (the text may be surrounded by further HTML or Markdown markup or quotes, for example <code>text</code> or `text` or "text", ignore that further markup when deciding if the text is an abbreviation), and if the description (the text inside the title attribute) contains the full phrase for this abbreviation, then append a dash (-) to the full phrase, followed by the translation of the full phrase.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{full phrase} - {translation of full phrase}">{abbreviation}</abbr>
```
Examples:
Source (English):
```
<abbr title="Internet of Things">IoT</abbr>
<abbr title="Central Processing Unit">CPU</abbr>
<abbr title="too long; didn't read"><strong>TL;DR:</strong></abbr>
```
Result (German):
```
<abbr title="Internet of Things - Internet der Dinge">IoT</abbr>
<abbr title="Central Processing Unit - Zentrale Verarbeitungseinheit">CPU</abbr>
<abbr title="too long; didn't read - zu lang; hab's nicht gelesen"><strong>TL;DR:</strong></abbr>
```
- If the language to which you translate mostly uses the letters of the ASCII char set (for example Spanish, French, German, but not Russian, Chinese) and if the translation of the full phrase is identical to, or starts with the same letters as the original full phrase, then only give the translation of the full phrase.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{translation of full phrase}">{abbreviation}</abbr>
```
Examples:
Source (English):
```
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchronous Server Gateway Interface">ASGI</abbr>
```
Result (German):
```
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchrones Server-Gateway-Interface">ASGI</abbr>
```
- If the description is not a full phrase for an abbreviation which the abbr element surrounds, but some other information, then just translate the description.
Conversion scheme:
Source (English):
```
<abbr title="{description}">{text}</abbr>
```
Result:
```
<abbr title="{translation of description}">{translation of text}</abbr>
```
Examples:
Source (English):
```
<abbr title="also known as: endpoints, routes">path</abbr>
<abbr title="a program that checks for code errors">linter</abbr>
<abbr title="converting the string that comes from an HTTP request into Python data">parsing</abbr>
<abbr title="before 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">at the time of writing this</abbr>
```
Result (German):
```
<abbr title="auch bekannt als: Endpunkte, Routen">Pfad</abbr>
<abbr title="Programm das auf Fehler im Code prüft">Linter</abbr>
<abbr title="Konvertieren des Strings eines HTTP-Requests in Python-Daten">Parsen</abbr>
<abbr title="vor 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">zum Zeitpunkt als das hier geschrieben wurde</abbr>
```
- If the text surrounded by the abbr element is an abbreviation and the description contains both the full phrase for that abbreviation, and other information, separated by a colon (`:`), then append a dash (`-`) and the translation of the full phrase to the original full phrase and translate the other information.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}: {other information}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{full phrase} - {translation of full phrase}: {translation of other information}">{abbreviation}</abbr>
```
Examples:
Source (English):
```
<abbr title="Input/Output: disk reading or writing, network communication.">I/O</abbr>
<abbr title="Content Delivery Network: service, that provides static files.">CDN</abbr>
<abbr title="Integrated Development Environment: similar to a code editor">IDE</abbr>
```
Result (German):
```
<abbr title="Input/Output - Eingabe/Ausgabe: Lesen oder Schreiben auf der Festplatte, Netzwerkkommunikation.">I/O</abbr>
<abbr title="Content Delivery Network - Inhalte auslieferndes Netzwerk: Dienst, der statische Dateien bereitstellt.">CDN</abbr>
<abbr title="Integrated Development Environment - Integrierte Entwicklungsumgebung: Ähnlich einem Code-Editor">IDE</abbr>
```
- You can leave the original full phrase away, if the translated full phrase is identical or starts with the same letters as the original full phrase.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}: {information}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{translation of full phrase}: {translation of information}">{abbreviation}</abbr>
```
Example:
Source (English):
```
<abbr title="Object Relational Mapper: a fancy term for a library where some classes represent SQL tables and instances represent rows in those tables">ORM</abbr>
```
Result (German):
```
<abbr title="Objektrelationaler Mapper: Ein Fachbegriff für eine Bibliothek, in der einige Klassen SQL-Tabellen und Instanzen Zeilen in diesen Tabellen darstellen">ORM</abbr>
```
- If there is an existing translation, and it has ADDITIONAL abbr elements in a sentence, and these additional abbr elements do not exist in the related sentence in the English text, then KEEP those additional abbr elements in the translation. Do not remove them. Except when you remove the whole sentence from the translation, because the whole sentence was removed from the English text, then also remove the abbr element. The reasoning for this rule is, that such additional abbr elements are manually added by the human editor of the translation, in order to translate or explain an English word to the human readers of the translation. These additional abbr elements would not make sense in the English text, but they do make sense in the translation. So keep them in the translation, even though they are not part of the English text. This rule only applies to abbr elements.
- Apply above rules also when there is an existing translation! Make sure that all title attributes in abbr elements get properly translated or updated, using the schemes given above. However, leave the ADDITIONAL abbr's described above alone. Do not change their formatting or content.

2
scripts/notify_translations.py

@ -316,7 +316,7 @@ def main() -> None:
raise RuntimeError( raise RuntimeError(
f"No github event file available at: {settings.github_event_path}" f"No github event file available at: {settings.github_event_path}"
) )
contents = settings.github_event_path.read_text() contents = settings.github_event_path.read_text("utf-8")
github_event = PartialGitHubEvent.model_validate_json(contents) github_event = PartialGitHubEvent.model_validate_json(contents)
logging.info(f"Using GitHub event: {github_event}") logging.info(f"Using GitHub event: {github_event}")
number = ( number = (

2
scripts/test.sh

@ -4,4 +4,4 @@ set -e
set -x set -x
export PYTHONPATH=./docs_src export PYTHONPATH=./docs_src
coverage run -m pytest tests ${@} coverage run -m pytest tests scripts/tests/ ${@}

42
scripts/tests/test_translation_fixer/conftest.py

@ -0,0 +1,42 @@
import shutil
import sys
from pathlib import Path
import pytest
from typer.testing import CliRunner
skip_on_windows = pytest.mark.skipif(
sys.platform == "win32", reason="Skipping on Windows"
)
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
for item in items:
item.add_marker(skip_on_windows)
@pytest.fixture(name="runner")
def get_runner():
runner = CliRunner()
with runner.isolated_filesystem():
yield runner
@pytest.fixture(name="root_dir")
def prepare_paths(runner):
docs_dir = Path("docs")
en_docs_dir = docs_dir / "en" / "docs"
lang_docs_dir = docs_dir / "lang" / "docs"
en_docs_dir.mkdir(parents=True, exist_ok=True)
lang_docs_dir.mkdir(parents=True, exist_ok=True)
yield Path.cwd()
@pytest.fixture
def copy_test_files(root_dir: Path, request: pytest.FixtureRequest):
en_file_path = Path(request.param[0])
translation_file_path = Path(request.param[1])
shutil.copy(str(en_file_path), str(root_dir / "docs" / "en" / "docs" / "doc.md"))
shutil.copy(
str(translation_file_path), str(root_dir / "docs" / "lang" / "docs" / "doc.md")
)

44
scripts/tests/test_translation_fixer/test_code_blocks/data/en_doc.md

@ -0,0 +1,44 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
```toml
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Mermaid diagram
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

45
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_lines_number_gt.md

@ -0,0 +1,45 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
```toml
# Extra line
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

45
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_lines_number_lt.md

@ -0,0 +1,45 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
The following block is missing first line:
```toml
title = "TOML Example" # Title of the document
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

44
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_mermaid_not_translated.md

@ -0,0 +1,44 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
```toml
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

44
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_mermaid_translated.md

@ -0,0 +1,44 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
```toml
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|требует| harry-1[harry v1]
```

50
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_number_gt.md

@ -0,0 +1,50 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
```toml
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
Extra code block
```
$ cd my_project
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

41
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_number_lt.md

@ -0,0 +1,41 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
Missing code block...
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

46
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_wrong_lang_code.md

@ -0,0 +1,46 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
The following block has wrong language code (should be TOML):
```yaml
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

46
scripts/tests/test_translation_fixer/test_code_blocks/data/translated_doc_wrong_lang_code_2.md

@ -0,0 +1,46 @@
# Code blocks { #code-blocks }
Some text
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
Some more text
The following block has wrong language code (should be TOML):
```
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
And more text
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
And even more text
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
Диаграма Mermaid
```mermaid
flowchart LR
stone(philosophers-stone) -->|requires| harry-1[harry v1]
```

58
scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_lines_number_mismatch.py

@ -0,0 +1,58 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_code_blocks/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_lines_number_gt.md")],
indirect=True,
)
def test_gt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_lines_number_gt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Code block (lines 14-18) has different number of lines than the original block (5 vs 4)"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_lines_number_lt.md")],
indirect=True,
)
def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
# assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_lines_number_lt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Code block (lines 16-18) has different number of lines than the original block (3 vs 4)"
) in result.output

59
scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_mermaid.py

@ -0,0 +1,59 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_code_blocks/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_mermaid_translated.md")],
indirect=True,
)
def test_translated(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 0, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(
f"{data_path}/translated_doc_mermaid_translated.md"
).read_text("utf-8")
assert fixed_content == expected_content # Translated doc remains unchanged
assert (
"Skipping mermaid code block replacement (lines 41-44). This should be checked manually."
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[
(
f"{data_path}/en_doc.md",
f"{data_path}/translated_doc_mermaid_not_translated.md",
)
],
indirect=True,
)
def test_not_translated(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 0, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(
f"{data_path}/translated_doc_mermaid_not_translated.md"
).read_text("utf-8")
assert fixed_content == expected_content # Translated doc remains unchanged
assert ("Skipping mermaid code block replacement") not in result.output

60
scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_number_mismatch.py

@ -0,0 +1,60 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_code_blocks/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_gt.md")],
indirect=True,
)
def test_gt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_gt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of code blocks does not match the number "
"in the original document (6 vs 5)"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_lt.md")],
indirect=True,
)
def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
# assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_lt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of code blocks does not match the number "
"in the original document (4 vs 5)"
) in result.output

58
scripts/tests/test_translation_fixer/test_code_blocks/test_code_blocks_wrong_lang_code.py

@ -0,0 +1,58 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_code_blocks/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_wrong_lang_code.md")],
indirect=True,
)
def test_wrong_lang_code_1(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_wrong_lang_code.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Code block (lines 16-19) has different language than the original block ('yaml' vs 'toml')"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_wrong_lang_code_2.md")],
indirect=True,
)
def test_wrong_lang_code_2(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(
f"{data_path}/translated_doc_wrong_lang_code_2.md"
).read_text("utf-8")
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Code block (lines 16-19) has different language than the original block ('' vs 'toml')"
) in result.output

13
scripts/tests/test_translation_fixer/test_code_includes/data/en_doc.md

@ -0,0 +1,13 @@
# Header
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
Some text
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
Some more text
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] hl[31:33] *}
And even more text

15
scripts/tests/test_translation_fixer/test_code_includes/data/translated_doc_number_gt.md

@ -0,0 +1,15 @@
# Header
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
Some text
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
Some more text
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] hl[31:33] *}
And even more text
{* ../../docs_src/python_types/tutorial001_py39.py *}

13
scripts/tests/test_translation_fixer/test_code_includes/data/translated_doc_number_lt.md

@ -0,0 +1,13 @@
# Header
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
Some text
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
Some more text
...
And even more text

60
scripts/tests/test_translation_fixer/test_code_includes/test_number_mismatch.py

@ -0,0 +1,60 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_code_includes/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_gt.md")],
indirect=True,
)
def test_gt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_gt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of code include placeholders does not match the number of code includes "
"in the original document (4 vs 3)"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_lt.md")],
indirect=True,
)
def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_lt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of code include placeholders does not match the number of code includes "
"in the original document (2 vs 3)"
) in result.output

244
scripts/tests/test_translation_fixer/test_complex_doc/data/en_doc.md

@ -0,0 +1,244 @@
# Test translation fixer tool { #test-translation-fixer }
## Code blocks with and without comments { #code-blocks-with-and-without-comments }
This is a test page for the translation fixer tool.
### Code blocks with comments { #code-blocks-with-comments }
The following code blocks include comments in different styles.
Fixer tool should fix content, but preserve comments correctly.
```python
# This is a sample Python code block
def hello_world():
# Comment with indentation
print("Hello, world!") # Print greeting
```
```toml
# This is a sample TOML code block
title = "TOML Example" # Title of the document
```
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
```json
{
// This is a sample JSON code block
"greeting": "Hello, world!" // Greeting
}
```
### Code blocks with comments where language uses different comment styles { #code-blocks-with-different-comment-styles }
The following code blocks include comments in different styles based on the language.
Fixer tool will not preserve comments in these blocks.
```json
{
# This is a sample JSON code block
"greeting": "Hello, world!" # Print greeting
}
```
```console
# This is a sample console code block
$ echo "Hello, world!" # Print greeting
```
```toml
// This is a sample TOML code block
title = "TOML Example" // Title of the document
```
### Code blocks with comments with unsupported languages or without language specified { #code-blocks-with-unsupported-languages }
The following code blocks use unsupported languages for comment preservation.
Fixer tool will not preserve comments in these blocks.
```javascript
// This is a sample JavaScript code block
console.log("Hello, world!"); // Print greeting
```
```
# This is a sample console code block
$ echo "Hello, world!" # Print greeting
```
```
// This is a sample console code block
$ echo "Hello, world!" // Print greeting
```
### Code blocks with comments that don't follow pattern { #code-blocks-with-comments-without-pattern }
Fixer tool expects comments that follow specific pattern:
- For hash-style comments: comment starts with `# ` (hash following by whitespace) in the beginning of the string or after a whitespace.
- For slash-style comments: comment starts with `// ` (two slashes following by whitespace) in the beginning of the string or after a whitespace.
If comment doesn't follow this pattern, fixer tool will not preserve it.
```python
#Function declaration
def hello_world():# Print greeting
print("Hello, world!") #Print greeting without space after hash
```
```console
//Function declaration
def hello_world():// Print greeting
print("Hello, world!") //Print greeting without space after slashes
```
## Code blocks with quadruple backticks { #code-blocks-with-quadruple-backticks }
The following code block uses quadruple backticks.
````python
# Hello world function
def hello_world():
print("Hello, world!") # Print greeting
````
### Backticks number mismatch is fixable { #backticks-number-mismatch-is-fixable }
The following code block has triple backticks in the original document, but quadruple backticks in the translated document.
It will be fixed by the fixer tool (will convert to triple backticks).
```Python
# Some Python code
```
### Triple backticks inside quadruple backticks { #triple-backticks-inside-quadruple-backticks }
Comments inside nested code block will NOT be preserved.
````
Here is a code block with quadruple backticks that contains triple backticks inside:
```python
# This is a sample Python code block
def hello_world():
print("Hello, world!") # Print greeting
```
````
# Code includes { #code-includes }
## Simple code includes { #simple-code-includes }
{* ../../docs_src/python_types/tutorial001_py39.py *}
{* ../../docs_src/python_types/tutorial002_py39.py *}
## Code includes with highlighting { #code-includes-with-highlighting }
{* ../../docs_src/python_types/tutorial002_py39.py hl[1] *}
{* ../../docs_src/python_types/tutorial006_py39.py hl[10] *}
## Code includes with line ranges { #code-includes-with-line-ranges }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] *}
## Code includes with line ranges and highlighting { #code-includes-with-line-ranges-and-highlighting }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] hl[31:33] *}
{* ../../docs_src/dependencies/tutorial015_an_py310.py ln[10:15] hl[12:14] *}
## Code includes qith title { #code-includes-with-title }
{* ../../docs_src/bigger_applications/app_an_py39/routers/users.py hl[1,3] title["app/routers/users.py"] *}
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
## Code includes with unknown attributes { #code-includes-with-unknown-attributes }
{* ../../docs_src/python_types/tutorial001_py39.py unknown[123] *}
## Some more code includes to test fixing { #some-more-code-includes-to-test-fixing }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] hl[31:33] *}
# Links { #links }
## Markdown-style links { #markdown-style-links }
This is a [Markdown link](https://example.com) to an external site.
This is a link with attributes: [**FastAPI** Project Generators](project-generation.md){.internal-link target=_blank}
This is a link to the main FastAPI site: [FastAPI](https://fastapi.tiangolo.com) - tool should add language code to the URL.
This is a link to one of the pages on FastAPI site: [How to](https://fastapi.tiangolo.com/how-to/) - tool should add language code to the URL.
Link to test wrong attribute: [**FastAPI** Project Generators](project-generation.md){.internal-link} - tool should fix the attribute.
Link with a title: [Example](https://example.com "Example site") - URL will be fixed, title preserved.
### Markdown link to static assets { #markdown-link-to-static-assets }
These are links to static assets:
* [FastAPI Logo](https://fastapi.tiangolo.com/img/fastapi-logo.png)
* [FastAPI CSS](https://fastapi.tiangolo.com/css/fastapi.css)
* [FastAPI JS](https://fastapi.tiangolo.com/js/fastapi.js)
Tool should NOT add language code to their URLs.
## HTML-style links { #html-style-links }
This is an <a href="https://example.com" target="_blank" class="external-link">HTML link</a> to an external site.
This is an <a href="https://fastapi.tiangolo.com">link to the main FastAPI site</a> - tool should add language code to the URL.
This is an <a href="https://fastapi.tiangolo.com/how-to/">link to one of the pages on FastAPI site</a> - tool should add language code to the URL.
Link to test wrong attribute: <a href="project-generation.md" class="internal-link">**FastAPI** Project Generators</a> - tool should fix the attribute.
### HTML links to static assets { #html-links-to-static-assets }
These are links to static assets:
* <a href="https://fastapi.tiangolo.com/img/fastapi-logo.png">FastAPI Logo</a>
* <a href="https://fastapi.tiangolo.com/css/fastapi.css">FastAPI CSS</a>
* <a href="https://fastapi.tiangolo.com/js/fastapi.js">FastAPI JS</a>
Tool should NOT add language code to their URLs.
# Header (with HTML link to <a href="https://tiangolo.com">tiangolo.com</a>) { #header-with-html-link-to-tiangolo-com }
#Not a header
```Python
# Also not a header
```
Some text

240
scripts/tests/test_translation_fixer/test_complex_doc/data/translated_doc.md

@ -0,0 +1,240 @@
# Тестовый инструмент исправления переводов { #test-translation-fixer }
## Блоки кода с комментариями и без комментариев { #code-blocks-with-and-without-comments }
Это тестовая страница для инструмента исправления переводов.
### Блоки кода с комментариями { #code-blocks-with-comments }
Следующие блоки кода содержат комментарии в разных стилях.
Инструмент исправления должен исправлять содержимое, но корректно сохранять комментарии.
```python
# Это пример блока кода на Python
def hello_world():
# Комментарий с отступом
print("Hello, world!") # Печать приветствия
```
```toml
# Это пример блока кода на TOML
title = "TOML Example" # Заголовок документа
```
```console
// Используйте команду "live" и передайте код языка в качестве аргумента CLI
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
```json
{
// Это пример блока кода на JSON
"greeting": "Hello, world!" // Печать приветствия
}
```
### Блоки кода с комментариями, где язык использует другие стили комментариев { #code-blocks-with-different-comment-styles }
Следующие блоки кода содержат комментарии в разных стилях в зависимости от языка.
Инструмент исправления не будет сохранять комментарии в этих блоках.
```json
{
# Это пример блока кода на JSON
"greeting": "Hello, world!" # Печать приветствия
}
```
```console
# Это пример блока кода консоли
$ echo "Hello, world!" # Печать приветствия
```
```toml
// Это пример блока кода на TOML
title = "TOML Example" // Заголовок документа
```
### Блоки кода с комментариями на неподдерживаемых языках или без указания языка { #code-blocks-with-unsupported-languages }
Следующие блоки кода используют неподдерживаемые языки для сохранения комментариев.
Инструмент исправления не будет сохранять комментарии в этих блоках.
```javascript
// Это пример блока кода на JavaScript
console.log("Hello, world!"); // Печать приветствия
```
```
# Это пример блока кода консоли
$ echo "Hello, world!" # Печать приветствия
```
```
// Это пример блока кода консоли
$ echo "Hello, world!" // Печать приветствия
```
### Блоки кода с комментариями, которые не соответствуют шаблону { #code-blocks-with-comments-without-pattern }
Инструмент исправления ожидает комментарии, которые соответствуют определённому шаблону:
- Для комментариев в стиле с решёткой: комментарий начинается с `# ` (решётка, затем пробел) в начале строки или после пробела.
- Для комментариев в стиле со слешами: комментарий начинается с `// ` (два слеша, затем пробел) в начале строки или после пробела.
Если комментарий не соответствует этому шаблону, инструмент исправления не будет его сохранять.
```python
#Объявление функции
def hello_world():# Печать приветствия
print("Hello, world!") #Печать приветствия без пробела после решётки
```
```console
//Объявление функции
def hello_world():// Печать приветствия
print("Hello, world!") //Печать приветствия без пробела после слешей
```
## Блок кода с четырёхкратными обратными кавычками { #code-blocks-with-quadruple-backticks }
Следующий блок кода содержит четырёхкратные обратные кавычки.
````python
# Функция приветствия
def hello_world():
print("Hello, world") # Печать приветствия
````
### Несоответствие обратных кавычек фиксится { #backticks-number-mismatch-is-fixable }
Следующий блок кода имеет тройные обратные кавычки в оригинальном документе, но четырёхкратные обратные кавычки в переведённом документе.
Это будет исправлено инструментом исправления (будет преобразовано в тройные обратные кавычки).
````Python
# Немного кода на Python
````
### Блок кода в тройных обратных кавычка внутри блока кода в четырёхкратных обратных кавычках { #triple-backticks-inside-quadruple-backticks }
Комментарии внутри вложенного блока кода в тройных обратных кавычках НЕ БУДУТ сохранены.
````
Here is a code block with quadruple backticks that contains triple backticks inside:
```python
# Этот комментарий НЕ будет сохранён
def hello_world():
print("Hello, world") # Как и этот комментарий
```
````
# Включения кода { #code-includes }
## Простые включения кода { #simple-code-includes }
{* ../../docs_src/python_types/tutorial001_py39.py *}
{* ../../docs_src/python_types/tutorial002_py39.py *}
## Включения кода с подсветкой { #code-includes-with-highlighting }
{* ../../docs_src/python_types/tutorial002_py39.py hl[1] *}
{* ../../docs_src/python_types/tutorial006_py39.py hl[10] *}
## Включения кода с диапазонами строк { #code-includes-with-line-ranges }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] *}
## Включения кода с диапазонами строк и подсветкой { #code-includes-with-line-ranges-and-highlighting }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] hl[31:33] *}
{* ../../docs_src/dependencies/tutorial015_an_py310.py ln[10:15] hl[12:14] *}
## Включения кода с заголовком { #code-includes-with-title }
{* ../../docs_src/bigger_applications/app_an_py39/routers/users.py hl[1,3] title["app/routers/users.py"] *}
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
## Включения кода с неизвестными атрибутами { #code-includes-with-unknown-attributes }
{* ../../docs_src/python_types/tutorial001_py39.py unknown[123] *}
## Ещё включения кода для тестирования исправления { #some-more-code-includes-to-test-fixing }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19 : 21] *}
{* ../../docs_src/bigger_applications/app_an_py39/wrong.py hl[3] title["app/internal/admin.py"] *}
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[1:30] hl[1:10] *}
# Ссылки { #links }
## Ссылки в стиле Markdown { #markdown-style-links }
Это [Markdown-ссылка](https://example.com) на внешний сайт.
Это ссылка с атрибутами: [**FastAPI** генераторы проектов](project-generation.md){.internal-link target=_blank}
Это ссылка на основной сайт FastAPI: [FastAPI](https://fastapi.tiangolo.com) — инструмент должен добавить код языка в URL.
Это ссылка на одну из страниц на сайте FastAPI: [How to](https://fastapi.tiangolo.com/how-to) — инструмент должен добавить код языка в URL.
Ссылка для тестирования неправильного атрибута: [**FastAPI** генераторы проектов](project-generation.md){.external-link} - инструмент должен исправить атрибут.
Ссылка с заголовком: [Пример](http://example.com/ "Сайт для примера") - URL будет исправлен инструментом, заголовок сохранится.
### Markdown ссылки на статические ресурсы { #markdown-link-to-static-assets }
Это ссылки на статические ресурсы:
* [FastAPI Logo](https://fastapi.tiangolo.com/img/fastapi-logo.png)
* [FastAPI CSS](https://fastapi.tiangolo.com/css/fastapi.css)
* [FastAPI JS](https://fastapi.tiangolo.com/js/fastapi.js)
Инструмент НЕ должен добавлять код языка в их URL.
## Ссылки в стиле HTML { #html-style-links }
Это <a href="https://example.com" target="_blank" class="external-link">HTML-ссылка</a> на внешний сайт.
Это <a href="https://fastapi.tiangolo.com">ссылка на основной сайт FastAPI</a> — инструмент должен добавить код языка в URL.
Это <a href="https://fastapi.tiangolo.com/how-to/">ссылка на одну из страниц на сайте FastAPI</a> — инструмент должен добавить код языка в URL.
Ссылка для тестирования неправильного атрибута: <a href="project-generation.md" class="external-link">**FastAPI** генераторы проектов</a> - инструмент должен исправить атрибут.
### HTML ссылки на статические ресурсы { #html-links-to-static-assets }
Это ссылки на статические ресурсы:
* <a href="https://fastapi.tiangolo.com/img/fastapi-logo.png">FastAPI Logo</a>
* <a href="https://fastapi.tiangolo.com/css/fastapi.css">FastAPI CSS</a>
* <a href="https://fastapi.tiangolo.com/js/fastapi.js">FastAPI JS</a>
Инструмент НЕ должен добавлять код языка в их URL.
# Заголовок (с HTML ссылкой на <a href="https://tiangolo.com">tiangolo.com</a>) { #header-5 }
#Не заголовок
```Python
# Также не заголовок
```
Немного текста

240
scripts/tests/test_translation_fixer/test_complex_doc/data/translated_doc_expected.md

@ -0,0 +1,240 @@
# Тестовый инструмент исправления переводов { #test-translation-fixer }
## Блоки кода с комментариями и без комментариев { #code-blocks-with-and-without-comments }
Это тестовая страница для инструмента исправления переводов.
### Блоки кода с комментариями { #code-blocks-with-comments }
Следующие блоки кода содержат комментарии в разных стилях.
Инструмент исправления должен исправлять содержимое, но корректно сохранять комментарии.
```python
# Это пример блока кода на Python
def hello_world():
# Комментарий с отступом
print("Hello, world!") # Печать приветствия
```
```toml
# Это пример блока кода на TOML
title = "TOML Example" # Заголовок документа
```
```console
// Используйте команду "live" и передайте код языка в качестве аргумента CLI
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
```json
{
// Это пример блока кода на JSON
"greeting": "Hello, world!" // Печать приветствия
}
```
### Блоки кода с комментариями, где язык использует другие стили комментариев { #code-blocks-with-different-comment-styles }
Следующие блоки кода содержат комментарии в разных стилях в зависимости от языка.
Инструмент исправления не будет сохранять комментарии в этих блоках.
```json
{
# This is a sample JSON code block
"greeting": "Hello, world!" # Print greeting
}
```
```console
# This is a sample console code block
$ echo "Hello, world!" # Print greeting
```
```toml
// This is a sample TOML code block
title = "TOML Example" // Title of the document
```
### Блоки кода с комментариями на неподдерживаемых языках или без указания языка { #code-blocks-with-unsupported-languages }
Следующие блоки кода используют неподдерживаемые языки для сохранения комментариев.
Инструмент исправления не будет сохранять комментарии в этих блоках.
```javascript
// This is a sample JavaScript code block
console.log("Hello, world!"); // Print greeting
```
```
# This is a sample console code block
$ echo "Hello, world!" # Print greeting
```
```
// This is a sample console code block
$ echo "Hello, world!" // Print greeting
```
### Блоки кода с комментариями, которые не соответствуют шаблону { #code-blocks-with-comments-without-pattern }
Инструмент исправления ожидает комментарии, которые соответствуют определённому шаблону:
- Для комментариев в стиле с решёткой: комментарий начинается с `# ` (решётка, затем пробел) в начале строки или после пробела.
- Для комментариев в стиле со слешами: комментарий начинается с `// ` (два слеша, затем пробел) в начале строки или после пробела.
Если комментарий не соответствует этому шаблону, инструмент исправления не будет его сохранять.
```python
#Function declaration
def hello_world():# Print greeting
print("Hello, world!") #Print greeting without space after hash
```
```console
//Function declaration
def hello_world():// Print greeting
print("Hello, world!") //Print greeting without space after slashes
```
## Блок кода с четырёхкратными обратными кавычками { #code-blocks-with-quadruple-backticks }
Следующий блок кода содержит четырёхкратные обратные кавычки.
````python
# Функция приветствия
def hello_world():
print("Hello, world!") # Печать приветствия
````
### Несоответствие обратных кавычек фиксится { #backticks-number-mismatch-is-fixable }
Следующий блок кода имеет тройные обратные кавычки в оригинальном документе, но четырёхкратные обратные кавычки в переведённом документе.
Это будет исправлено инструментом исправления (будет преобразовано в тройные обратные кавычки).
```Python
# Немного кода на Python
```
### Блок кода в тройных обратных кавычка внутри блока кода в четырёхкратных обратных кавычках { #triple-backticks-inside-quadruple-backticks }
Комментарии внутри вложенного блока кода в тройных обратных кавычках НЕ БУДУТ сохранены.
````
Here is a code block with quadruple backticks that contains triple backticks inside:
```python
# This is a sample Python code block
def hello_world():
print("Hello, world!") # Print greeting
```
````
# Включения кода { #code-includes }
## Простые включения кода { #simple-code-includes }
{* ../../docs_src/python_types/tutorial001_py39.py *}
{* ../../docs_src/python_types/tutorial002_py39.py *}
## Включения кода с подсветкой { #code-includes-with-highlighting }
{* ../../docs_src/python_types/tutorial002_py39.py hl[1] *}
{* ../../docs_src/python_types/tutorial006_py39.py hl[10] *}
## Включения кода с диапазонами строк { #code-includes-with-line-ranges }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] *}
## Включения кода с диапазонами строк и подсветкой { #code-includes-with-line-ranges-and-highlighting }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] hl[31:33] *}
{* ../../docs_src/dependencies/tutorial015_an_py310.py ln[10:15] hl[12:14] *}
## Включения кода с заголовком { #code-includes-with-title }
{* ../../docs_src/bigger_applications/app_an_py39/routers/users.py hl[1,3] title["app/routers/users.py"] *}
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
## Включения кода с неизвестными атрибутами { #code-includes-with-unknown-attributes }
{* ../../docs_src/python_types/tutorial001_py39.py unknown[123] *}
## Ещё включения кода для тестирования исправления { #some-more-code-includes-to-test-fixing }
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[19:21] *}
{* ../../docs_src/bigger_applications/app_an_py39/internal/admin.py hl[3] title["app/internal/admin.py"] *}
{* ../../docs_src/dependencies/tutorial013_an_py310.py ln[30:38] hl[31:33] *}
# Ссылки { #links }
## Ссылки в стиле Markdown { #markdown-style-links }
Это [Markdown-ссылка](https://example.com) на внешний сайт.
Это ссылка с атрибутами: [**FastAPI** генераторы проектов](project-generation.md){.internal-link target=_blank}
Это ссылка на основной сайт FastAPI: [FastAPI](https://fastapi.tiangolo.com/lang) — инструмент должен добавить код языка в URL.
Это ссылка на одну из страниц на сайте FastAPI: [How to](https://fastapi.tiangolo.com/lang/how-to/) — инструмент должен добавить код языка в URL.
Ссылка для тестирования неправильного атрибута: [**FastAPI** генераторы проектов](project-generation.md){.internal-link} - инструмент должен исправить атрибут.
Ссылка с заголовком: [Пример](https://example.com "Сайт для примера") - URL будет исправлен инструментом, заголовок сохранится.
### Markdown ссылки на статические ресурсы { #markdown-link-to-static-assets }
Это ссылки на статические ресурсы:
* [FastAPI Logo](https://fastapi.tiangolo.com/img/fastapi-logo.png)
* [FastAPI CSS](https://fastapi.tiangolo.com/css/fastapi.css)
* [FastAPI JS](https://fastapi.tiangolo.com/js/fastapi.js)
Инструмент НЕ должен добавлять код языка в их URL.
## Ссылки в стиле HTML { #html-style-links }
Это <a href="https://example.com" target="_blank" class="external-link">HTML-ссылка</a> на внешний сайт.
Это <a href="https://fastapi.tiangolo.com/lang">ссылка на основной сайт FastAPI</a> — инструмент должен добавить код языка в URL.
Это <a href="https://fastapi.tiangolo.com/lang/how-to/">ссылка на одну из страниц на сайте FastAPI</a> — инструмент должен добавить код языка в URL.
Ссылка для тестирования неправильного атрибута: <a href="project-generation.md" class="internal-link">**FastAPI** генераторы проектов</a> - инструмент должен исправить атрибут.
### HTML ссылки на статические ресурсы { #html-links-to-static-assets }
Это ссылки на статические ресурсы:
* <a href="https://fastapi.tiangolo.com/img/fastapi-logo.png">FastAPI Logo</a>
* <a href="https://fastapi.tiangolo.com/css/fastapi.css">FastAPI CSS</a>
* <a href="https://fastapi.tiangolo.com/js/fastapi.js">FastAPI JS</a>
Инструмент НЕ должен добавлять код языка в их URL.
# Заголовок (с HTML ссылкой на <a href="https://tiangolo.com">tiangolo.com</a>) { #header-with-html-link-to-tiangolo-com }
#Не заголовок
```Python
# Также не заголовок
```
Немного текста

30
scripts/tests/test_translation_fixer/test_complex_doc/test_compex_doc.py

@ -0,0 +1,30 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_complex_doc/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc.md")],
indirect=True,
)
def test_fix(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 0, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = (data_path / "translated_doc_expected.md").read_text("utf-8")
assert fixed_content == expected_content
assert "Fixing multiline code blocks in" in result.output
assert "Fixing markdown links in" in result.output

19
scripts/tests/test_translation_fixer/test_header_permalinks/data/en_doc.md

@ -0,0 +1,19 @@
# Header 1 { #header-1 }
Some text
## Header 2 { #header-2 }
Some more text
### Header 3 { #header-3 }
Even more text
# Header 4 { #header-4 }
A bit more text
#Not a header
Final portion of text

19
scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_level_mismatch_1.md

@ -0,0 +1,19 @@
# Header 1 { #header-1 }
Some text
# Header 2 { #header-2 }
Some more text
### Header 3 { #header-3 }
Even more text
# Header 4 { #header-4 }
A bit more text
#Not a header
Final portion of text

19
scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_level_mismatch_2.md

@ -0,0 +1,19 @@
# Header 1 { #header-1 }
Some text
## Header 2 { #header-2 }
Some more text
### Header 3 { #header-3 }
Even more text
## Header 4 { #header-4 }
A bit more text
#Not a header
Final portion of text

19
scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_number_gt.md

@ -0,0 +1,19 @@
# Header 1 { #header-1 }
Some text
## Header 2 { #header-2 }
Some more text
### Header 3 { #header-3 }
Even more text
# Header 4 { #header-4 }
A bit more text
# Extra header
Final portion of text

19
scripts/tests/test_translation_fixer/test_header_permalinks/data/translated_doc_number_lt.md

@ -0,0 +1,19 @@
# Header 1 { #header-1 }
Some text
## Header 2 { #header-2 }
Some more text
### Header 3 { #header-3 }
Even more text
Header 4 is missing
A bit more text
#Not a header
Final portion of text

60
scripts/tests/test_translation_fixer/test_header_permalinks/test_header_level_mismatch.py

@ -0,0 +1,60 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_header_permalinks/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_level_mismatch_1.md")],
indirect=True,
)
def test_level_mismatch_1(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(
f"{data_path}/translated_doc_level_mismatch_1.md"
).read_text("utf-8")
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Header levels do not match between document and original document"
" (found #, expected ##) for header №2 in line 5"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_level_mismatch_2.md")],
indirect=True,
)
def test_level_mismatch_2(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(
f"{data_path}/translated_doc_level_mismatch_2.md"
).read_text("utf-8")
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Header levels do not match between document and original document"
" (found ##, expected #) for header №4 in line 13"
) in result.output

60
scripts/tests/test_translation_fixer/test_header_permalinks/test_header_number_mismatch.py

@ -0,0 +1,60 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_header_permalinks/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_gt.md")],
indirect=True,
)
def test_gt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_gt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of headers with permalinks does not match the number "
"in the original document (5 vs 4)"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_lt.md")],
indirect=True,
)
def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_lt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of headers with permalinks does not match the number "
"in the original document (3 vs 4)"
) in result.output

19
scripts/tests/test_translation_fixer/test_html_links/data/en_doc.md

@ -0,0 +1,19 @@
# Header 1 { #header-1 }
Some text with a link to <a href="https://fastapi.tiangolo.com">FastAPI</a>.
## Header 2 { #header-2 }
Two links here: <a href="https://fastapi.tiangolo.com/how-to/">How to</a> and <a href="project-generation.md" class="internal-link" target="_blank">Project Generators</a>.
### Header 3 { #header-3 }
Another link: <a href="project-generation.md" class="internal-link" target="_blank" title="Link title">**FastAPI** Project Generators</a> with title.
# Header 4 { #header-4 }
Link to anchor: <a href="#header-2">Header 2</a>
# Header with <a href="http://example.com">link</a> { #header-with-link }
Some text

21
scripts/tests/test_translation_fixer/test_html_links/data/translated_doc_number_gt.md

@ -0,0 +1,21 @@
# Заголовок 1 { #header-1 }
Немного текста со ссылкой на <a href="https://fastapi.tiangolo.com">FastAPI</a>.
## Заголовок 2 { #header-2 }
Две ссылки здесь: <a href="https://fastapi.tiangolo.com/how-to/">How to</a> и <a href="project-generation.md" class="internal-link" target="_blank">Project Generators</a>.
### Заголовок 3 { #header-3 }
Ещё ссылка: <a href="project-generation.md" class="internal-link" target="_blank" title="Тайтл">**FastAPI** Генераторы Проектов</a> с тайтлом.
И ещё одна <a href="https://github.com">экстра ссылка</a>.
# Заголовок 4 { #header-4 }
Ссылка на якорь: <a href="#header-2">Заголовок 2</a>
# Заголовок со <a href="http://example.com">ссылкой</a> { #header-with-link }
Немного текста

19
scripts/tests/test_translation_fixer/test_html_links/data/translated_doc_number_lt.md

@ -0,0 +1,19 @@
# Заголовок 1 { #header-1 }
Немного текста со ссылкой на <a href="https://fastapi.tiangolo.com">FastAPI</a>.
## Заголовок 2 { #header-2 }
Две ссылки здесь: <a href="https://fastapi.tiangolo.com/how-to/">How to</a> и <a href="project-generation.md" class="internal-link" target="_blank">Project Generators</a>.
### Заголовок 3 { #header-3 }
Ещё ссылка: <a href="project-generation.md" class="internal-link" target="_blank" title="Тайтл">**FastAPI** Генераторы Проектов</a> с тайтлом.
# Заголовок 4 { #header-4 }
Ссылка на якорь: <a href="#header-2">Заголовок 2</a>
# Заголовок с потерянной ссылкой { #header-with-link }
Немного текста

58
scripts/tests/test_translation_fixer/test_html_links/test_html_links_number_mismatch.py

@ -0,0 +1,58 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path("scripts/tests/test_translation_fixer/test_html_links/data").absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_gt.md")],
indirect=True,
)
def test_gt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_gt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of HTML links does not match the number "
"in the original document (7 vs 6)"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_lt.md")],
indirect=True,
)
def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
# assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_lt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of HTML links does not match the number "
"in the original document (5 vs 6)"
) in result.output

19
scripts/tests/test_translation_fixer/test_markdown_links/data/en_doc.md

@ -0,0 +1,19 @@
# Header 1 { #header-1 }
Some text with a link to [FastAPI](https://fastapi.tiangolo.com).
## Header 2 { #header-2 }
Two links here: [How to](https://fastapi.tiangolo.com/how-to/) and [Project Generators](project-generation.md){.internal-link target=_blank}.
### Header 3 { #header-3 }
Another link: [**FastAPI** Project Generators](project-generation.md "Link title"){.internal-link target=_blank} with title.
# Header 4 { #header-4 }
Link to anchor: [Header 2](#header-2)
# Header with [link](http://example.com) { #header-with-link }
Some text

19
scripts/tests/test_translation_fixer/test_markdown_links/data/translated_doc.md

@ -0,0 +1,19 @@
# Заголовок 1 { #header-1 }
Немного текста со ссылкой на [FastAPI](https://fastapi.tiangolo.com).
## Заголовок 2 { #header-2 }
Две ссылки здесь: [How to](https://fastapi.tiangolo.com/how-to/) и [Project Generators](project-generation.md){.internal-link target=_blank}.
### Заголовок 3 { #header-3 }
Ещё ссылка: [**FastAPI** Генераторы Проектов](project-generation.md "Тайтл"){.internal-link target=_blank} с тайтлом.
# Заголовок 4 { #header-4 }
Ссылка на якорь: [Заголовок 2](#header-2)
# Заголовок со [ссылкой](http://example.com) { #header-with-link }
Немного текста

21
scripts/tests/test_translation_fixer/test_markdown_links/data/translated_doc_number_gt.md

@ -0,0 +1,21 @@
# Заголовок 1 { #header-1 }
Немного текста со ссылкой на [FastAPI](https://fastapi.tiangolo.com).
## Заголовок 2 { #header-2 }
Две ссылки здесь: [How to](https://fastapi.tiangolo.com/how-to/) и [Project Generators](project-generation.md){.internal-link target=_blank}.
### Заголовок 3 { #header-3 }
Ещё ссылка: [**FastAPI** Генераторы Проектов](project-generation.md "Тайтл"){.internal-link target=_blank} с тайтлом.
И ещё одна [экстра ссылка](https://github.com).
# Заголовок 4 { #header-4 }
Ссылка на якорь: [Заголовок 2](#header-2)
# Заголовок со [ссылкой](http://example.com) { #header-with-link }
Немного текста

19
scripts/tests/test_translation_fixer/test_markdown_links/data/translated_doc_number_lt.md

@ -0,0 +1,19 @@
# Заголовок 1 { #header-1 }
Немного текста со ссылкой на [FastAPI](https://fastapi.tiangolo.com).
## Заголовок 2 { #header-2 }
Две ссылки здесь: [How to](https://fastapi.tiangolo.com/how-to/) и [Project Generators](project-generation.md){.internal-link target=_blank}.
### Заголовок 3 { #header-3 }
Ещё ссылка: [**FastAPI** Генераторы Проектов](project-generation.md "Тайтл"){.internal-link target=_blank} с тайтлом.
# Заголовок 4 { #header-4 }
Ссылка на якорь: [Заголовок 2](#header-2)
# Заголовок с потерянной ссылкой { #header-with-link }
Немного текста

60
scripts/tests/test_translation_fixer/test_markdown_links/test_mkd_links_number_mismatch.py

@ -0,0 +1,60 @@
from pathlib import Path
import pytest
from typer.testing import CliRunner
from scripts.translation_fixer import cli
data_path = Path(
"scripts/tests/test_translation_fixer/test_markdown_links/data"
).absolute()
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_gt.md")],
indirect=True,
)
def test_gt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_gt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of markdown links does not match the number "
"in the original document (7 vs 6)"
) in result.output
@pytest.mark.parametrize(
"copy_test_files",
[(f"{data_path}/en_doc.md", f"{data_path}/translated_doc_number_lt.md")],
indirect=True,
)
def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
result = runner.invoke(
cli,
["fix-pages", "docs/lang/docs/doc.md"],
)
# assert result.exit_code == 1, result.output
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text("utf-8")
expected_content = Path(f"{data_path}/translated_doc_number_lt.md").read_text(
"utf-8"
)
assert fixed_content == expected_content # Translated doc remains unchanged
assert "Error processing docs/lang/docs/doc.md" in result.output
assert (
"Number of markdown links does not match the number "
"in the original document (5 vs 6)"
) in result.output

662
scripts/translate.py

@ -25,650 +25,8 @@ non_translated_sections = (
"contributing.md", "contributing.md",
) )
general_prompt_path = Path(__file__).absolute().parent / "general-llm-prompt.md"
general_prompt = """ general_prompt = general_prompt_path.read_text(encoding="utf-8")
### About literal text in this prompt
1) In the following instructions (after I say: `The above rules are in effect now`) the two characters `«` and `»` will be used to surround LITERAL TEXT, which is text or characters you shall interpret literally. The `«` and the `»` are not part of the literal text, they are the meta characters denoting it.
2) Furthermore, text surrounded by `«««` and `»»»` is a BLOCK OF LITERAL TEXT which spans multiple lines. To get its content, dedent all lines of the block until the `«««` and `»»»` are at column zero, then remove the newline (`\n`) after the `«««` and the newline before the `»»»`. The `«««` and the `»»»` are not part of the literal text block, they are the meta characters denoting it.
3) If you see backticks or any other quotes inside literal text inside `«` and `»` or inside blocks of literal text inside `«««` and `»»»` then interpret them as literal characters, do NOT interpret them as meta characters.
The above rules are in effect now.
### Definitions of terms used in this prompt
"backtick"
The character «`»
Unicode U+0060 (GRAVE ACCENT)
"single backtick"
A single backtick «`»
"triple backticks"
Three backticks in a row «```»
"neutral double quote"
The character «"»
Unicode U+0022 (QUOTATION MARK)
"neutral single quote"
The character «'»
Unicode U+0027 (APOSTROPHE)
"English double typographic quotes"
The characters «» and «»
Unicode U+201C (LEFT DOUBLE QUOTATION MARK) and Unicode U+201D (RIGHT DOUBLE QUOTATION MARK)
"English single typographic quotes"
The characters «» and «»
Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and Unicode U+2019 (RIGHT SINGLE QUOTATION MARK)
"code snippet"
Also called "inline code". Text in a Markdown document which is surrounded by single backticks. A paragraph in a Markdown document can have a more than one code snippet.
Example:
«««
`i am a code snippet`
»»»
Example:
«««
`first code snippet` `second code snippet` `third code snippet`
»»»
"code block"
Text in a Markdown document which is surrounded by triple backticks. Spreads multiple lines.
Example:
«««
```
Hello
World
```
»»»
Example:
«««
```python
print("hello World")
```
»»»
"HTML element"
a HTML opening tag e.g. «<div>» and a HTML closing tag e.g. «</div>» surrounding text or other HTML elements.
### Your task
Translate an English text the original content to a target language.
The original content is written in Markdown, write the translation in Markdown as well.
The original content will be surrounded by triple percentage signs («%%%»). Do not include the triple percentage signs in the translation.
### Technical terms in English
For technical terms in English that don't have a common translation term, use the original term in English.
### Content of code snippets
Do not translate the content of code snippets, keep the original in English. For example, «`list`», «`dict`», keep them as is.
### Content of code blocks
Do not translate the content of code blocks, except for comments in the language which the code block uses.
Examples:
Source (English) The code block is a bash code example with one comment:
«««
```bash
# Print greeting
echo "Hello, World!"
```
»»»
Result (German):
«««
```bash
# Gruß ausgeben
echo "Hello, World!"
```
»»»
Source (English) The code block is a console example containing HTML tags. No comments, so nothing to change here:
«««
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
»»»
Result (German):
«««
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
»»»
Source (English) The code block is a console example containing 5 comments:
«««
```console
// Go to the home directory
$ cd
// Create a directory for all your code projects
$ mkdir code
// Enter into that code directory
$ cd code
// Create a directory for this project
$ mkdir awesome-project
// Enter into that project directory
$ cd awesome-project
```
»»»
Result (German):
«««
```console
// Gehe zum Home-Verzeichnis
$ cd
// Erstelle ein Verzeichnis für alle Ihre Code-Projekte
$ mkdir code
// Gehe in dieses Code-Verzeichnis
$ cd code
// Erstelle ein Verzeichnis für dieses Projekt
$ mkdir awesome-project
// Gehe in dieses Projektverzeichnis
$ cd awesome-project
```
»»»
If there is an existing translation and its Mermaid diagram is in sync with the Mermaid diagram in the English source, except a few translated words, then use the Mermaid diagram of the existing translation. The human editor of the translation translated these words in the Mermaid diagram. Keep these translations, do not revert them back to the English source.
Example:
Source (English):
«««
```mermaid
flowchart LR
subgraph global[global env]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone project]
stone(philosophers-stone) -->|requires| harry-1
end
```
»»»
Existing translation (German) has three translations:
«««
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
»»»
Result (German) you change nothing:
«««
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
»»»
### Special blocks
There are special blocks of notes, tips and others that look like:
«««
/// note
»»»
To translate it, keep the same line and add the translation after a vertical bar.
For example, if you were translating to Spanish, you would write:
«««
/// note | Nota
»»»
Some examples in Spanish:
Source:
«««
/// tip
»»»
Result:
«««
/// tip | Consejo
»»»
Source:
«««
/// details | Preview
»»»
Result:
«««
/// details | Vista previa
»»»
### Tab blocks
There are special blocks surrounded by four slashes («////»). They mark text, which will be rendered as part of a tab in the final document. The scheme is:
//// tab | {tab title}
{tab content, may span many lines}
////
Keep everything before the vertical bar («|») as is, including the vertical bar. Translate the tab title. Translate the tab content, applying the rules you know. Keep the four block closing slashes as is.
Examples:
Source (English):
«««
//// tab | Python 3.8+ non-Annotated
Hello
////
»»»
Result (German):
«««
//// tab | Python 3.8+ nicht annotiert
Hallo
////
»»»
Source (English) Here there is nothing to translate in the tab title:
«««
//// tab | Linux, macOS, Windows Bash
Hello again
////
»»»
Result (German):
«««
//// tab | Linux, macOS, Windows Bash
Hallo wieder
////
»»»
### Headings
Every Markdown heading in the English text (all levels) ends with a part inside curly brackets. This part denotes the hash of this heading, which is used in links to this heading. In translations, translate the heading, but do not translate this hash part, so that links do not break.
Examples of how to translate a heading:
Source (English):
«««
## Alternative API docs { #alternative-api-docs }
»»»
Result (Spanish):
«««
## Documentación de la API alternativa { #alternative-api-docs }
»»»
Source (English):
«««
### Example { #example }
»»»
Result (German):
«««
### Beispiel { #example }
»»»
### Links
Use the following rules for links (apply both to Markdown-style links ([text](url)) and to HTML-style <a> tags):
1) For relative URLs, only translate link text. Do not translate the URL or its parts
Example:
Source (English):
«««
[One of the fastest Python frameworks available](#performance)
»»»
Result (German):
«««
[Eines der schnellsten verfügbaren Python-Frameworks](#performance)
»»»
2) For absolute URLs which DO NOT start EXACTLY with «https://fastapi.tiangolo.com», only translate link text and leave the URL unchanged.
Example:
Source (English):
«««
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel docs</a>
»»»
Result (German):
«««
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel-Dokumentation</a>
»»»
3) For absolute URLs which DO start EXACTLY with «https://fastapi.tiangolo.com», only translate link text and change the URL by adding language code («https://fastapi.tiangolo.com/{language_code}[rest part of the url]»).
Example:
Source (English):
«««
<a href="https://fastapi.tiangolo.com/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentation</a>
»»»
Result (Spanish):
«««
<a href="https://fastapi.tiangolo.com/es/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentación</a>
»»»
3.1) Do not add language codes for URLs that point to static assets (e.g., images, CSS, JavaScript).
Example:
Source (English):
«««
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Something</a>
»»»
Result (Spanish):
«««
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Algo</a>
»»»
4) For internal links, only translate link text.
Example:
Source (English):
«««
[Create Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
»»»
Result (German):
«««
[Pull Requests erzeugen](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
»»»
5) Do not translate anchor fragments in links (the part after «#»), as they must remain the same to work correctly.
5.1) If an existing translation has a link with an anchor fragment different to the anchor fragment in the English source, then this is an error. Fix this by using the anchor fragment of the English source.
Example:
Source (English):
«««
[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}
»»»
Existing wrong translation (German) notice the wrongly translated anchor fragment:
«««
[Body Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#einzelne-werte-im-body){.internal-link target=_blank}.
»»»
Result (German) you fix the anchor fragment:
«««
[Body Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
»»»
5.2) Do not add anchor fragments at will, even if this makes sense. If the English source has no anchor, don't add one.
Example:
Source (English):
«««
Create a [virtual environment](../virtual-environments.md){.internal-link target=_blank}
»»»
Wrong translation (German) Anchor added to the URL.
«««
Erstelle eine [virtuelle Umgebung](../virtual-environments.md#create-a-virtual-environment){.internal-link target=_blank}
»»»
Good translation (German) URL stays like in the English source.
«««
Erstelle eine [Virtuelle Umgebung](../virtual-environments.md){.internal-link target=_blank}
»»»
### HTML abbr elements
Translate HTML abbr elements («<abbr title="description">text</abbr>») as follows:
1) If the text surrounded by the abbr element is an abbreviation (the text may be surrounded by further HTML or Markdown markup or quotes, for example «<code>text</code>» or «`text`» or «"text"», ignore that further markup when deciding if the text is an abbreviation), and if the description (the text inside the title attribute) contains the full phrase for this abbreviation, then append a dash («») to the full phrase, followed by the translation of the full phrase.
Conversion scheme:
Source (English):
<abbr title="{full phrase}">{abbreviation}</abbr>
Result:
<abbr title="{full phrase} – {translation of full phrase}">{abbreviation}</abbr>
Examples:
Source (English):
«««
<abbr title="Internet of Things">IoT</abbr>
<abbr title="Central Processing Unit">CPU</abbr>
<abbr title="too long; didn't read"><strong>TL;DR:</strong></abbr>
»»»
Result (German):
«««
<abbr title="Internet of Things – Internet der Dinge">IoT</abbr>
<abbr title="Central Processing Unit – Zentrale Verarbeitungseinheit">CPU</abbr>
<abbr title="too long; didn't read – zu lang; hab's nicht gelesen"><strong>TL;DR:</strong></abbr>
»»»
1.1) If the language to which you translate mostly uses the letters of the ASCII char set (for example Spanish, French, German, but not Russian, Chinese) and if the translation of the full phrase is identical to, or starts with the same letters as the original full phrase, then only give the translation of the full phrase.
Conversion scheme:
Source (English):
<abbr title="{full phrase}">{abbreviation}</abbr>
Result:
<abbr title="{translation of full phrase}">{abbreviation}</abbr>
Examples:
Source (English):
«««
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchronous Server Gateway Interface">ASGI</abbr>
»»»
Result (German):
«««
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchrones Server-Gateway-Interface">ASGI</abbr>
»»»
2) If the description is not a full phrase for an abbreviation which the abbr element surrounds, but some other information, then just translate the description.
Conversion scheme:
Source (English):
<abbr title="{description}">{text}</abbr>
Result:
<abbr title="{translation of description}">{translation of text}</abbr>
Examples:
Source (English):
«««
<abbr title="also known as: endpoints, routes">path</abbr>
<abbr title="a program that checks for code errors">linter</abbr>
<abbr title="converting the string that comes from an HTTP request into Python data">parsing</abbr>
<abbr title="before 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">at the time of writing this</abbr>
»»»
Result (German):
«««
<abbr title="auch bekannt als: Endpunkte, Routen">Pfad</abbr>
<abbr title="Programm das auf Fehler im Code prüft">Linter</abbr>
<abbr title="Konvertieren des Strings eines HTTP-Requests in Python-Daten">Parsen</abbr>
<abbr title="vor 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">zum Zeitpunkt als das hier geschrieben wurde</abbr>
»»»
3) If the text surrounded by the abbr element is an abbreviation and the description contains both the full phrase for that abbreviation, and other information, separated by a colon («:»), then append a dash («») and the translation of the full phrase to the original full phrase and translate the other information.
Conversion scheme:
Source (English):
<abbr title="{full phrase}: {other information}">{abbreviation}</abbr>
Result:
<abbr title="{full phrase} – {translation of full phrase}: {translation of other information}">{abbreviation}</abbr>
Examples:
Source (English):
«««
<abbr title="Input/Output: disk reading or writing, network communication.">I/O</abbr>
<abbr title="Content Delivery Network: service, that provides static files.">CDN</abbr>
<abbr title="Integrated Development Environment: similar to a code editor">IDE</abbr>
»»»
Result (German):
«««
<abbr title="Input/Output – Eingabe/Ausgabe: Lesen oder Schreiben auf der Festplatte, Netzwerkkommunikation.">I/O</abbr>
<abbr title="Content Delivery Network – Inhalte auslieferndes Netzwerk: Dienst, der statische Dateien bereitstellt.">CDN</abbr>
<abbr title="Integrated Development Environment – Integrierte Entwicklungsumgebung: Ähnlich einem Code-Editor">IDE</abbr>
»»»
3.1) Like in rule 2.1, you can leave the original full phrase away, if the translated full phrase is identical or starts with the same letters as the original full phrase.
Conversion scheme:
Source (English):
<abbr title="{full phrase}: {information}">{abbreviation}</abbr>
Result:
<abbr title="{translation of full phrase}: {translation of information}">{abbreviation}</abbr>
Example:
Source (English):
«««
<abbr title="Object Relational Mapper: a fancy term for a library where some classes represent SQL tables and instances represent rows in those tables">ORM</abbr>
»»»
Result (German):
«««
<abbr title="Objektrelationaler Mapper: Ein Fachbegriff für eine Bibliothek, in der einige Klassen SQL-Tabellen und Instanzen Zeilen in diesen Tabellen darstellen">ORM</abbr>
»»»
4) If there is an existing translation, and it has ADDITIONAL abbr elements in a sentence, and these additional abbr elements do not exist in the related sentence in the English text, then KEEP those additional abbr elements in the translation. Do not remove them. Except when you remove the whole sentence from the translation, because the whole sentence was removed from the English text, then also remove the abbr element. The reasoning for this rule is, that such additional abbr elements are manually added by the human editor of the translation, in order to translate or explain an English word to the human readers of the translation. These additional abbr elements would not make sense in the English text, but they do make sense in the translation. So keep them in the translation, even though they are not part of the English text. This rule only applies to abbr elements.
5) Apply above rules also when there is an existing translation! Make sure that all title attributes in abbr elements get properly translated or updated, using the schemes given above. However, leave the ADDITIONAL abbr's from rule 4 alone. Do not change their formatting or content.
"""
app = typer.Typer() app = typer.Typer()
@ -1002,6 +360,9 @@ def make_pr(
command: Annotated[str | None, typer.Option(envvar="COMMAND")] = None, command: Annotated[str | None, typer.Option(envvar="COMMAND")] = None,
github_token: Annotated[str, typer.Option(envvar="GITHUB_TOKEN")], github_token: Annotated[str, typer.Option(envvar="GITHUB_TOKEN")],
github_repository: Annotated[str, typer.Option(envvar="GITHUB_REPOSITORY")], github_repository: Annotated[str, typer.Option(envvar="GITHUB_REPOSITORY")],
commit_in_place: Annotated[
bool, typer.Option(envvar="COMMIT_IN_PLACE", show_default=True)
] = False,
) -> None: ) -> None:
print("Setting up GitHub Actions git user") print("Setting up GitHub Actions git user")
repo = git.Repo(Path(__file__).absolute().parent.parent) repo = git.Repo(Path(__file__).absolute().parent.parent)
@ -1013,6 +374,12 @@ def make_pr(
["git", "config", "user.email", "github-actions[bot]@users.noreply.github.com"], ["git", "config", "user.email", "github-actions[bot]@users.noreply.github.com"],
check=True, check=True,
) )
current_branch = repo.active_branch.name
if current_branch == "master" and commit_in_place:
print("Can't commit directly to master")
raise typer.Exit(code=1)
if not commit_in_place:
branch_name = "translate" branch_name = "translate"
if language: if language:
branch_name += f"-{language}" branch_name += f"-{language}"
@ -1021,6 +388,8 @@ def make_pr(
branch_name += f"-{secrets.token_hex(4)}" branch_name += f"-{secrets.token_hex(4)}"
print(f"Creating a new branch {branch_name}") print(f"Creating a new branch {branch_name}")
subprocess.run(["git", "checkout", "-b", branch_name], check=True) subprocess.run(["git", "checkout", "-b", branch_name], check=True)
else:
print(f"Committing in place on branch {current_branch}")
print("Adding updated files") print("Adding updated files")
git_path = Path("docs") git_path = Path("docs")
subprocess.run(["git", "add", str(git_path)], check=True) subprocess.run(["git", "add", str(git_path)], check=True)
@ -1033,6 +402,7 @@ def make_pr(
subprocess.run(["git", "commit", "-m", message], check=True) subprocess.run(["git", "commit", "-m", message], check=True)
print("Pushing branch") print("Pushing branch")
subprocess.run(["git", "push", "origin", branch_name], check=True) subprocess.run(["git", "push", "origin", branch_name], check=True)
if not commit_in_place:
print("Creating PR") print("Creating PR")
g = Github(github_token) g = Github(github_token)
gh_repo = g.get_repo(github_repository) gh_repo = g.get_repo(github_repository)
@ -1042,7 +412,9 @@ def make_pr(
+ f"\n\nIt uses the prompt file https://github.com/fastapi/fastapi/blob/master/docs/{language}/llm-prompt.md." + f"\n\nIt uses the prompt file https://github.com/fastapi/fastapi/blob/master/docs/{language}/llm-prompt.md."
+ "\n\nIn most cases, it's better to make PRs updating that file so that the LLM can do a better job generating the translations than suggesting changes in this PR." + "\n\nIn most cases, it's better to make PRs updating that file so that the LLM can do a better job generating the translations than suggesting changes in this PR."
) )
pr = gh_repo.create_pull(title=message, body=body, base="master", head=branch_name) pr = gh_repo.create_pull(
title=message, body=body, base="master", head=branch_name
)
print(f"Created PR: {pr.number}") print(f"Created PR: {pr.number}")
print("Finished") print("Finished")

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save