Flask-Rak is a Flask extension
that makes building Rogo applications for the Rogo Speaker easier and much more fun.
This project is heavily inspired and based on John Wheeler's Flask-ask for the Alexa Skills Kit.
A Flask-Rak application looks like:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint, jsonify
api = Blueprint('api', __name__)
from flask_rak import RAK, statement, question
APP_NAME = 'weather'
weather_app = RAK(
app_name=APP_NAME,
app=api,
route='/weather'
)
@weather_app.launch
def launch(data):
'''
data: Type _Field
'''
print 'launch: ', data
return statement(APP_NAME, "helllo")
In the code above:
- The
Rak
object is created by passing in the Flask application and a route to forward Rogo speaker requests to. - The
intent
decorator mapsHelloIntent
to a view functionhello
. - The intent's
firstname
slot is implicitly mapped tohello
'sfirstname
parameter.
To install Flask-Rak
pip install flask-ask
To install from your local clone or fork of the project, run:
python setup.py install
update new pip package to https://pypi.org/
python setup.py sdist
twine upload dist/*