add get_scores_and_broadcast to in play service - #622
Open
niallsemple wants to merge 1 commit into
Open
Conversation
Adds support for the scoresAndBroadcast endpoint which returns broadcast (tv/radio/bfLiveVideo) and matchInfo data alongside scores, as requested in betcode-org#569. - InPlayService.get_scores_and_broadcast() following the existing get_scores() pattern - Broadcasts, RadioBroadcast, LiveVideoBroadcast and MatchInfo resources, exposed as optional Scores.broadcasts / Scores.match_info - Tests and mock data covering both presence and absence of the new fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #569
Adds support for the in play service
scoresAndBroadcastendpoint, which returns everythingscoresdoes plusbroadcasts(tv / radio / bfLiveVideo availability and channels) andmatchInfo(e.g. surface, numberOfSets) per event.Changes
InPlayService.get_scores_and_broadcast(event_ids)— follows the exact pattern of the existingget_scores()/get_event_timelines()methods (same params,lightweightsupport, returns a list ofresources.Scores)inplayserviceresources.py:Broadcasts,RadioBroadcast,LiveVideoBroadcastandMatchInfo, exposed as optionalScores.broadcasts/Scores.match_infoattributes (both default toNone, so existingget_scores()responses are unaffected — covered by test)LiveVideoBroadcaststart/end times are parsed to tz-aware datetimes viaBaseResource.strip_datetime, consistent with the rest of the librarydocs/endpoints.mdVerification
python -m unittest discover), including new tests for the endpoint call (URL/params), resource parsing with broadcast/matchInfo data (mock JSON modelled on the payload shown in the issue), and the no-broadcast caseblack --checkclean with the pinned version (25.9.0)GET https://ips.betfair.com/inplayservice/v1.1/scoresAndBroadcast?eventIds=1&alt=jsonreturns a valid JSON list