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]
disable_mod(name)[source]
enable_mod(name)[source]
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_users()[source]

Returns a list of available user strings

greet()[source]

Greet the user

list_mods()[source]
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

quit()[source]
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 pretty title block

athena.config.generate()[source]

Generates a user .yml config file

athena.log module

Basic athena logging tools

athena.log.debug(msg)[source]

Logs a debug message to the logger

athena.log.error(msg)[source]

Logs an error message to the logger

athena.log.info(msg)[source]

Logs an info message to the logger

athena.mods module

Finds and stores APIs in the ‘api_lib’ global variable

athena.mods.disable_mod(name)[source]
athena.mods.enable_mod(name)[source]
athena.mods.find_mods()[source]

Find and import modules from the module directories

athena.mods.list_mods()[source]

Print modules in order

athena.settings module

Global settings are stored here

athena.settings.MAX_CHAR = 140

LANGS = [‘af’, ‘sq’, ‘ar’, ‘hy’, ‘ca’, ‘zh-CN’, ‘zh-TW’, ‘hr’, ‘cs’, ‘da’, ‘nl’, ‘en’, ‘eo’, ‘fi’, ‘fr’, ‘de’, ‘el’, ‘ht’, ‘hi’, ‘hu’, ‘is’, ‘id’, ‘it’, ‘ja’, ‘ko’, ‘la’, ‘lv’, ‘mk’, ‘no’, ‘pl’, ‘pt’, ‘ro’, ‘ru’, ‘sr’, ‘sk’, ‘es’, ‘sw’, ‘sv’, ‘ta’, ‘th’, ‘tr’, ‘vi’, ‘cy’]

athena.stt module

Basic Speech-To-Text tools are stored here

athena.stt.active_listen()[source]

Actively listens for speech to translate into text :return: 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.ignore_stderr(*args, **kwds)[source]

Ignore unwanted ‘error’ output from pyglet/pyaudio

athena.tts.init()[source]
athena.tts.play_mp3(file_name, file_path='/Users/conzor/Documents/py/hey-athena-client/athena/data/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, log_text=True)[source]

Speaks a given text phrase

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