GetAthletes
GetAthletes(inactive: bool = False)
Description
Get the athletes for an account.
Parameters
inactive
: (bool) Specifies whether to include inactive athletes in the results. Default is False (inactive athletes are not included).
Returns
A Pandas DataFrame containing the athletes' information, with columns:
- id: Athlete's unique identifier.
- name: Athlete's given full name.
- teams: A nested list of athlete's team ids as strings.
- groups: A nested list of athlete's group ids as strings.
- active: Boolean indicating if the athlete's profile is active (not archived).
- external: Columns dynamically created for each external attribute associated with the athletes. (example = external.ExternalId: value)
Raises
Exception
- No Access Token Found.
- If the HTTP response status is not 200, indicating an unsuccessful API request, or if there is a failure in parsing the JSON response.
Example
Default: inactive = False
from hdforce import GetAthletes
# returns all athletes, including inactive
players = GetAthletes(inactive = True)
# Find Lauren Green
lg = players[players["name"] == "Lauren Green"]
# Print lg table
print(lg)
output
id | name | teams | groups | active | external.GradYear | external.location | external.uniqueId | external.StudentID |
---|---|---|---|---|---|---|---|---|
OLbsebtmf81eiwg1AeE5 | Lauren Green | ['DPMb6ek2mgUNVcg8siSqpnIvE2i2', 'vW9iEKafhs2PamfWQpFZ'] | ['yh8RnOvg56dQNrZGBKWZ'] | True | 2004 | Whittier | 83keo9wjei939ekd9 | SA0042643 |