# 🛠️ - 📉

🥇, 👆 💪 💚 👀 🔰 🌌 [ℹ FastAPI &amp; 🤚 ℹ](help-fastapi.md){.internal-link target=_blank}.

## 🛠️

🚥 👆 ⏪ 🖖 🗃 &amp; 👆 💭 👈 👆 💪 ⏬ 🤿 📟, 📥 📄 ⚒ 🆙 👆 🌐.

### 🕹 🌐 ⏮️ `venv`

👆 💪 ✍ 🕹 🌐 📁 ⚙️ 🐍 `venv` 🕹:

<div class="termy">

```console
$ python -m venv env
```

</div>

👈 🔜 ✍ 📁 `./env/` ⏮️ 🐍 💱 &amp; ⤴️ 👆 🔜 💪 ❎ 📦 👈 ❎ 🌐.

### 🔓 🌐

🔓 🆕 🌐 ⏮️:

=== "💾, 🇸🇻"

    <div class="termy">

    ```console
    $ source ./env/bin/activate
    ```

    </div>

=== "🚪 📋"

    <div class="termy">

    ```console
    $ .\env\Scripts\Activate.ps1
    ```

    </div>

=== "🚪 🎉"

    ⚖️ 🚥 👆 ⚙️ 🎉 🖥 (✅ <a href="https://gitforwindows.org/" class="external-link" target="_blank">🐛 🎉</a>):

    <div class="termy">

    ```console
    $ source ./env/Scripts/activate
    ```

    </div>

✅ ⚫️ 👷, ⚙️:

=== "💾, 🇸🇻, 🚪 🎉"

    <div class="termy">

    ```console
    $ which pip

    some/directory/fastapi/env/bin/pip
    ```

    </div>

=== "🚪 📋"

    <div class="termy">

    ```console
    $ Get-Command pip

    some/directory/fastapi/env/bin/pip
    ```

    </div>

🚥 ⚫️ 🎦 `pip` 💱 `env/bin/pip` ⤴️ ⚫️ 👷. 👶

⚒ 💭 👆 ✔️ 📰 🐖 ⏬ 🔛 👆 🕹 🌐 ❎ ❌ 🔛 ⏭ 📶:

<div class="termy">

```console
$ python -m pip install --upgrade pip

---> 100%
```

</div>

!!! tip
    🔠 🕰 👆 ❎ 🆕 📦 ⏮️ `pip` 🔽 👈 🌐, 🔓 🌐 🔄.

    👉 ⚒ 💭 👈 🚥 👆 ⚙️ 📶 📋 ❎ 👈 📦, 👆 ⚙️ 1️⃣ ⚪️➡️ 👆 🇧🇿 🌐 &amp; 🚫 🙆 🎏 👈 💪 ❎ 🌐.

### 🐖

⏮️ 🔓 🌐 🔬 🔛:

<div class="termy">

```console
$ pip install -e ."[dev,doc,test]"

---> 100%
```

</div>

⚫️ 🔜 ❎ 🌐 🔗 &amp; 👆 🇧🇿 FastAPI 👆 🇧🇿 🌐.

#### ⚙️ 👆 🇧🇿 FastAPI

🚥 👆 ✍ 🐍 📁 👈 🗄 &amp; ⚙️ FastAPI, &amp; 🏃 ⚫️ ⏮️ 🐍 ⚪️➡️ 👆 🇧🇿 🌐, ⚫️ 🔜 ⚙️ 👆 🇧🇿 FastAPI ℹ 📟.

&amp; 🚥 👆 ℹ 👈 🇧🇿 FastAPI ℹ 📟, ⚫️ ❎ ⏮️ `-e`, 🕐❔ 👆 🏃 👈 🐍 📁 🔄, ⚫️ 🔜 ⚙️ 🍋 ⏬ FastAPI 👆 ✍.

👈 🌌, 👆 🚫 ✔️ "❎" 👆 🇧🇿 ⏬ 💪 💯 🔠 🔀.

### 📁

📤 ✍ 👈 👆 💪 🏃 👈 🔜 📁 &amp; 🧹 🌐 👆 📟:

<div class="termy">

```console
$ bash scripts/format.sh
```

</div>

⚫️ 🔜 🚘-😇 🌐 👆 🗄.

⚫️ 😇 👫 ☑, 👆 💪 ✔️ FastAPI ❎ 🌐 👆 🌐, ⏮️ 📋 📄 🔛 ⚙️ `-e`.

