Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| import os | |
| import sys | |
| src_directory = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..","backend")) | |
| sys.path.append(src_directory) | |
| from modules import home_page | |
| app = FastAPI() | |
| df = home_page.process_data() | |
| def home(): | |
| return home_page.home() | |
| def display_continents(): | |
| continent = home_page.continent(df) | |
| return {"continents":continent} | |
| def display_country(): | |
| country=home_page.country(df) | |
| return{"country":country} | |
| def max_population(continent_name:str): | |
| max_population=home_page.max_population(df,continent_name) | |
| return {"max_population":max_population} | |
| def min_population(continent_name:str): | |
| min_population=home_page.min_population(df,continent_name) | |
| return {"min_population":min_population} |