Module: host¶
This module provides objects used to retrieve hosts, host information and host details from a copy of the Wait Wait Don't Tell Me! Stats database.
Host¶
- class wwdtm.host.Host(connect_dict=None, database_connection=None)¶
Host information retrieval class.
Contains methods used to retrieve host information, including IDs, names, slug strings and appearances.
- Parameters:
- retrieve_all()¶
Retrieves host information for all hosts.
- retrieve_all_details()¶
Retrieves host information and appearances for all hosts.
- retrieve_all_ids()¶
Retrieves all host IDs, sorted by host name.
- retrieve_all_slugs()¶
Retrieves all host slug strings, sorted by host name.
- retrieve_by_id(host_id)¶
Retrieves host information.
- retrieve_by_slug(host_slug)¶
Retrieves host information.
- retrieve_details_by_id(host_id)¶
Retrieves host information and appearances.
- retrieve_details_by_slug(host_slug)¶
Retrieves host information and appearances.
- retrieve_random()¶
Retrieves information for a random host.
- retrieve_random_details()¶
Retrieves information and appearances for a random host.
- retrieve_random_id()¶
Retrieves an ID for a random host.
- Returns:
ID for a random host.
- Return type:
HostAppearances¶
HostUtility¶
- class wwdtm.host.HostUtility(connect_dict=None, database_connection=None)¶
Host information and utilities class.
Contains methods used to convert between host ID and slug strings, and to check if host IDs and slug strings exist.
- Parameters:
- convert_id_to_slug(host_id)¶
Converts a host ID to the corresponding host slug string.
- convert_slug_to_id(host_slug)¶
Converts a host slug string to the corresponding host ID.
- id_exists(host_id)¶
Validates if a host ID exists.