Created
October 29, 2016 19:46
-
-
Save benrules2/34ed8c83028806ce3560e80f6f694fe6 to your computer and use it in GitHub Desktop.
This file contains 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
def find_bet(all_odds): | |
bet_info = {} | |
favourable_odds = 1.91 | |
bet_info['sportId'] = all_odds['sportId'] | |
for i in all_odds['leagues']: | |
bet_info['leagueId'] = i['id'] | |
for j in i['events']: | |
bet_info['eventId'] = j['id'] | |
for k in j['periods']: | |
bet_info['period'] = k['number'] | |
for l in k['moneyline'].keys(): | |
odds = float(k['moneyline'][l]) | |
if odds < favourable_odds and l == 'home': | |
bet_info['team'] = l | |
bet_info['lineId'] = k['lineId'] | |
return bet_info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment