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.
- 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
Attributes
- affirmations.DEFAULT_FILE = Path to the default affirmations file.