This library intends to provide simplicity when accessing and parsing data from Power of 10, a UK-based site that provides a comprehensive collection of athete performances and rankings.
Install the package via pip:
pip install power-of-10==0.0.1
Or install the package by:
pip install setup.py
Install dependencies:
pip install -r requirements.txt
The package has a variety of functions.
search_athletes(firstname=None, surname=None, club=None)
Returns a list of athletes given search criteria.
Parameters:
firstname
(str): Optional first name agrumentsurname
(str): Optional surname argumentclub
(str): Optional club agrument
Returns:
list_of_athletes
(arr): List of athlete data in dictfirstname
(str): First name of athletesurname
(str): Surname of athletetrack
(str): Age group for athlete on trackroad
(str): Age group for athlete on roadsex
(str): Gender of athleteclub
(str): Athletics club of altheteathlete_id
(int): Reference id of athlete (used by PowerOf10)
get_athlete(athlete_id)
Returns a dictionary of information relating to a specific athlete or coach.
Parameters:
athlete_id
(int): reference id of athlete (used by PowerOf10)
Returns:
athletes
(dict): Dictionary of athlete dataclub
(str): Club of the athletegender
(str): Gender of athlete (M or F)age_group
(str): Age group division of athletecounty
(str): County that athlete competes forregion
(Str): Region that athlete competes fornation
(str): Nation that athlete competes forlead coach
(str): Athlete coach (usually used for notable coaches)about
(str): Description of athlete (usually used for notable athletes)pb
(arr): List of personal bestsevent
(str): Event namevalue
(float): Personal best in given eventperformances
(arr): List of athlete performancesevent
(str): Event namevalue
(float): Performance in given eventposition
(arr): 2x1 list containing [position, race identifier]venue
(str): Location of eventmeeting
(str): Meeting titledate
(str): Date of event
rankings
(arr): List of notable ranks of athletesevent
(str): Event nameage_group
(str): Age group division at time of rankyear
(int): Year that rank was achievedrank
(int): Rank of athlete
coaching
(arr): List of coaching experiencesname
(str): Nmae of athlete coachedclub
(str): Club of athlete coachedage_group
(str): Age group division of athlete coachedsex
(str): Gender of athlete coachedbest_event
(str): Best event of athlete coachedrank
(int): Rank of athlete coached for their best eventage_group_rank
(str): Age group that rank was achievedyear
(int): Year that rank was achievedperformance
(float): Performance that achieved rank
search_coaches(firstname=None, surname=None, club=None)
Returns a list of coaches with the inputted firstname, surname or club.
Parameters:
firstname
(str): Optional first name of coach argumentsurname
(str): Optiona surname of coach argumentclub
(str): Optional club of coach argument
Returns:
coaches
(arr): List of coach data in dictfirstname
(str): First name of coachsurname
(str): Surname of coachsex
(str): Gender of coachclub
(str): Club of coachathlete_id
(int): reference id of athlete (used by PowerOf10)
get_rankings()
Returns a list of ranks for given year, region, gender, age group and event.
Parameters:
year
(int): Year of event rankingsregion
(str): Region for event rankings (see below for available regions)gender
(str): Gender for event rankingsage_group
(str): Optional age group of event rankingsevent
(str): Event for rankings
Returns:
rankings
(arr): list of ranksrank
(int): Rank of athleteperformance
(float): Performance of athlete for given rankpb
(float): Personal best of athlete at time of rankname
(str): Full name of athleteyear
(int): Year that performance occurredcoach
(str): Name of coach of athleteclub
(str): Name of club of athletevenue
(str): Name of venue that performance occurreddate
(str): Date that performance occurredathlete_id
(int): Reference id of athlete (used by PowerOf10)meeting_id
(int): Reference id of event (used by PowerOf10)
Table of Parameters:
Region | Age Group |
---|---|
east | Leave blank for any |
east midlands | U20 |
england | U17 |
london | U15 |
north east | U13 |
north ireland | |
north west | |
scotland | |
south east | |
south west | |
wales | |
west midlands | |
yorkshire |
search_event(event=None, meeting=None, venue=None, date_from=None, year=None, date_to=None, meeting_type=None, terrain=None)
Returns a dict of events that correspond to the query parameters
Parameters:
event
(str): Optional event namemeeting
(str): Optional meeting namevenue
(str): Optional venue namedate_from
(str): Optional date to search from with format 'DD-MMM-YYYY' (to be used withdate_to
)date_to
(str): Optional date to search to with format 'DD-MMM-YYYY' (to be used withdate_from
)year
(int): Optional year to search withinmeeting_type
(str): Optional type of meeting (See below for available meeting types)terrain
(str): Optional type of terrain event was on
Returns:
results
(arr): List of results corresponding to event parametersdate
(str): Date of eventmeeting
(str): Meeting namevenue
(str): Venue name of meetingtype
(str): Type of terrain it was held onmeeting_id
(int): Reference id of meeting (used by PowerOf10)
Table of Parameters:
Terrain Types | Meeting Types |
---|---|
any | UK Calendar |
virtual | World Calendar |
disability | BMC |
walks | NAL |
mountain | YDL |
fell | SAL |
road/multi/xc | NEL |
road/multi | MJL |
5k/10k/hm/mar | |
xc | |
multi | |
indoor | |
road | |
track | |
track/10k/hm/mar/xc |
get_results(meeting_id)
Returns a dict of information for a particular meeting
Parameters:
meeting_id
(int): Reference id of meeting (used by PowerOf10)
Returns:
meeting
(arr):title
(str): Name of meetinglocation
(str): Location of meetingdate
(str): Date of meetingresults
(arr): List of results for each event at meetingevent
(str): Event nameage_group
(str): Age group that for eventrace
(int): Race numberresults
(arr): List of results for eventpos
(int): Position of athleteperf
(float): Performance of athletename
(str): Name of athleteathlete_id
(int): Reference id of athlete (used by PowerOf10)age_group
(str): Age group division of athletesex
(str): Gender of athleteyear
(str): Athlete year in age groupcoach
(str): Name of coachclub
(str): Name of clubsb
(float): Seasons bestpb
(float): Personal best