Skip to main content

The Django ASK SDK package provides support for using ASK SDK and Django, to deploy custom skills as webservice

Project description

Django ASK SDK - Extending ASK SDK to work with Django

django-ask-sdk is the extension package, that will let skill developers use ASK SDK package in their Django application. It provides an easy way to register and use skills as custom webservices.

Quick Start

If you already have a skill built using the ASK SDK skill builders, then you only need to do the following, to set this up in your django app (example_app):

example_app/my_skill.py

from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk_core.handler_input import HandlerInput
from ask_sdk_core.dispatch_components import AbstractRequestHandler
from ask_sdk_core.utils import is_request_type
from ask_sdk_model import Response

sb = SkillBuilder()

class LaunchRequestHandler(AbstractRequestHandler):
    """Handler for skill launch."""
    def can_handle(self, handler_input):
        # type: (HandlerInput) -> bool
        return is_request_type("LaunchRequest")(handler_input)

    def handle(self, handler_input):
        # type: (HandlerInput) -> Response
        speech = "Hello"
        handler_input.response_builder.speak(speech)
        return handler_input.response_builder.response

# Other skill components here ....

# Register all handlers, interceptors etc.
# For eg : sb.add_request_handler(LaunchRequestHandler())

skill = sb.create()

example_app/urls.py

from .my_skill import skill
from django_ask_sdk.skill_adapter import SkillAdapter

my_skill_view = SkillAdapter.as_view(
    skill=skill)

urlpatterns = [
    path('/', my_skill_view, name='index'),
]

Are you planning to deploy your skill on AWS Lambda? Then, you don’t even need this package. The ASK SDK provides a lambda_handler that can be directly used in your lambda console.

More code examples can be found here.

Features

  • Works as an extension on skills built using ASK SDK. No need to learn something new.

  • Provides default request signature and request timestamp verification. These can be configured on app level by setting / unsetting default parameters on the view.

  • Provides a way to register multiple skills on your app, at different endpoints.

Installation

Assuming that you have Python and virtualenv installed, you can install the package and it’s dependencies (ask-sdk-webservice-support) from PyPi as follows:

$ virtualenv venv
$ . venv/bin/activate
$ pip install django-ask-sdk

This package is not installed along-side ask-sdk standard distribution, and has to be installed separately if you need support for skill deployment as webservice, using Django.

SDK Usage and Getting Started

Getting started guides, SDK Features, API references, samples etc. can be found in the technical documentation

Got Feedback?

  • We would like to hear about your bugs, feature requests, questions or quick feedback. Please search for the existing issues before opening a new one. It would also be helpful if you follow the templates for issue and pull request creation. Please follow the contributing guidelines!!

  • Request and vote for Alexa features!

CHANGELOG

0.1

  • Initial release of Django ASK SDK extension package.

0.1.1

This release contains the following changes :

  • Fix setting the custom user agent on the skill instance, when initializing the handler.

1.0.0

This release contains the following changes :

  • Move the webservice adapters to GA.

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

django-ask-sdk-1.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

django_ask_sdk-1.0.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file django-ask-sdk-1.0.0.tar.gz.

File metadata

  • Download URL: django-ask-sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for django-ask-sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c8baad9777b62fc3d8712c08951524c9901ba56d552cbe8c9218dd71d523d59f
MD5 2e8b72a287bbe1020f688843e83e6b77
BLAKE2b-256 66e43fd1e7b02d575028561427c19ab1305f63ab1abb02a2e35b356ff374eb91

See more details on using hashes here.

File details

Details for the file django_ask_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_ask_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for django_ask_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7afefea4726929b0e88436f0d9e8d3635e72e5fe732a42a699f0ec66fd351d21
MD5 6a3b9a72342b40dfcd937ef982b71562
BLAKE2b-256 11daa940aaf99bbd111286475020a8a182eb45675bf09516625778cf2a24ce59

See more details on using hashes here.

Supported by

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