Hi,
I have a python script using betfairlightweight and i am starting to get the hang of it.
I have an issue getting the Event Name from a market book though, maybe its not possible but i thought id ask.
I am trying to do the following:
Get the market ID of all cricket events
break up the list into chunks, because it is too large to use in list market book as one request
create a collection of market books, filter by in play books
***
Issue: print the event name for each market book that is inplay
***
i cant seem to find anyway of getting back from a book, to its event and hence its event name
i could iterate through the market_id_list and call list_market_book with a list length of one, then create a dictionary with {an_event_name:[market_book_list]} - but then i am making many calls to the betfair server which will me slow.
Does anyone know of a way to get from the market book, to its corresponding event and hence event ID?
I have a python script using betfairlightweight and i am starting to get the hang of it.
I have an issue getting the Event Name from a market book though, maybe its not possible but i thought id ask.
I am trying to do the following:
Get the market ID of all cricket events
break up the list into chunks, because it is too large to use in list market book as one request
create a collection of market books, filter by in play books
***
Issue: print the event name for each market book that is inplay
***
i cant seem to find anyway of getting back from a book, to its event and hence its event name
i could iterate through the market_id_list and call list_market_book with a list length of one, then create a dictionary with {an_event_name:[market_book_list]} - but then i am making many calls to the betfair server which will me slow.
HTML Code:
chunks = [market_id_list[x:x+10] for x in range(0, len(market_id_list), 10)]
market_books = []
market_books_inplay = []
for chunk in chunks:
market_books = trading.betting.list_market_book(
market_ids=chunk
)
market_books_inplay += [x for x in market_books if x.inplay]
market_book_df = create_market_book_data_frame(market_books_inplay)


Comment