Skip to main content

A simple toolkit for building Alexa skills.

Project description

A simple Python 3 toolkit to build Alexa Skills using AWS Lambda.

lambdaskill itself has no external dependencies beyond the Python standard library. However, the included utilties package requires the aniso8601 package.

The interface is pretty straight-forward. Just subclass the Skill class to create your own skill. Add methods named like do_yourintent() to handle an intent named ‘yourintent’. Use the Response object to prepare a response. Cards can be attached to the response if desired. The lambda function handler is obtained by calling the get_handler() class method on your new class.

The following is a simple demo that would respond to an intent called ‘hellointent’ that has a slot named ‘NAME’:

from lambdaskill import *

class DemoSkill(Skill):

    def do_hellointent(self, request):
        slots = request.get_slots()
        name = slots['NAME']
        return Response.respond('Hello, {}'.format(name))

handler = DemoSkill.get_handler()

Note that intents that include characters not permitted in Python method names (such as the Amazon built-in intents, ex: AMAZON.SearchActionobject@WeatherForecast%5Btemperature%5D) can be handled as follows (extending the example above):

@DemoSkill.intent('AMAZON.SearchAction<object@WeatherForecast[temperature]>')
def weather_intent_handler(self, request):
    return Response.respond('You asked about the weather.')

Which will add the intent handler to the class definition with an appropriately mangled name. Obviously, you would include these lines before the call to get_hander(), as the get_handler() call creates an instance of the class and returns the handler method of that instance.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lambdaskill-0.14.0.tar.gz (8.7 kB view details)

Uploaded Source

File details

Details for the file lambdaskill-0.14.0.tar.gz.

File metadata

  • Download URL: lambdaskill-0.14.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lambdaskill-0.14.0.tar.gz
Algorithm Hash digest
SHA256 d60661d1e613199fd34d3f3cde446ad127ea2e3dfad0bef4f9fd3c8dd7438b7c
MD5 970477c287cbb2ab58b56542da2cb91c
BLAKE2b-256 b784a91254ee5efedc0e1dee8c4ea4b06bb468be7b0b2eda36195efdc6a1b78a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page