CLub

class swimrankingsscraper.swimrankingsscraper.Club(club_id, session, update_interval=60)[source]

Represents a club and provides methods to retrieve information about the club’s athletes.

Attributes: - sessionManager (SessionManager): The SessionManager instance for making HTTP requests. - club_id (str): The ID of the club. - update_interval (int): The minimum time interval (in seconds) between consecutive updates.

Methods: - __init__(sessionManager, club_id, update_interval=60): Initializes the Club with a requests session. - list_athletes() -> List[Dict[str, Union[str, int]]]: Retrieves a list of athletes in the club.

Usage Example: `python session_manager = SessionManager() club_instance = Club(session_manager, club_id='123456', update_interval=120) club_athletes = club_instance.list_athletes() `

Details: - This class inherits from ScraperMixin to leverage common functionality for making HTTP requests. - Use list_athletes() to retrieve a list of athletes in the club. - The returned data is in the form of a list of dictionaries, each containing information about an athlete. - Dictionary keys include ‘athlete_id’ and ‘athlete_name’. - Athlete information is fetched based on the specified club and gender.

list_athletes(gender=0)[source]

Retrieves a list of athletes.

Parameters: - gender: 0 for ALL, 1 for Men, 2 for Women. Defaults to 0 this will only return currently active athletes.

Returns: - list: A list of dictionaries containing information about each athlete.