Module: external_site

This module provides objects used to retrieve external site information from a copy of the Wait Wait Don't Tell Me! Stats database.

External Sites

class wwdtm.external_site.ExternalSites(connect_dict=None, database_connection=None)

External sites information retrieval class.

Contains methods used to retrieve available external sites.

Parameters:
  • connect_dict (dict[str, Any]) -- A dictionary containing database connection settings as required by MySQL Connector/Python

  • database_connection (MySQLConnection | PooledMySQLConnection) -- MySQL database connection object

Added in version 3.4.4.

retrieve_all()

Retrieves all external sites, sorted by site ID.

Returns:

A list of dictionaries each containing external site ID, site name, slug string, social media network flag and icon name

Return type:

list[dict[int, str]]

Added in version 3.4.4.

retrieve_all_as_dict()

Retrieves all external sites as a dictionary, sorted by site ID.

Returns:

A dictionary of external site IDs as keys, each containing site name, slug string, social network flag and icon name

Return type:

dict[int, dict[str, str]]

Added in version 3.4.4.

retrieve_all_ids()

Retrieves all external site IDs, sorted by site ID.

Returns:

A list of external site IDs

Return type:

list[int]

Added in version 3.4.4.

retrieve_all_site_names()

Retrieves all external sites, ordered by site ID.

Returns:

A list of external site names

Return type:

list[str]

Added in version 3.4.4.

retrieve_all_site_slugs()

Retrieves all external site slug strings, ordered by site ID.

Returns:

A list of extern media site slug strings

Return type:

list[str]

Added in version 3.4.4.

retrieve_by_id(site_id)

Retrieves external site information by site ID.

Parameters:

site_id (int) -- External site ID

Returns:

A dictionary containing external site ID, site name, slug string, social media flag and icon name

Return type:

dict[int, str]

Added in version 3.4.4.

retrieve_by_slug(site_slug)

Retrieves external site information by site slug string.

Parameters:
  • site_id -- External site slug string

  • site_slug (str)

Returns:

A dictionary containing external site ID, site name, slug string, social media flag and icon name

Return type:

dict[int, str]

Added in version 3.4.4.