athena.classes package

Submodules

athena.classes.api module

The “Api” class is used when an instance of an API is required in the athena.apis.api_lib

Use “from athena.apis import api_lib” & “api_lib[‘(api_name_key)’]” to access instances of APIs.

class athena.classes.api.Api(key, save_data=None, enabled=True)[source]

Bases: object

verify_data(user)[source]

Verify that the current user .yml file has required save_data attributes

athena.classes.module module

The “Module” class represents a collection of tasks

class athena.classes.module.Module(mod_params, mod_tasks=[])[source]

Bases: object

name = None

Modules match and execute in prioritized order

athena.classes.response module

The “Response” class represents a cached audio response

class athena.classes.response.Response(key, text)[source]

Bases: object

athena.classes.task module

The “Task” class represents an action to be performed

The “ActiveTask” class uses the “match” method to trigger an action. Generally regex patterns are supplied to do the input matching. The “match” method can be overriden with “return match_any(text)” to trigger an action upon matching any given regex pattern.

class athena.classes.task.ActiveTask(patterns=[], priority=0, greedy=True, regex_precompile=True, regex_ignore_case=True)[source]

Bases: athena.classes.task.Task

match(text)[source]

Check if the task input criteria is met

match_and_save_groups(text, group_key_dict)[source]

Check if any patterns match, If so, save the match groups to self.(key name)

match_any(text)[source]

Check if any patterns match

priority = None

If task is matched, stop module from matching the proceeding tasks

class athena.classes.task.Task[source]

Bases: object

action(text)[source]

Execute the task action

static speak(phrase, cache=False, filename='default', show_text=True)

Speaks a given text phrase

Parameters:
  • phrase – text string to speak
  • cache – if True, store .mp3 in ‘media/responses’
Raises:

HTTPError – if Google TTS fails to respond