-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
34 lines (25 loc) · 931 Bytes
/
app.py
File metadata and controls
34 lines (25 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from constants import PLAYERS
from constants import TEAMS
from data_cleaner import clean_data
from team_balancer import balance_teams
from greeter import greet
import copy
def main():
"""
Create Person
This path creates a person in the app and save the information in the database
Parameters:
-Requests body Parameter:
-**person:Person**-> A person model with 1st name, lastname, age, hair color and marital status.
Returns a person model with 1stname, last lanem , age, hair color and marital status
"""
#read data for both teams and players
player_list = copy.deepcopy(PLAYERS)
teams = copy.deepcopy(TEAMS)
#clean
cleaned_players = clean_data(player_list)
team_length = len(cleaned_players)//len(teams)
balanced_teams = balance_teams(teams, cleaned_players, team_length)
team=greet(balanced_teams,teams)
if __name__ == '__main__':
main()