29 lines
458 B
Python
29 lines
458 B
Python
from pydantic import BaseModel
|
|
from typing import List
|
|
|
|
|
|
class PeopleCreate(BaseModel):
|
|
name: str
|
|
age: int
|
|
gender: str
|
|
country: str
|
|
|
|
|
|
class PeopleList(BaseModel):
|
|
people: List[PeopleCreate]
|
|
|
|
|
|
class AverageAgeByCountry(BaseModel):
|
|
country: str
|
|
average_age: float
|
|
|
|
|
|
class CountByCountry(BaseModel):
|
|
country: str
|
|
people_count: int
|
|
|
|
|
|
class GenderRepartition(BaseModel):
|
|
female_proportion: float
|
|
male_proportion: float
|