Module: panelist¶
This module provides objects used to retrieve panelists, panelist information and panelist details from a copy of the Wait Wait Don't Tell Me! Stats database.
Panelist¶
- class wwdtm.panelist.Panelist(connect_dict=None, database_connection=None)¶
Panelist information retrieval class.
Contains methods used to retrieve panelist information, including IDs, names, slug strings, appearances and scores.
- Parameters:
- retrieve_all()¶
Retrieve panelist information for all panelists.
- retrieve_all_details(number_decimal_places=5)¶
Retrieves panelist information, appearances and scores for all panelists.
- Parameters:
number_decimal_places (int) -- Number of decimal places to include when rounding (valid range: 0 through 20)
- Returns:
A list of dictionaries containing panelist ID, name, slug string, gender, pronouns, whether the panelist is also a guest, host or scorekeeper, scoring statistics and appearances for each panelist
- Return type:
Changed in version 3.2.0: Added
number_decimal_placesparameter
- retrieve_all_ids()¶
Retrieves all panelist IDs, sorted by panelist name.
- retrieve_all_slugs()¶
Retrieves all panelist slug strings, sorted by panelist name.
- retrieve_by_id(panelist_id)¶
Retrieves panelist information.
- retrieve_by_slug(panelist_slug)¶
Retrieves panelist information.
- retrieve_details_by_id(panelist_id, number_decimal_places=5)¶
Retrieves panelist information, appearances and scores.
- Parameters:
- Returns:
A dictionary containing panelist ID, name, slug string, gender, pronouns, whether the panelist is also a guest, host or scorekeeper, scoring statistics and appearances
- Return type:
Changed in version 3.2.0: Added
number_decimal_placesparameter
- retrieve_details_by_slug(panelist_slug, number_decimal_places=5)¶
Retrieves panelist information, appearances and scores.
- Parameters:
- Returns:
A dictionary containing panelist ID, name, slug string, gender, pronouns, whether the panelist is also a guest, host or scorekeeper, scoring statistics and appearances
- Return type:
Changed in version 3.2.0: Added
number_decimal_placesparameter
- retrieve_external_sites_by_id(panelist_id)¶
Retrieves external site information for a panelist.
- Parameters:
panelist_id (int) -- Panelist ID
- Returns:
A list of dictionaries containing external site information, including social media accounts.
- Return type:
Added in version 3.4.0.
- retrieve_external_sites_by_slug(panelist_slug)¶
Retrieves external site information for a panelist.
- Parameters:
panelist_slug (str) -- Panelist slug string
- Returns:
A list of dictionaries containing external site information, including social media accounts.
- Return type:
Added in version 3.4.0.
- retrieve_pronouns_by_id(panelist_id)¶
Retrieves preferred pronouns for a panelist.
- Parameters:
panelist_id (int) -- Panelist ID
- Returns:
A list of preferred pronouns.
- Return type:
Added in version 3.3.0.
- retrieve_pronouns_by_slug(panelist_slug)¶
Retrieves preferred pronouns for a panelist.
- Parameters:
panelist_slug (str) -- Panelist slug string
- Returns:
A list of preferred pronouns.
- Return type:
Added in version 3.3.0.
- retrieve_random()¶
Retrieves information for a random panelist.
- retrieve_random_details(number_decimal_places=5)¶
Retrieves information and appearances for a random panelist.
- Parameters:
number_decimal_places (int) -- Number of decimal places to include when rounding (valid range: 0 through 20)
- Returns:
A dictionary containing panelist ID, name, slug string, gender, pronouns, whether the panelist is also a guest, host or scorekeeper, scoring statistics and appearances
- Return type:
Changed in version 3.2.0: Added
number_decimal_placesparameter
- retrieve_random_id()¶
Retrieves an ID for a random panelist.
- Returns:
ID for a random panelist.
- Return type:
- retrieve_random_slug()¶
Retrieves an slug string for a random panelist.
- Returns:
Slug string for a random panelist.
- Return type:
- retrieve_social_media_accounts_by_id(panelist_id)¶
Retrieves social media accounts for a panelist.
- Parameters:
panelist_id (int) -- Panelist ID
- Returns:
A list of dictionaries containing social media account information.
- Return type:
Deprecated since version 3.4.0: Use
retrieve_external_sites_by_id()instead. Will be removed in version 3.6.Added in version 3.3.0.
- retrieve_social_media_accounts_by_slug(panelist_slug)¶
Retrieves social media accounts for a panelist.
- Parameters:
panelist_slug (str) -- Panelist slug string
- Returns:
A list of dictionaries containing social media account information.
- Return type:
Deprecated since version 3.4.0: Use
retrieve_external_sites_by_slug()instead. Will be removed in version 3.6.Added in version 3.3.0.
PanelistAppearances¶
- class wwdtm.panelist.PanelistAppearances(connect_dict=None, database_connection=None)¶
Panelist appearance information retrieval class.
Contains methods used to retrieve panelist appearance information and statistics, scores and rankings.
- Parameters:
- retrieve_appearances_by_id(panelist_id)¶
Retrieves panelist appearance information.
- retrieve_appearances_by_slug(panelist_slug)¶
Retrieves panelist appearance information.
- retrieve_yearly_appearances_by_id(panelist_id)¶
Retrieves panelist appearance counts grouped by year.
PanelistDecimalScores¶
- class wwdtm.panelist.PanelistDecimalScores(connect_dict=None, database_connection=None)¶
Panelist decimal score retrieval class.
Contains methods used to retrieve panelist decimal scores and calculate scoring statistics.
- Parameters:
- retrieve_scores_by_id(panelist_id)¶
Retrieves a list of panelist decimal scores, sorted by show date.
- retrieve_scores_by_slug(panelist_slug)¶
Retrieves a list of panelist decimal scores, sorted by show date.
- retrieve_scores_grouped_list_by_id(panelist_id)¶
Retrieves panelist grouped decimal scores.
- retrieve_scores_grouped_list_by_slug(panelist_slug)¶
Retrieves panelist grouped decimal scores.
- retrieve_scores_grouped_ordered_pair_by_id(panelist_id)¶
Retrieves a list of panelist decimal scores and counts as a tuple.
- retrieve_scores_grouped_ordered_pair_by_slug(panelist_slug)¶
Retrieves a list of panelist decimal scores and counts as a tuple.
- retrieve_scores_list_by_id(panelist_id)¶
Retrieves panelist appearances and decimal scores as paired lists.
- retrieve_scores_list_by_slug(panelist_slug)¶
Retrieves panelist appearances and decimal scores as paired lists.
- retrieve_scores_ordered_pair_by_id(panelist_id)¶
Retrieves panelist appearances and decimal scores as a list of tuples.
PanelistScores¶
- class wwdtm.panelist.PanelistScores(connect_dict=None, database_connection=None)¶
Panelist score retrieval class.
Contains methods used to retrieve panelist scores and calculate scoring statistics.
- Parameters:
- retrieve_scores_by_id(panelist_id)¶
Retrieves a list of panelist scores, sorted by show date.
- retrieve_scores_by_slug(panelist_slug)¶
Retrieves a list of panelist scores, sorted by show date.
- retrieve_scores_grouped_list_by_id(panelist_id)¶
Retrieves panelist grouped scores.
- retrieve_scores_grouped_list_by_slug(panelist_slug)¶
Retrieves panelist grouped scores.
- retrieve_scores_grouped_ordered_pair_by_id(panelist_id)¶
Retrieves a list of panelist scores and counts as a tuple.
- retrieve_scores_grouped_ordered_pair_by_slug(panelist_slug)¶
Retrieves a list of panelist scores and counts as a tuple.
- retrieve_scores_list_by_id(panelist_id)¶
Retrieves panelist appearances and scores as paired lists.
- retrieve_scores_list_by_slug(panelist_slug)¶
Retrieves panelist appearances and scores as paired lists.
- retrieve_scores_ordered_pair_by_id(panelist_id)¶
Retrieves panelist appearances and scores as a list of tuples.
PanelistStatistics¶
- class wwdtm.panelist.PanelistStatistics(connect_dict=None, database_connection=None)¶
Panelist statistics information retrieval and calculation class.
Contains methods used to retrieve Bluff the Listener, ranking and scoring statistics.
- Parameters:
- retrieve_bluffs_by_id(panelist_id)¶
Retrieve panelist Bluff the Listener statistics.
- retrieve_bluffs_by_slug(panelist_slug)¶
Retrieve panelist Bluff the Listener statistics.
- retrieve_rank_info_by_id(panelist_id)¶
Retrieves panelist ranking information.
- retrieve_rank_info_by_slug(panelist_slug)¶
Retrieves panelist ranking information.
- retrieve_statistics_by_id(panelist_id, number_decimal_places=5)¶
Retrieves and calculates panelist statistics.
The returned statistics includes estimated population variance and standard deviation based on the full set of total scores for the requested panelist.
- Parameters:
- Returns:
A dictionary containing panelist scoring and ranking statistics. Returns an empty dictionary if number_digits value is not valid.
- Return type:
Changed in version 3.1.0: Added
number_digitsparameter.Changed in version 3.2.0: Renamed
number_digitstonumber_decimal_places.
- retrieve_statistics_by_slug(panelist_slug, number_decimal_places=5)¶
Retrieves and calculates panelist statistics.
The returned statistics includes estimated population variance and standard deviation based on the full set of total scores for the requested panelist.
- Parameters:
- Returns:
A dictionary containing panelist scoring and ranking statistics. Returns an empty dictionary if number_digits value is not valid.
- Return type:
Changed in version 3.1.0: Added
number_digitsparameter.Changed in version 3.2.0: Renamed
number_digitstonumber_decimal_places.
PanelistUtility¶
- class wwdtm.panelist.PanelistUtility(connect_dict=None, database_connection=None)¶
Panelist information and utilities class.
Contains methods used to convert between panelist ID and slug strings, and to check if panelist IDs and slug strings exist.
- Parameters:
- convert_id_to_slug(panelist_id)¶
Converts a panelist ID to the corresponding panelist slug string.
- convert_slug_to_id(panelist_slug)¶
Converts a panelist slug string to the corresponding panelist ID.
- id_exists(panelist_id)¶
Validates if a panelist ID exists.