Created
January 6, 2020 01:33
-
-
Save Tehsurfer/ff1f270d108eac9a55c7eb85d42d1add to your computer and use it in GitHub Desktop.
This document is to define the inputs and formatting outputs of the soon to be developed tabtouch scraper
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
# This document is to define the inputs and formatting outputs of the soon to be developed tabtouch scraper | |
# Inputs: | |
# date: string in form yyyy-mm-dd e.g. '2019-12-31' | |
# event: sting of even name e.g. 'Albury' | |
# race: int of race number e.g. 1 | |
# Outputs: | |
# odds: Either a python dictionary, json file, or json formatted string as defined below | |
def tabtouch(date, event, race): | |
# Scrapes tabtouch for the given date, event and race | |
# ... (Scrape tabtouch.com.au) ... | |
# Data returned in the json format below: | |
odds = { | |
'date': date, | |
'event': event, | |
'race_number': race, | |
'odds': { | |
'<Horse Name 1>': { | |
'<Bookie 1>': 8.55, | |
'<Bookie 2>': 8.25, | |
'<Bookie 3>': 8.45, | |
}, | |
'<Horse Name 2>': { | |
'<Bookie 1>': 4.15, | |
'<Bookie 2>': 3.95, | |
'<Bookie 3>': 4.35, | |
} | |
# ... | |
# Ctd. for all horses and bookies | |
} | |
} | |
return odds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment