ErrorAffirmations API

Detailed below is the API for the ErrorAffirmations package.

Functions

add_affirmations(affirmations: str | Iterable[str]) None[source]

Add affirmation(s) to the set of affirmations.

Parameters:
affirmations: str or iterable of str

An encouraging message to help you feel better about your errors. Or a collection of such messages.

remove_affirmations(affirmations: str | Iterable[str]) None[source]

Remove affirmation(s) from the set of affirmations.

Parameters:
affirmations: str or iterable of str

An encouraging message to help you feel better about your errors. Or a collection of such messages.

clear_affirmations() None[source]

Clear the set of affirmations.

get_affirmations() set[source]

Return a copy of the set of affirmations.

Returns:
affirmations: set

A set of encouraging messages to help you feel better about your errors.

get_random_affirmation() str[source]

Return a random affirmation.

Returns:
affirmation: str

An encouraging message to help you feel better about your errors.

load_affirmations_from_file(file: str, append: bool = True) None[source]

Load affirmations from a file.

Parameters:
file: str

Path to file containing affirmations, one per line.

append: bool, optional

Whether to append affirmations to the existing set of affirmations

reset_affirmations() None[source]

Reset affirmations to the defaults from the default file.

affirmations_enabled() bool[source]

Return whether affirmations are enabled.

Returns:
affirmations_enabled: bool

Whether affirmations are enabled.

enable_affirmations() None[source]

Enable affirmations.

disable_affirmations() None[source]

Disable affirmations.

Attributes

affirmations.DEFAULT_FILE = Path to the default affirmations file.