since it appears that dogs generally have been assigned multiple Selection ID numbers (and a new # can be introduced at any time), the only way to definitively know that a dog you are monitoring is who you think it is, would be by name (just using the Track Name, Race #, and Trap # would not be foolproof in the case where a dog scratched and a reserve dog was put in its place - this may have to be my fallback method if the dog name cannot be easily obtained). I recall reading a similar post about finding the horse names for a race, and it seemed rather complicated. Where in the process are the names of the dogs, they are not in the runner book apparently. Any info that can point me in the right direction would be appreciated.
______________
have made some progress, I can now print a market catalog which apparently contains or is of type Runner Catalog. I return 20 results, the 1st of which is:
0 [RunnerCatalogue: 23746584, RunnerCatalogue: 2....
so the final remaining issue is to retrieve the name from this 'Runner Catalog'. Another post (for a similar question regarding horse names), goes on to say:
"The returned MarketCatalogue object will then contain a runners field. This is of type RunnerCatalog which contains the name of the runner (in the runnerName field)".
All attempts to now use runnerName or runner_name, result in an error, so I'm stuck, although very close I believe.
__________________
i finally got it after a lot of trial and error. Seems like the key point is in bold. The resulting market_catalogues
can then be inspected one-by-one to get the current selection id # for the dog, and the name.
# MARKET CATALOG dog names
market_catalogue_filter = betfairlightweight.filters.market_filter(
event_type_ids=[greyhound_racing_event_type_id],
market_countries=['GB'])
market_catalogues = trading.betting.list_market_catalogue(
filter=market_catalogue_filter,
market_projection=['RUNNER_DESCRIPTION'],
max_results='20')
# Create a DataFrame for each market catalogue
market_catalogues = pd.DataFrame({
'Runners' : [market_cat_object.runners for market_cat_object in market_catalogues]})
print market_catalogues
description = market_catalogues['Runners'][2] # ie. gives the 3rd row of dogs or exacta bet combinations
print description[0] # 1st dog id # or exacta bet combo (like 1-2)
print description[0].runner_name # 1st dog name
______________
have made some progress, I can now print a market catalog which apparently contains or is of type Runner Catalog. I return 20 results, the 1st of which is:
0 [RunnerCatalogue: 23746584, RunnerCatalogue: 2....
so the final remaining issue is to retrieve the name from this 'Runner Catalog'. Another post (for a similar question regarding horse names), goes on to say:
"The returned MarketCatalogue object will then contain a runners field. This is of type RunnerCatalog which contains the name of the runner (in the runnerName field)".
All attempts to now use runnerName or runner_name, result in an error, so I'm stuck, although very close I believe.
__________________
i finally got it after a lot of trial and error. Seems like the key point is in bold. The resulting market_catalogues
can then be inspected one-by-one to get the current selection id # for the dog, and the name.
# MARKET CATALOG dog names
market_catalogue_filter = betfairlightweight.filters.market_filter(
event_type_ids=[greyhound_racing_event_type_id],
market_countries=['GB'])
market_catalogues = trading.betting.list_market_catalogue(
filter=market_catalogue_filter,
market_projection=['RUNNER_DESCRIPTION'],
max_results='20')
# Create a DataFrame for each market catalogue
market_catalogues = pd.DataFrame({
'Runners' : [market_cat_object.runners for market_cat_object in market_catalogues]})
print market_catalogues
description = market_catalogues['Runners'][2] # ie. gives the 3rd row of dogs or exacta bet combinations
print description[0] # 1st dog id # or exacta bet combo (like 1-2)
print description[0].runner_name # 1st dog name


Comment