From 328a378f534051f155b3a2fdcaaa5aee5ac84669 Mon Sep 17 00:00:00 2001 From: Revanth <109272714+revanth1718@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:55:43 +0530 Subject: [PATCH] added endpoints --- src/routes/geo/country.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/routes/geo/country.py b/src/routes/geo/country.py index 065f6f2..e6b6ca3 100644 --- a/src/routes/geo/country.py +++ b/src/routes/geo/country.py @@ -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() \ No newline at end of file