pyvolleydata.helpers ==================== .. py:module:: pyvolleydata.helpers Functions --------- .. autoapisummary:: pyvolleydata.helpers.get_data pyvolleydata.helpers.validate_seasons Module Contents --------------- .. py:function:: get_data(league, seasons, data_type) Loads data for a specified league and season(s) from the volleydata repository. :param league: A string specifying which of 'mlv', 'pvf', or 'au' to load data for. :type league: str :param data_type: The type of data to fetch (e.g., 'pbp', 'events_log') :type data_type: str :param seasons: Season(s) to load. By default, None loads all available seasons. - int : Single season year (e.g., 2025) - list of int : Multiple seasons (e.g., [2024, 2025]) - None : Load all available seasons :type seasons: int, list of int, or None, optional :returns: A DataFrame containing the merged or filtered data with an additional 'league' column. :rtype: pd.DataFrame .. rubric:: Examples >>> fetch_data(league='mlv', data_type='pbp', seasons=2024) >>> fetch_data(league='au', data_type='rosters', seasons=[2022, 2023]) >>> fetch_data(league='lovb', data_type='events_log') .. py:function:: validate_seasons(seasons, league_start_year) Checks whether all the provided seasons are valid years and raises an error if not. :param seasons: A list of years representing seasons to validate. :type seasons: list of int :param league_start_year: The starting year to determine if the seasons are within range. :type league_start_year: int :rtype: None .. rubric:: Examples >>> validate_seasons([2024, 2025], 2024) >>> validate_seasons(['2020'], 2024) # Raises TypeError >>> validate_seasons([2022, 2023, 2030], 2024) # Raises ValueError