## 🩺

🥇, ⚒ 💭 👆 ⚒ 🆙 👆 🌐 🔬 🔛, 👈 🔜 ❎ 🌐 📄.

🧾 ⚙️ <a href="https://www.mkdocs.org/" class="external-link" target="_blank">⬜</a>.

&amp; 📤 ➕ 🧰/✍ 🥉 🍵 ✍ `./scripts/docs.py`.

!!! tip
    👆 🚫 💪 👀 📟 `./scripts/docs.py`, 👆 ⚙️ ⚫️ 📋 ⏸.

🌐 🧾 ✍ 📁 📁 `./docs/en/`.

📚 🔰 ✔️ 🍫 📟.

🌅 💼, 👫 🍫 📟 ☑ 🏁 🈸 👈 💪 🏃.

👐, 👈 🍫 📟 🚫 ✍ 🔘 ✍, 👫 🐍 📁 `./docs_src/` 📁.

&amp; 👈 🐍 📁 🔌/💉 🧾 🕐❔ 🏭 🕸.

### 🩺 💯

🏆 💯 🤙 🏃 🛡 🖼 ℹ 📁 🧾.

👉 ℹ ⚒ 💭 👈:

* 🧾 🆙 📅.
* 🧾 🖼 💪 🏃.
* 🌅 ⚒ 📔 🧾, 🚚 💯 💰.

⏮️ 🇧🇿 🛠️, 📤 ✍ 👈 🏗 🕸 &amp; ✅ 🙆 🔀, 🖖-🔫:

<div class="termy">

```console
$ python ./scripts/docs.py live

<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
```

</div>

⚫️ 🔜 🍦 🧾 🔛 `http://127.0.0.1:8008`.

👈 🌌, 👆 💪 ✍ 🧾/ℹ 📁 &amp; 👀 🔀 🖖.

#### 🏎 ✳ (📦)

👩‍🌾 📥 🎦 👆 ❔ ⚙️ ✍ `./scripts/docs.py` ⏮️ `python` 📋 🔗.

✋️ 👆 💪 ⚙️ <a href="https://typer.tiangolo.com/typer-cli/" class="external-link" target="_blank">🏎 ✳</a>, &amp; 👆 🔜 🤚 ✍ 👆 📶 📋 ⏮️ ❎ 🛠️.

🚥 👆 ❎ 🏎 ✳, 👆 💪 ❎ 🛠️ ⏮️:

<div class="termy">

```console
$ typer --install-completion

zsh completion installed in /home/user/.bashrc.
Completion will take effect once you restart the terminal.
```

</div>

### 📱 &amp; 🩺 🎏 🕰

🚥 👆 🏃 🖼 ⏮️, ✅:

<div class="termy">

```console
$ uvicorn tutorial001:app --reload

<span style="color: green;">INFO</span>:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```

</div>

Uvicorn 🔢 🔜 ⚙️ ⛴ `8000`, 🧾 🔛 ⛴ `8008` 🏆 🚫 ⚔.

### ✍

ℹ ⏮️ ✍ 📶 🌅 👍 ❗ &amp; ⚫️ 💪 🚫 🔨 🍵 ℹ ⚪️➡️ 👪. 👶 👶

📥 📶 ℹ ⏮️ ✍.

#### 💁‍♂ &amp; 📄

* ✅ ⏳ <a href="https://github.com/tiangolo/fastapi/pulls" class="external-link" target="_blank">♻ 🚲 📨</a> 👆 🇪🇸 &amp; 🚮 📄 ✔ 🔀 ⚖️ ✔ 👫.

!!! tip
    👆 💪 <a href="https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request" class="external-link" target="_blank">🚮 🏤 ⏮️ 🔀 🔑</a> ♻ 🚲 📨.

    ✅ 🩺 🔃 <a href="https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-reviews" class="external-link" target="_blank">❎ 🚲 📨 📄</a> ✔ ⚫️ ⚖️ 📨 🔀.

* ✅ <a href="https://github.com/tiangolo/fastapi/issues" class="external-link" target="_blank">❔</a> 👀 🚥 📤 1️⃣ 🛠️ ✍ 👆 🇪🇸.

* 🚮 👁 🚲 📨 📍 📃 💬. 👈 🔜 ⚒ ⚫️ 🌅 ⏩ 🎏 📄 ⚫️.

