Spaces:
Runtime error
Runtime error
Alejadro Sanchez-Giraldo
commited on
Commit
·
2ffcbc1
1
Parent(s):
23152a0
added more relevant data
Browse files- fpl_client.py +6 -2
fpl_client.py
CHANGED
@@ -63,13 +63,17 @@ class FPLClient:
|
|
63 |
logging.info(f"Player position ID: {player['element_type']}")
|
64 |
player_pos = self.player_position(player['element_type'])
|
65 |
team_name = self.get_team_info(player['team'])['name']
|
|
|
|
|
|
|
66 |
stats = {
|
67 |
"Name": player['web_name'],
|
68 |
"Team": team_name,
|
69 |
-
"
|
70 |
"Price": player['now_cost'] / 10,
|
71 |
"Position": player_pos,
|
72 |
-
"
|
|
|
73 |
}
|
74 |
logging.debug(f"Stats for player {player_name}: {stats}")
|
75 |
return stats
|
|
|
63 |
logging.info(f"Player position ID: {player['element_type']}")
|
64 |
player_pos = self.player_position(player['element_type'])
|
65 |
team_name = self.get_team_info(player['team'])['name']
|
66 |
+
news = player['news']
|
67 |
+
if not news:
|
68 |
+
news = "No news available"
|
69 |
stats = {
|
70 |
"Name": player['web_name'],
|
71 |
"Team": team_name,
|
72 |
+
"Points per game avarage": player['points_per_game'],
|
73 |
"Price": player['now_cost'] / 10,
|
74 |
"Position": player_pos,
|
75 |
+
"News": news,
|
76 |
+
"Selected By": player['selected_by_percent'] + "%",
|
77 |
}
|
78 |
logging.debug(f"Stats for player {player_name}: {stats}")
|
79 |
return stats
|