Meets
- class swimrankingsscraper.swimrankingsscraper.Meets(session, update_interval=60)[source]
Represents a list of meets and provides methods to retrieve information about the meets.
Attributes: - sessionManager (SessionManager): The SessionManager instance for making HTTP requests. - update_interval (int): The minimum time interval (in seconds) between consecutive updates.
Methods: - __init__(sessionManager, update_interval=60): Initializes the Meets with a requests session. - list_periods() -> List[Dict[str, Union[str, int]]]: Retrieves a list of periods. - list_nations() -> List[Dict[str, Union[str, int]]]: Retrieves a list of nations. - list_meets(nation_id=None, period_id=’RECENT’) -> List[Dict[str, Union[str, int]]]: Retrieves a list of meets.
Usage Example:
`python session_manager = SessionManager() meets_instance = Meets(session_manager, update_interval=120) recent_meets = meets_instance.list_meets(period_id='RECENT') `Details: - This class inherits from ScraperMixin to leverage common functionality for making HTTP requests. - Use list_periods() to retrieve a list of periods. - Use list_nations() to retrieve a list of nations. - Use list_meets() to retrieve a list of meets, with optional filtering by nation and period. - The returned data is in the form of a list of dictionaries, each containing information about a meet. - Dictionary keys include ‘meet_id’, ‘meet_date’, ‘meet_city’, ‘meet_name’, and ‘course_length’. - ‘nation_id’ and ‘period_id’ parameters in list_meets() allow optional filtering by nation and period, respectively.
- list_meets(nation_id=None, time_period_id='RECENT')[source]
Retrieves a list of meets.
Parameters: - nation_id (str): The ID of the nation. Defaults to None. - time_period_id (str): The ID of the time period. Defaults to ‘RECENT’.
Returns: - list: A list of dictionaries containing information about each meet.