🇪🇸 👤 🚫 💬, 👤 🔜 ⌛ 📚 🎏 📄 ✍ ⏭ 🔗.

* 👆 💪 ✅ 🚥 📤 ✍ 👆 🇪🇸 &amp; 🚮 📄 👫, 👈 🔜 ℹ 👤 💭 👈 ✍ ☑ &amp; 👤 💪 🔗 ⚫️.

* ⚙️ 🎏 🐍 🖼 &amp; 🕴 💬 ✍ 🩺. 👆 🚫 ✔️ 🔀 🕳 👉 👷.

* ⚙️ 🎏 🖼, 📁 📛, &amp; 🔗. 👆 🚫 ✔️ 🔀 🕳 ⚫️ 👷.

* ✅ 2️⃣-🔤 📟 🇪🇸 👆 💚 💬 👆 💪 ⚙️ 🏓 <a href="https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes" class="external-link" target="_blank">📇 💾 6️⃣3️⃣9️⃣-1️⃣ 📟</a>.

#### ♻ 🇪🇸

➡️ 💬 👆 💚 💬 📃 🇪🇸 👈 ⏪ ✔️ ✍ 📃, 💖 🇪🇸.

💼 🇪🇸, 2️⃣-🔤 📟 `es`. , 📁 🇪🇸 ✍ 🔎 `docs/es/`.

!!! tip
    👑 ("🛂") 🇪🇸 🇪🇸, 🔎 `docs/en/`.

🔜 🏃 🖖 💽 🩺 🇪🇸:

<div class="termy">

```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
```

</div>

🔜 👆 💪 🚶 <a href="http://127.0.0.1:8008" class="external-link" target="_blank">http://127.0.0.1:8008</a> &amp; 👀 👆 🔀 🖖.

🚥 👆 👀 FastAPI 🩺 🕸, 👆 🔜 👀 👈 🔠 🇪🇸 ✔️ 🌐 📃. ✋️ 📃 🚫 💬 &amp; ✔️ 📨 🔃 ❌ ✍.

✋️ 🕐❔ 👆 🏃 ⚫️ 🌐 💖 👉, 👆 🔜 🕴 👀 📃 👈 ⏪ 💬.

🔜 ➡️ 💬 👈 👆 💚 🚮 ✍ 📄 [⚒](features.md){.internal-link target=_blank}.

* 📁 📁:

```
docs/en/docs/features.md
```

* 📋 ⚫️ ⚫️❔ 🎏 🗺 ✋️ 🇪🇸 👆 💚 💬, ✅:

```
docs/es/docs/features.md
```

!!! tip
    👀 👈 🕴 🔀 ➡ &amp; 📁 📛 🇪🇸 📟, ⚪️➡️ `en` `es`.

* 🔜 📂 ⬜ 📁 📁 🇪🇸:

```
docs/en/mkdocs.yml
```

* 🔎 🥉 🌐❔ 👈 `docs/features.md` 🔎 📁 📁. 👱 💖:

```YAML hl_lines="8"
site_name: FastAPI
# More stuff
nav:
- FastAPI: index.md
- Languages:
  - en: /
  - es: /es/
- features.md
```

* 📂 ⬜ 📁 📁 🇪🇸 👆 ✍, ✅:

```
docs/es/mkdocs.yml
```

* 🚮 ⚫️ 📤 ☑ 🎏 🗺 ⚫️ 🇪🇸, ✅:

```YAML hl_lines="8"
site_name: FastAPI
# More stuff
nav:
- FastAPI: index.md
- Languages:
  - en: /
  - es: /es/
- features.md
```

⚒ 💭 👈 🚥 📤 🎏 ⛔, 🆕 ⛔ ⏮️ 👆 ✍ ⚫️❔ 🎏 ✔ 🇪🇸 ⏬.

🚥 👆 🚶 👆 🖥 👆 🔜 👀 👈 🔜 🩺 🎦 👆 🆕 📄. 👶

🔜 👆 💪 💬 ⚫️ 🌐 &amp; 👀 ❔ ⚫️ 👀 👆 🖊 📁.

#### 🆕 🇪🇸

➡️ 💬 👈 👆 💚 🚮 ✍ 🇪🇸 👈 🚫 💬, 🚫 📃.

➡️ 💬 👆 💚 🚮 ✍ 🇭🇹, &amp; ⚫️ 🚫 📤 🩺.

