You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8.2 KiB

FastAPI ⚒

FastAPI 🤝 👆 📄:

🔛 📂 🐩

  • 🗄 🛠️ 🏗, 📄 🛠️, 🔢, 💪 📨, 💂‍♂, ️.
  • 🏧 📊 🏷 🧾 ⏮️ 🎻 🔗 (🗄 🧢 🔛 🎻 🔗).
  • 🔧 🤭 👫 🐩, ⏮️ 😔 🔬. ↩️ 👎 🧽 🔛 🔝.
  • 👉⚙️ 🏧 👩‍💻 📟 📚 🇪🇸.

🏧 🩺

🎓 🛠️ 🧾 & 🔬 🕸 👩‍💻 🔢. 🛠️ 🔛 🗄, 📤 💗 🎛, 2️⃣ 🔌 🔢.

  • 🦁 🎚, ⏮️ 🎓 🔬, 🤙 & 💯 👆 🛠️ 🔗 ➡️ 🖥.

Swagger UI interaction

  • 🎛 🛠️ 🧾 ⏮️ 📄.

ReDoc

🏛 🐍

🌐 🔛 🐩 🐍 3️⃣.6️⃣ 🆎 📄 (👏 Pydantic). 🙅‍♂ 🆕 💡. 🐩 🏛 🐍.

🚥 👆 💪 2️⃣↗️ ⚙️ 🐍 🆎 (🚥 👆 🚫 ⚙️ FastAPI), 📏 🔰: 🐍 🆎{.internal-link target=_blank}.

👆🐩 🐍 ⏮️ 🆎:

from datetime import date

from pydantic import BaseModel

# Declare a variable as a str
# and get editor support inside the function
def main(user_id: str):
    return user_id


# A Pydantic model
class User(BaseModel):
    id: int
    name: str
    joined: date

👈 💪 ⤴️ ⚙️ 💖:

my_user: User = User(id=3, name="John Doe", joined="2018-07-19")

second_user_data = {
    "id": 4,
    "name": "Mary",
    "joined": "2018-11-30",
}

my_second_user: User = User(**second_user_data)

!!! info **second_user_data ⛓:

🚶‍♀️ 🔑 & 💲 `second_user_data` #️⃣ 🔗 🔑-💲 ❌, 🌓: `User(id=4, name="Mary", joined="2018-11-30")`

👨‍🎨 🐕‍🦺

🌐 🛠️ 🏗 & 🏋️ ⚙️, 🌐 🚫 💯 🔛 💗 👨‍🎨▶️ 🛠️, 🚚 🏆 🛠️ 💡.

🏁 🐍 👩‍💻 🔬 🆑 👈 🌅 ⚙️ ⚒ "✍".

🎂 FastAPI 🛠️ 😌 👈. ✍ 👷 🌐.

👆 🔜 🛎 💪 👟 🔙 🩺.

📥 👆 👨‍🎨 💪👆:

editor support

editor support

👆 🔜 🤚 🛠️ 📟 👆 5️⃣📆 🤔 💪 ⏭. 🖼, price 🔑 🔘 🎻 💪 (👈 💪 ✔️ 🐦) 👈 👟 ➡️ 📨.

🙅‍♂ 🌖 🔑 📛, 👟 🔙 & ➡ 🖖 🩺, ⚖️ 📜 🆙 & 🔽 🔎 🚥 👆 😒 ⚙️ username ⚖️ user_name.

📏

✔️ 🤔 🔢 🌐, ⏮️ 📦 📳 🌐. 🌐 🔢 💪 👌-🎧 👆 💪 & 🔬 🛠️ 👆 💪.

🔢, 🌐 "👷".

🔬

  • 🔬 🌅 (⚖️ 🌐 ) 🐍 💽 🆎, 🔌:

    • 🎻 🎚 (dict).
    • 🎻 🎻 (list) ⚖ 🏬 🆎.
    • 🎻 (str) 🏑, 🔬 🕙 & 👟 📐.
    • 🔢 (int, float) ⏮️ 🕙 & 👟 💲, ️.
  • 🔬 🌅 😍 🆎, 💖:

    • 📛.
    • 📧.
    • 🆔.
    • ...& 🎏.

🌐 🔬 🍵 👍-🏛 & 🏋️ Pydantic.

💂‍♂ & 🤝

💂‍♂ & 🤝 🛠️. 🍵 🙆⏮️ 💽 ⚖️ 📊 🏷.

🌐 💂‍♂ ⚖ 🔬 🗄, 🔌:

  • 🇺🇸🔍 🔰.
  • Oauth2️⃣ (⏮️ 🥙 🤝). 🔰 🔛 Oauth2️⃣ ⏮️ 🥙{.internal-link target=_blank}.
  • 🛠️ 🔑:
    • 🎚.
    • 🔢 🔢.
    • 🍪, ️.

🌐 💂‍♂ ⚒ ➡️ 💃 (🔌 🎉 🍪).

