Module: show¶
This module provides objects used to retrieve shows, show information, and show details from a copy of the Wait Wait Don't Tell Me! Stats database.
Show¶
- class wwdtm.show.Show(connect_dict=None, database_connection=None)¶
Show retrieval class.
Contains methods used to retrieve basic and detailed show information, including hosts, scorekeepers, guests, panelists and scores.
- Parameters:
- retrieve_all()¶
Retrieves basic show information for all shows.
- retrieve_all_best_of_repeats()¶
- retrieve_all_best_of_repeats_details(include_decimal_scores=False)¶
Alias for
wwdtm.show.Show.retrieve_all_repeat_best_ofs_details().- Parameters:
include_decimal_scores (bool) -- A boolean to determine if decimal scores should be included
- Returns:
A list of dictionaries containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_all_best_ofs(inclusive=True)¶
Retrieves basic show information for all Best Of shows.
The list of Best Of shows includes repeat Best Of shows.
- retrieve_all_best_ofs_details(inclusive=True, include_decimal_scores=False)¶
Retrieves detailed show information for all Best Of shows.
The list of Best Of shows includes repeat Best Of shows.
- Parameters:
- Returns:
A list of dictionaries containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_all_counts_by_year(inclusive=False)¶
Retrieves show counts for all years, grouped by year.
- retrieve_all_dates()¶
Retrieves all show dates, sorted by show date.
- retrieve_all_dates_tuple()¶
Retrieves all show dates as a tuple.
- retrieve_all_details(include_decimal_scores=False)¶
Returns a list of dictionaries with show information and details for all shows.
- retrieve_all_ids()¶
Retrieves all show IDs, sorted by show date.
- retrieve_all_repeat_best_ofs()¶
Retrieves basic show information for all Repeat Best Of shows.
- retrieve_all_repeat_best_ofs_details(include_decimal_scores=False)¶
Retrieves detailed show information for all Repeat Best Of shows.
- Parameters:
include_decimal_scores (bool) -- A boolean to determine if decimal scores should be included
- Returns:
A list of dictionaries containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_all_repeats(inclusive=True)¶
Retrieves basic show information for all repeat shows.
- retrieve_all_repeats_details(inclusive=True, include_decimal_scores=False)¶
Retrieves detailed show information for all repeat shows.
- Parameters:
- Returns:
A list of dictionaries containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_all_show_years_months()¶
Retrieves all show years and months.
- retrieve_all_shows_years_months_tuple()¶
Retrieves all show years and months as a tuple.
- retrieve_best_ofs_by_year(year, inclusive=True)¶
Retrieves basic show information for Best Of shows by year.
The list of Best Of shows includes repeat Best Of shows.
- retrieve_best_ofs_details_by_year(year, inclusive=True, include_decimal_scores=False)¶
Retrieves detailed show information for Best Of shows by year.
- Parameters:
- Returns:
List of recent shows and corresponding details. If show information could not be retrieved, an empty list will be returned.
- Return type:
- retrieve_by_date(year, month, day)¶
Retrieves basic show information.
- retrieve_by_date_string(date_string)¶
Retrieves basic show information.
- retrieve_by_id(show_id)¶
Retrieves basic show information.
- retrieve_by_month_day(month, day)¶
Retrieves basic show information for shows by month and day.
- retrieve_by_year(year)¶
Retrieves basic show information by year.
- retrieve_by_year_month(year, month)¶
Retrieves basic show information by year and month.
- retrieve_counts_by_year(year, inclusive=False)¶
Retrieves show counts by year.
Counts of Best Of shows includes repeat Best Of shows.
- retrieve_details_by_date(year, month, day, include_decimal_scores=False)¶
Retrieves detailed show information.
- Parameters:
- Returns:
A dictionary containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_details_by_date_string(date_string, include_decimal_scores=False)¶
Retrieves detailed show information.
- Parameters:
- Returns:
A dictionary containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_details_by_id(show_id, include_decimal_scores=False)¶
Retrieve detailed show information.
- Parameters:
- Returns:
A dictionary containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_details_by_month_day(month, day, include_decimal_scores=False)¶
Retrieves detailed show information by month and day.
- Parameters:
- Returns:
A list of dictionaries containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_details_by_year(year, include_decimal_scores=False)¶
Retrieves detailed show information by year.
- Parameters:
- Returns:
A list of dictionaries containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_details_by_year_month(year, month, include_decimal_scores=False)¶
Retrieves detailed show information by year and month.
- Parameters:
- Returns:
A list of dictionaries containing show ID, show date, Best Of show flag, repeat show ID (if applicable), show URL at NPR.org, host, scorekeeper, location, panelists and guests
- Return type:
- retrieve_months_by_year(year)¶
Retrieves show months for a year.
- retrieve_random()¶
Retrieves information for a random show.
- retrieve_random_by_year(year)¶
Retrieves information for a random show for a specific year.
- retrieve_random_date()¶
Retrieves a date for a random show.
- Returns:
show date string for a random show, in YYYY-MM-DD format.
- Return type:
- retrieve_random_date_by_year(year)¶
Retrieves a date for a random show for a specific year.
- retrieve_random_date_object()¶
Retrieves a date object for a random show.
- Returns:
Date object for a random show.
- Return type:
- retrieve_random_date_object_by_year(year)¶
Retrieves a date object for a random show for a specific year.
- retrieve_random_details(include_decimal_scores=False)¶
Retrieves information and appearances for a random show.
- retrieve_random_details_by_year(year, include_decimal_scores=False)¶
Retrieves information and appearances for a random show for a specific year.
- retrieve_random_id()¶
Retrieves an ID for a random show.
- Returns:
ID for a random show.
- Return type:
- retrieve_random_id_by_year(year)¶
Retrieves an ID for a random show for a specific year.
- retrieve_recent(include_days_ahead=7, include_days_back=32)¶
Retrieves basic show information for recent shows.
- Parameters:
- Returns:
List of recent shows and corresponding information. If show information could not be retrieved, an empty list will be returned.
- Return type:
- retrieve_recent_details(include_days_ahead=7, include_days_back=32, include_decimal_scores=False)¶
Retrieves detailed show information for recent shows.
- Parameters:
- Returns:
List of recent shows and corresponding details. If show information could not be retrieved, an empty list will be returned.
- Return type:
- retrieve_repeat_best_ofs_by_year(year)¶
Retrieves basic show information for repeat Best Of shows by year.
- retrieve_repeat_best_ofs_details_by_year(year, include_decimal_scores=False)¶
Retrieves detailed show information for repeat Best Of shows by year.
- Parameters:
- Returns:
List of recent shows and corresponding details. If show information could not be retrieved, an empty list will be returned.
- Return type:
- retrieve_repeats_by_year(year, inclusive=True)¶
Retrieves basic show information for repeat shows by year.
The list of repeat Best Of shows includes repeat Best Of shows.
- retrieve_repeats_details_by_year(year, inclusive=True, include_decimal_scores=False)¶
Retrieves detailed show information for repeat shows by year.
The list of repeat Best Of shows includes repeat Best Of shows.
- Parameters:
- Returns:
List of recent shows and corresponding details. If show information could not be retrieved, an empty list will be returned.
- Return type:
- retrieve_scores_by_year(year, use_decimal_scores=False)¶
Retrieves panelist scores for all shows as a tuple.
ShowInfo¶
- class wwdtm.show.ShowInfo(connect_dict=None, database_connection=None)¶
Show information retrieval class.
Contains methods used to retrieve panelist, guest and Bluff the Listener information.
- Parameters:
- retrieve_bluff_info_by_id(show_id)¶
Retrieves Bluff the Listener information.
- retrieve_core_info_by_id(show_id)¶
Retrieves core information.
- retrieve_guest_info_by_id(show_id)¶
Retrieves Not My Job guest information.
- retrieve_panelist_info_by_id(show_id, include_decimal_scores=False)¶
Retrieves panelist information.
ShowInfoMultiple¶
- class wwdtm.show.ShowInfoMultiple(connect_dict=None, database_connection=None)¶
Multiple show information retrieval class.
Contains methods used to retrieve panelist, guest and Bluff the Listener information for multiple shows.
- Parameters:
- retrieve_bluff_info_all()¶
Retrieves Bluff the Listener information for all shows.
- retrieve_bluff_info_by_ids(show_ids)¶
Retrieves Bluff the Listener information for a list of shows.
- retrieve_core_info_all()¶
Retrieves core information for all shows.
- retrieve_core_info_by_ids(show_ids)¶
Retrieves core information for a list of shows.
- retrieve_guest_info_all()¶
Retrieves Not My Job guest information for all shows.
- retrieve_guest_info_by_ids(show_ids)¶
Retrieves Not My Job guest information for all shows.
- retrieve_panelist_info_all(include_decimal_scores=False)¶
Retrieves panelist information for all shows.
- retrieve_panelist_info_by_ids(show_ids, include_decimal_scores=False)¶
Retrieves panelist information for a list of shows.
- Parameters:
- Returns:
A dictionary containing panelist information, scores and rankings
- Return type:
ShowUtility¶
- class wwdtm.show.ShowUtility(connect_dict=None, database_connection=None)¶
Show information and utility class.
Contains methods to convert between show ID and date, and to check if show IDs and dates exist.
- Parameters:
- convert_date_to_id(year, month, day)¶
Converts a show date to the corresponding show ID.
- convert_id_to_date(show_id)¶
Converts a show ID to the corresponding show date.
- date_exists(year, month, day)¶
Validates if a show date exists.