Starting today, developers can start creating and deploying Python-based skills using the Alexa Skills Kit (ASK) Command-Line Interface (CLI) and the ASK Toolkit for Visual Studio (VS) Code. This enhanced support enables you to choose your preferred runtime when creating a new skill and access Python templates from the ASK CLI and ASK Toolkit for VS Code. This will allow you to have a starting point for building your Python Alexa Skill.
Simplify Code Deployment with Hook Scripts
In the past, deploying Python code via the ASK CLI extended development time because it required you to manually prepare your code packages and add dependencies. Now with hook scripts available in the ASK CLI, you can automate the process of installing dependencies and packaging your code before deploying. Hook scripts also work with your Node.js code. This simplifies the process of deploying Python and Node.js code to AWS Lambda and enables you to augment the CLI's default deployment behavior. When you create a new skill in Node.js or Python using the CLI, we provide you with default hook scripts in your skill project folder, which will get your function packages ready for deployment to AWS Lambda. You can customize these hook scripts to add additional behavior, such as uploading media files to Amazon S3.
You must install or upgrade the CLI to version 1.5 or higher in order to use hook script to create and deploy Python Alexa skills. You can learn more about the CLI here. For more information on hook scripts and their integration into the CLI, please see this documentation.
ASK Toolkit for Visual Studio Code is now GA, with Python Support
We are also happy to announce that Python developers can use the ASK Toolkit for Visual Studio Code, which is powered by the ASK CLI to deploy Python-based skills. The toolkit now also supports code snippet generation for the ASK Software Development Kit (SDK) for Python, which was among the top requests we received during since the toolkit’s public beta. This enables you to generate boiler-plate code to handle your voice requests.
Download the ASK CLI and ASK Toolkit for VS Code
If you currently use the Tooklit, update to the latest version to take advantage of Python support. If you use Visual Studio Code and have not tried the new ASK toolkit, visit our getting started guide for step-by-step instructions to help you install and use the toolkit. You can install the toolkit extension from this link in the Visual Studio Code marketplace or by searching for “Alexa” in the Visual Studio Code extensions tab. To download the CLI, which is required to work with the ASK Toolkit, follow the getting started guide above or click here.
Source: Alexa Developer Blog