We are excited to announce the Alexa Skills Kit (ASK) Software Development Kit (SDK) for Python (beta). The SDK includes the same features available in our Java and Node.js SDKs, and allows you to reduce the amount of boilerplate code you have to write to process Alexa responses and requests. If you code using Python, you can use the SDK to quickly build and deliver voice experiences using Alexa and the extensive Python support libraries and tools.
When you build an Alexa skill, you provide a cloud-based service that receives requests (in JSON) sent by Alexa and returns appropriate responses (in JSON) that Alexa uses to respond to the customer. We provide a consistent feature set in our Java, Node.js, and Python (Beta) SDKs to reduce the amount of code you need to write to process the requests and responses, and to handle other common skill tasks. You can use the following key features:
- Request Handling. Request Handling in the SDK makes it easy for you to invoke the right code when Alexa sends you a request. You can write a single handler for multiple Alexa intents, or invoke different handlers based on nearly any request attribute. The ASK SDK for Python (Beta) also introduces flexible handler registration, allowing you to use either decorators or traditional class-based implementations of handler features.
- Response Building. You can deliver responses to your customers that include text-to-speech, audio and video streams, and cards and other visual elements. Customers will receive one or more of these elements depending on what Alexa-compatible device they are using. Using the SDK, you can build responses that include all of these elements.
- Attribute Management. You can store and retrieve information at different scopes using Attributes in the SDK. Attributes allow you to keep track of what happened so far, and to use this information to determine what happens next. You can define attributes that for a single request, for a single customer session, or for the lifetime of your skill.
- Alexa API Calls. You can call nearly any Alexa API from within your skill logic using service clients in the SDK. The service clients automatically inject relevant endpoint and authentication token information on your behalf.
Build Your First Alexa Skill with Python Quickly and Tell Us What You Think
Visit the alexa-skills-kit-sdk-for-python repository on GitHub to find everything you need to get started, from a “Hello, world” sample to the complete technical documentation. You can host your Python skill in AWS Lambda or the infrastructure of your choice. Note that because of the AWS Free Tier and AWS Promotional Credits for Alexa, you can build and host most Alexa skills for free using AWS.
Try the ASK SDK for Python (beta) today, and tell us what you think. You can provide feature requests and feedback on issues you encounter by creating a GitHub issue on the repository. We can’t wait to see what you build.
Source: Alexa Developer Blog