Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/routes/geo/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,20 @@ async def get_country_subdivisions(data: CountryCodeModel = Depends()):
return ok_200(res)
except Exception as e:
raise internal_error_500()


@country_router.get("/population_density")
async def get_country_population_density(data: CountryCodeModel = Depends()):
try:
res = co.code_to_population_density(data.code)
return ok_200(res)
except Exception as e:
raise internal_error_500()

@country_router.get("/gender_ratio")
async def get_country_gender_ratio(data: CountryCodeModel = Depends()):
try:
res = co.code_to_gender_ratio(data.code)
return ok_200(res)
except Exception as e:
raise internal_error_500()