- from fastapi import FastAPI
- from pydantic import BaseModel
- class Person(BaseModel):
- name: str
- born_at: int
- based_in: str
- skills: list[str]
- socials: dict[str, str]
- ivart = Person(
- name="Artem Ivanov",
- born_at=899884800, # 🎂 July 8th
- based_in="Paris, 🇫🇷",
- skills=["Python", "PostgreSQL", "FastAPI", "Docker", "Kubernetes", "AWS"],
- socials={
- "tg": "https://ivart.t.me/",
- "gh": "https://github.com/ivanovart",
- "in": "https://www.linkedin.com/in/ivart",
- },
- )
- app = FastAPI()
- @app.get("/me")
- def get_me() -> Person:
- return ivart
- if __name__ == "__main__":
- import uvicorn
- uvicorn.run(app)