Skip to content

Commit

Permalink
Add get_winners_from_market_definition function
Browse files Browse the repository at this point in the history
  • Loading branch information
mberk committed Dec 18, 2022
1 parent 0fd8eef commit a961b8d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions betfairutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,15 @@ def get_selection_id_to_runner_name_map_from_market_catalogue(
return selection_id_to_runner_name_map


def get_winners_from_market_definition(market_defnition: Dict[str, Any]) -> List[int]:
selection_ids = [
runner["id"]
for runner in market_defnition["runners"]
if runner["status"] == "WINNER"
]
return selection_ids


def get_final_market_definition_from_prices_file(
path_to_prices_file: Union[str, Path]
) -> Optional[Dict[str, Any]]:
Expand Down

0 comments on commit a961b8d

Please sign in to comment.