🌐 🏗 ♻ 🧰 & 🦲 👈 🛠️ ⏮️ 👆 ⚙️, 📊 🏪, 🔗 & ☁ 💽, ️.

🔗 💉

FastAPI 🔌 📶 ⚙️, 📶 🏋️ 🔗 💉 ⚙️.

  • 🔗 💪 ✔️ 🔗, 🏗 🔗 ⚖️ "📊" 🔗.
  • 🌐 🔁 🍵 🛠️.
  • 🌐 🔗 💪 🚚 💽 ➡️ 📨 & ↔ ➡ 🛠️ ⚛ & 🏧 🧾.
  • 🏧 🔬 🛠️ 🔢 🔬 🔗.
  • 🐕‍🦺 🏗 👩‍💻 🤝 ⚙️, 💽 🔗, ️.
  • 🙅‍♂ ⚠ ⏮️ 💽, 🕸, ️. 🛠️ ⏮️ 🌐 👫.

♾ "🔌-🔌"

⚖️ 🎏 🌌, 🙅‍♂ 💪 👫, 🗄 & ⚙️ 📟 👆 💪.

🙆 🛠️ 🏗 🙅 ⚙️ (⏮️ 🔗) 👈 👆 💪 ✍ "🔌-" 👆 🈸 2️⃣📟 ⚙️ 🎏 📊 & ⚙️ 👆 🛠️.

💯

  • 1️⃣0️⃣0️⃣ 💯 💯 💰.
  • 1️⃣0️⃣0️⃣ 💯 🆎 📟 🧢.
  • ⚙️ 🏭 🈸.

💃

FastAPI 🍕 🔗 ⏮️ (& 🔛) 💃. , 🙆 🌖 💃 📟 👆 ✔️, 🔜 👷.

FastAPI 🤙 🎧-🎓 Starlette. , 🚥 👆 💭 ⚖️ ⚙️ 💃, 🌅 🛠️ 🔜 👷 🎏 🌌.

⏮️ FastAPI 👆 🤚 🌐 💃'Ⓜ ⚒ (FastAPI 💃 🔛 💊):

  • 🤙 🎆 🎭. 1️⃣ ⏩ 🐍 🛠️ 💪, 🔛 🇷🇪 ⏮️ & 🚶.
  • ** *️⃣ ** 🐕‍🦺.
  • -🛠️ 🖥 📋.
  • 🕴 & 🤫 🎉.
  • 💯 👩‍💻 🏗 🔛 🇸🇲.
  • , 🗜, 🎻 📁, 🎏 📨.
  • 🎉 & 🍪 🐕‍🦺.
  • 1️⃣0️⃣0️⃣ 💯 💯 💰.
  • 1️⃣0️⃣0️⃣ 💯 🆎 ✍ ✍.

Pydantic ⚒

FastAPI 🍕 🔗 ⏮️ (& 🔛) Pydantic. , 🙆 🌖 Pydantic 📟 👆 ✔️, 🔜 👷.

🔢 🗃 🔛 Pydantic, 🐜Ⓜ, 🏭💽.

👉👈 📚 💼 👆 💪 🚶‍♀️ 🎏 🎚 👆 🤚 ➡️ 📨 🔗 💽, 🌐🔁.

🎏🎏 🌌 🤭, 📚 💼 👆 💪 🚶‍♀️ 🎚 👆 🤚 ➡️ 💽 🔗 👩‍💻.

⏮️ FastAPI 👆 🤚 🌐 Pydantic'Ⓜ ⚒ (FastAPI 🔛 Pydantic 🌐 💽 🚚):

  • 🙅‍♂ 🔠:
    • 🙅‍♂ 🆕 🔗 🔑 -🇪🇸 💡.
    • 🚥 👆 💭 🐍 🆎 👆 💭 ⚙️ Pydantic.
  • 🤾 🎆 ⏮️ 👆 💾/🧶/🧠:
    • ↩️ Pydantic 📊 📊 👐 🎓 👆 🔬; 🚘-🛠️, 🧽, ✍ & 👆 🤔 🔜 🌐 👷⏮️ 👆💽.
  • :
    • 📇 Pydantic 🌘 🌐 🎏 💯 🗃.
  • 🏗 📊:
    • ⚙️ 🔗 Pydantic 🏷, 🐍 typing'Ⓜ List & Dict, ️.
    • & 💳 ✔ 🏗 💽 🔗 🎯 & 💪 🔬, & 📄 🎻 🔗.
    • 👆 💪 ✔️ 🙇 🐦 🎻 🎚 & ✔️ 👫 🌐 ✔ & ✍.
  • 🏧:
    • Pydantic ✔ 🛃 📊 🆎 🔬 ⚖️ 👆 💪🔬 ⏮️ 👩‍🔬 🔛 🏷 🎀 ⏮️ 💳 👨‍🎨.
  • 1️⃣0️⃣0️⃣ 💯 💯 💰.