nokey.inspiration package

Submodules

nokey.inspiration.dictum module

class nokey.inspiration.dictum.Dictum(use_caching=False, cache_name='dictum_cache', backend='sqlite', expire_after=3600)[source]

Bases: object

A class for interacting with the Dictum API.

base_url

The base URL of the API.

about

A short description of the API.

get_docs_url()[source]

Returns the URL for the Dictum API documentation.

Parameters:

None

Returns:

The URL for the API docs.

Return type:

string

get_inspiring_author_by_id(authorID, language='en')[source]

Returns the author matching the unique identifier.

Parameters:
  • language (str) – The language of the author. Defaults to en (English). Only other value supported is ru (Russian).

  • authorID (str) – A unique hexadecimal string identifying a specific author in the API.

Returns:

A dictionary containing the author matching the given id.

Return type:

dict

get_inspiring_authors(language='en', search_query=None, offset=0, limit=0)[source]

Returns list of authors featured in the API based on the given parameters.

Parameters:
  • language (str) – The language of the author. Default is en (English). Only other value supported is ru (Russian).

  • search_query (str) – The search query matching the author’s name. Default is None.

  • offset (int) – The page offset for the list of authors. Default is 0.

  • limit (int) – The number of items.

Returns:

A dictionary containing the authors matching the given parameters, along with the unique identifier for the author.

Return type:

dict

get_inspiring_quote_by_quote_id(quoteID, language='en')[source]

Returns a quote matching the unique identifier.

Parameters:
  • language (str) – The language of the author. Defaults to en (English). Only other value supported is ru (Russian).

  • quoteID (str) – A unique hexadecimal string identifying a specific quote in the API.

Returns:

A dictionary containing a quote matching the given id.

Return type:

dict

get_inspiring_quotes(language='en', search_query=None, offset=0, limit=0)[source]

Returns list of quotes matching the given parameters.

Parameters:
  • language (str) – The language of the author. Default is en (English). Only other value supported is ru (Russian).

  • search_query (str) – The search query matching the quote. Default is None.

  • offset (int) – The page offset for the list of quotes. Default is 0.

  • limit (int) – The number of items.

Returns:

A dictionary containing the quotes matching the given parameters, along with the unique identifier for the author.

Return type:

dict

get_inspiring_quotes_by_author_id(authorID, language='en')[source]

Returns quotes from an author matching the unique identifier.

Parameters:
  • language (str) – The language of the author. Defaults to en (English). Only other value supported is ru (Russian).

  • authorID (str) – A unique hexadecimal string identifying a specific author in the API.

Returns:

A dictionary containing quotes from the author matching the given id.

Return type:

dict

get_languages()[source]

Returns a list of author languages used in the API.

Parameters:

None

Returns:

A dictionary containing a list of languages (as of this time, only Russian and English)

Return type:

dict

get_number_of_quotes_and_authors(language='en')[source]

Returns the number of quotes and authors in the API for the given language.

Parameters:

language (str). The language of the quotes. Defaults to en (English). Only other value supported is ru (Russian) –

Returns:

Dictionary containing the number of authors and quotes for the given language.

Return type:

dict

get_random_quote(language='en')[source]

Returns a random quote.

Parameters:

language (str) – Language of the quote. Defaults to en (English). Only other value supported is ru (Russian).

Returns:

A dictionary containing the random quote.

Return type:

dict

Module contents