Skill API
The Skill API offers a simple and convenient way to use other Skill's methods and export your own to help other Skill creators.
Making a method available through the Skill API
@skill_api_method
def my_exported_method(self, my_arg, my_other_arg):
"""My skill api method documentation
"""Limitations
Example
from mycroft.skills import MycroftSkill, skill_api_method
class RobberSkill(MycroftSkill):
@skill_api_method
def robber_lang(self, sentence):
"""Encode a sentence to "Rövarspråket".
Each consonant gets converted to consonant + "o" + consonant,
vowels are left as is.
Returns: (str) sentence in the robber language.
"""
wovels = "aeiouyåäö"
tokens = []
for char in sentence.lower() and char.isalpha():
if char not in wovels:
tokens.append(char + 'o' + char)
else:
tokens.append(char)
return ' '.join(tokens)
def create_skill():
return RobberSkill()Using another Skill's API
Getting information on a Skill's exported API
Last updated
Was this helpful?