Meet
- class swimrankingsscraper.swimrankingsscraper.Meet(meet_id, session, update_interval=60)[source]
Represents a swimming meet and provides methods to retrieve information about clubs, events, and results.
Attributes: - meet_id (str): The ID of the meet. - sessionManager (SessionManager): The SessionManager instance for making HTTP requests. - update_interval (int): The minimum time interval (in seconds) between consecutive updates.
Methods: - __init__(meet_id, sessionManager, update_interval=60): Initializes the Meet with a meet ID and a requests session. - list_clubs() -> list: Retrieves a list of clubs that participated in the meet. - list_events() -> list: Retrieves a list of events that took place in the meet. - list_races(event_id, gender) -> list: Retrieves a list of different races within the same event in the meet. - list_results(event_id, gender, race_id) -> list: Retrieves a list of results for a specific event in the meet.
Usage Example:
`python session_manager = SessionManager() meet_instance = Meet('meet_id_here', session_manager, update_interval=120) clubs = meet_instance.list_clubs() events = meet_instance.list_events() races = meet_instance.list_races('event_id_here', 'gender_here') results = meet_instance.list_results('event_id_here', 'gender_here', race_id_here) `Details: - This class inherits from ScraperMixin to leverage common functionality for making HTTP requests. - meet_id is required to identify the meet. - sessionManager is needed for making HTTP requests, and update_interval sets the minimum time between updates. - Use list_clubs() to retrieve a list of clubs that participated in the meet. - The clubs data includes club ID and club name. - In case of an error or no data, an empty list is returned. - Use list_events() to retrieve a list of events that took place in the meet. - The events data includes event ID, event gender, and event name. - In case of an error or no data, an empty list is returned. - Use list_races(event_id, gender) to retrieve a list of different races within the same event in the meet. - The races data includes race ID and race name. - In case of an error or no data, an empty list is returned. - Use list_results(event_id, gender, race_id) to retrieve a list of results for a specific event in the meet. - The results data includes result ID, athlete name, club name, swim time, and split times. - In case of an error or no data, an empty list is returned.
- list_clubs()[source]
Retrieves a list of clubs that participated in the meet.
Returns: - list: A list of dictionaries containing information about each club.
- list_events()[source]
Retrieves a list of events that took place in the meet.
Returns: - list: A list of dictionaries containing information about each event.
- list_races(event_id, gender)[source]
Retrieves a list of different races within the same event in the meet.
Parameters: - event_id (str): The ID of the event. - gender (str): 1 for male, 2 for female.
returns: - list: A list of dictionaries containing information about each race.
- list_results(event_id, gender, race_id)[source]
Retrieves a list of results for a specific event in the meet.
Parameters: - event_id (str): The ID of the event. - gender (str): 1 for male, 2 for female. - race_id (int): a number coronsponding with a specific race.
Returns: - list: A list of dictionaries containing information about each result.