athena package

Submodules

athena.apis module

Finds and stores APIs in the ‘api_lib’ global variable

athena.apis.find_apis()[source]

Find APIs

athena.apis.list_apis()[source]

List APIs

athena.apis.verify_apis(user)[source]

Verify APIs

athena.brain module

The “Brain” class handles most of Hey Athena’s processing. To listen for input, use brain.inst.run()

class athena.brain.Brain[source]

Bases: object

error()[source]

Inform the user that an error occurred

execute_mods(text)[source]

Executes the modules in prioritized order

execute_tasks(mod, text)[source]

Executes a module’s task queue

find_mods()[source]

Find and import modules from the module directory

find_users()[source]

Returns a list of available user strings

greet()[source]

Greet the user

list_mods()[source]

Print modules in order

load_user(username)[source]

Load (username).yml data into the user

login()[source]
match_mods(text)[source]

Attempts to match a modules and their tasks

mod_select(mods)[source]

Prompt user to specify which module to use to respond

run()[source]

Listen for input, match the modules and respond

verify_user_exists()[source]

Verify that at least 1 user exists

athena.brain.init()[source]

athena.config module

Helpful methods for generating a user .yml config file

athena.config.block_print(title)[source]

Prints a title block

athena.config.generate()[source]

Generates a user .yml config file

athena.config.safe_input(prompt, require=False)[source]

Prompts the user for input

Parameters:
  • prompt – text to prompt user for input
  • require – if True, require the user to enter a valid input
Returns:

user text input

athena.settings module

Global settings are stored here

athena.stt module

Basic Speech-To-Text tools are stored here

athena.stt.active_listen()[source]

Actively listens for speech to translate into text

Returns:speech input as a text string
athena.stt.init()[source]
athena.stt.listen_keyword()[source]

Passively listens for the WAKE_UP_WORD string

athena.tts module

Basic Text-To-Speech tools are stored here

athena.tts.init()[source]
athena.tts.play_mp3(file_name, file_path='C:\\Workspace\\py\\hey-athena-client\\athena\\media')[source]

Plays a local MP3 file

Parameters:
  • file_name – top-level file name (e.g. hello.mp3)
  • file_path – directory containing file (‘media’ folder by default)
athena.tts.speak(phrase, cache=False, filename='default', show_text=True)[source]

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