Athlete
- class swimrankingsscraper.swimrankingsscraper.Athlete(athlete_id, sessionManager, update_interval=60)[source]
Represents an athlete and provides methods to retrieve information about the athlete’s personal bests and meets.
Attributes: - athlete_id (str): The ID of the athlete. - sessionManager (SessionManager): The SessionManager instance for making HTTP requests. - update_interval (int): The minimum time interval (in seconds) between consecutive updates.
Methods: - __init__(athlete_id, sessionManager, update_interval=60): Initializes the Athlete with an athlete ID and a requests session. - list_personal_bests() -> list: Retrieves a list of personal bests for the athlete. - list_meets() -> list: Retrieves a list of meets in which the athlete has participated.
Usage Example:
`python session_manager = SessionManager() athlete_instance = Athlete('athlete_id_here', session_manager, update_interval=120) personal_bests = athlete_instance.list_personal_bests() meets = athlete_instance.list_meets() `Details: - This class inherits from ScraperMixin to leverage common functionality for making HTTP requests. - athlete_id is required to identify the athlete. - sessionManager is needed for making HTTP requests, and update_interval sets the minimum time between updates. - Use list_personal_bests() to retrieve a list of personal bests, represented as dictionaries. - The personal bests data includes event name, course length, time, result ID, and result URL. - In case of an error or no data, an empty list is returned. - Use list_meets() to retrieve a list of meets in which the athlete has participated. - The meets data includes meet ID, meet date, meet city, and meet name. - In case of an error or no data, an empty list is returned.