➕ 💽 🆎¶
🆙 🔜, 👆 ✔️ ⚙️ ⚠ 📊 🆎, 💖:
int
float
str
bool
✋️ 👆 💪 ⚙️ 🌅 🏗 📊 🆎.
& 👆 🔜 ✔️ 🎏 ⚒ 👀 🆙 🔜:
- 👑 👨🎨 🐕🦺.
- 💽 🛠️ ⚪️➡️ 📨 📨.
- 💽 🛠️ 📨 💽.
- 💽 🔬.
- 🏧 ✍ & 🧾.
🎏 💽 🆎¶
📥 🌖 📊 🆎 👆 💪 ⚙️:
UUID
:- 🐩 "⭐ 😍 🆔", ⚠ 🆔 📚 💽 & ⚙️.
- 📨 & 📨 🔜 🎨
str
.
datetime.datetime
:- 🐍
datetime.datetime
. - 📨 & 📨 🔜 🎨
str
💾 8️⃣6️⃣0️⃣1️⃣ 📁, 💖:2008-09-15T15:53:00+05:00
.
- 🐍
datetime.date
:- 🐍
datetime.date
. - 📨 & 📨 🔜 🎨
str
💾 8️⃣6️⃣0️⃣1️⃣ 📁, 💖:2008-09-15
.
- 🐍
datetime.time
:- 🐍
datetime.time
. - 📨 & 📨 🔜 🎨
str
💾 8️⃣6️⃣0️⃣1️⃣ 📁, 💖:14:23:55.003
.
- 🐍
datetime.timedelta
:- 🐍
datetime.timedelta
. - 📨 & 📨 🔜 🎨
float
🌐 🥈. - Pydantic ✔ 🎦 ⚫️ "💾 8️⃣6️⃣0️⃣1️⃣ 🕰 ➕ 🔢", 👀 🩺 🌅 ℹ.
- 🐍
frozenset
:- 📨 & 📨, 😥 🎏
set
:- 📨, 📇 🔜 ✍, ❎ ❎ & 🏭 ⚫️
set
. - 📨,
set
🔜 🗜list
. - 🏗 🔗 🔜 ✔ 👈
set
💲 😍 (⚙️ 🎻 🔗uniqueItems
).
- 📨, 📇 🔜 ✍, ❎ ❎ & 🏭 ⚫️
- 📨 & 📨, 😥 🎏
bytes
:- 🐩 🐍
bytes
. - 📨 & 📨 🔜 😥
str
. - 🏗 🔗 🔜 ✔ 👈 ⚫️
str
⏮️binary
"📁".
- 🐩 🐍
Decimal
:- 🐩 🐍
Decimal
. - 📨 & 📨, 🍵 🎏
float
.
- 🐩 🐍
- 👆 💪 ✅ 🌐 ☑ Pydantic 📊 🆎 📥: Pydantic 📊 🆎.
🖼¶
📥 🖼 ➡ 🛠️ ⏮️ 🔢 ⚙️ 🔛 🆎.
from datetime import datetime, time, timedelta
from typing import Union
from uuid import UUID
from fastapi import Body, FastAPI
app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
start_datetime: Union[datetime, None] = Body(default=None),
end_datetime: Union[datetime, None] = Body(default=None),
repeat_at: Union[time, None] = Body(default=None),
process_after: Union[timedelta, None] = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
return {
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
"repeat_at": repeat_at,
"process_after": process_after,
"start_process": start_process,
"duration": duration,
}
from datetime import datetime, time, timedelta
from uuid import UUID
from fastapi import Body, FastAPI
app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
start_datetime: datetime | None = Body(default=None),
end_datetime: datetime | None = Body(default=None),
repeat_at: time | None = Body(default=None),
process_after: timedelta | None = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
return {
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
"repeat_at": repeat_at,
"process_after": process_after,
"start_process": start_process,
"duration": duration,
}
🗒 👈 🔢 🔘 🔢 ✔️ 👫 🐠 💽 🆎, & 👆 💪, 🖼, 🎭 😐 📅 🎭, 💖:
from datetime import datetime, time, timedelta
from typing import Union
from uuid import UUID
from fastapi import Body, FastAPI
app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
start_datetime: Union[datetime, None] = Body(default=None),
end_datetime: Union[datetime, None] = Body(default=None),
repeat_at: Union[time, None] = Body(default=None),
process_after: Union[timedelta, None] = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
return {
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
"repeat_at": repeat_at,
"process_after": process_after,
"start_process": start_process,
"duration": duration,
}
from datetime import datetime, time, timedelta
from uuid import UUID
from fastapi import Body, FastAPI
app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
start_datetime: datetime | None = Body(default=None),
end_datetime: datetime | None = Body(default=None),
repeat_at: time | None = Body(default=None),
process_after: timedelta | None = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
return {
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
"repeat_at": repeat_at,
"process_after": process_after,
"start_process": start_process,
"duration": duration,
}