Skip to content

Instantly share code, notes, and snippets.

@benrules2
Created October 29, 2016 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benrules2/34ed8c83028806ce3560e80f6f694fe6 to your computer and use it in GitHub Desktop.
Save benrules2/34ed8c83028806ce3560e80f6f694fe6 to your computer and use it in GitHub Desktop.
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