✅ 🔗 ⚪️➡️ 🔛, 📟 "🇭🇹" `ht`.

⏭ 🔁 🏃 ✍ 🏗 🆕 ✍ 📁:

<div class="termy">

```console
// Use the command new-lang, pass the language code as a CLI argument
$ python ./scripts/docs.py new-lang ht

Successfully initialized: docs/ht
Updating ht
Updating en
```

</div>

🔜 👆 💪 ✅ 👆 📟 👨‍🎨 ⏳ ✍ 📁 `docs/ht/`.

!!! tip
    ✍ 🥇 🚲 📨 ⏮️ 👉, ⚒ 🆙 📳 🆕 🇪🇸, ⏭ ❎ ✍.

    👈 🌌 🎏 💪 ℹ ⏮️ 🎏 📃 ⏪ 👆 👷 🔛 🥇 🕐. 👶

▶️ ✍ 👑 📃, `docs/ht/index.md`.

⤴️ 👆 💪 😣 ⏮️ ⏮️ 👩‍🌾, "♻ 🇪🇸".

##### 🆕 🇪🇸 🚫 🐕‍🦺

🚥 🕐❔ 🏃‍♂ 🖖 💽 ✍ 👆 🤚 ❌ 🔃 🇪🇸 🚫 ➖ 🐕‍🦺, 🕳 💖:

```
 raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: partials/language/xx.html
```

👈 ⛓ 👈 🎢 🚫 🐕‍🦺 👈 🇪🇸 (👉 💼, ⏮️ ❌ 2️⃣-🔤 📟 `xx`).

✋️ 🚫 😟, 👆 💪 ⚒ 🎢 🇪🇸 🇪🇸 &amp; ⤴️ 💬 🎚 🩺.

🚥 👆 💪 👈, ✍ `mkdocs.yml` 👆 🆕 🇪🇸, ⚫️ 🔜 ✔️ 🕳 💖:

```YAML hl_lines="5"
site_name: FastAPI
# More stuff
theme:
  # More stuff
  language: xx
```

🔀 👈 🇪🇸 ⚪️➡️ `xx` (⚪️➡️ 👆 🇪🇸 📟) `en`.

⤴️ 👆 💪 ▶️ 🖖 💽 🔄.

#### 🎮 🏁

🕐❔ 👆 ⚙️ ✍ `./scripts/docs.py` ⏮️ `live` 📋 ⚫️ 🕴 🎦 📁 &amp; ✍ 💪 ⏮️ 🇪🇸.

✋️ 🕐 👆 🔨, 👆 💪 💯 ⚫️ 🌐 ⚫️ 🔜 👀 💳.

👈, 🥇 🏗 🌐 🩺:

<div class="termy">

```console
// Use the command "build-all", this will take a bit
$ python ./scripts/docs.py build-all

Updating es
Updating en
Building docs for: en
Building docs for: es
Successfully built docs for: es
Copying en index.md to README.md
```

</div>

👈 🏗 🌐 🩺 `./docs_build/` 🔠 🇪🇸. 👉 🔌 ❎ 🙆 📁 ⏮️ ❌ ✍, ⏮️ 🗒 💬 👈 "👉 📁 🚫 ✔️ ✍". ✋️ 👆 🚫 ✔️ 🕳 ⏮️ 👈 📁.

⤴️ ⚫️ 🏗 🌐 👈 🔬 ⬜ 🕸 🔠 🇪🇸, 🌀 👫, &amp; 🏗 🏁 🔢 `./site/`.

⤴️ 👆 💪 🍦 👈 ⏮️ 📋 `serve`:

<div class="termy">

```console
// Use the command "serve" after running "build-all"
$ python ./scripts/docs.py serve

Warning: this is a very simple server. For development, use mkdocs serve instead.
This is here only to preview a site with translations already built.
Make sure you run the build-all command first.
Serving at: http://127.0.0.1:8008
```

</div>

## 💯

📤 ✍ 👈 👆 💪 🏃 🌐 💯 🌐 📟 &amp; 🏗 💰 📄 🕸:

<div class="termy">

```console
$ bash scripts/test-cov-html.sh
```

</div>

👉 📋 🏗 📁 `./htmlcov/`, 🚥 👆 📂 📁 `./htmlcov/index.html` 👆 🖥, 👆 💪 🔬 🖥 🇹🇼 📟 👈 📔 💯, &amp; 👀 🚥 📤 🙆 🇹🇼 ❌.
