{"id":13572215,"url":"https://github.com/erik/alexandra","last_synced_at":"2025-04-04T09:32:03.041Z","repository":{"id":52705641,"uuid":"46254766","full_name":"erik/alexandra","owner":"erik","description":"Python toolkit for writing Amazon Echo skills as web services","archived":true,"fork":false,"pushed_at":"2021-04-20T17:09:27.000Z","size":73,"stargazers_count":94,"open_issues_count":2,"forks_count":13,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-05T05:34:00.765Z","etag":null,"topics":["amazon-alexa-skill","amazon-echo","libraries","python"],"latest_commit_sha":null,"homepage":"http://alexandra.rtfd.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erik.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-16T05:49:51.000Z","updated_at":"2024-04-19T20:01:45.000Z","dependencies_parsed_at":"2022-08-22T08:00:15.657Z","dependency_job_id":null,"html_url":"https://github.com/erik/alexandra","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erik%2Falexandra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erik%2Falexandra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erik%2Falexandra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erik%2Falexandra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erik","download_url":"https://codeload.github.com/erik/alexandra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247153763,"owners_count":20892731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-alexa-skill","amazon-echo","libraries","python"],"created_at":"2024-08-01T14:01:16.738Z","updated_at":"2025-04-04T09:31:58.031Z","avatar_url":"https://github.com/erik.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"alexandra\n=========\n\n|Build Status|\n\nMinimal Python library to remove the tedious boilerplate-y parts of\nwriting Alexa skills. Alexandra is tested against Python 2.7 and 3.6.\n\nAlexandra can be used as part of an AWS lambda function or a self-hosted\nserver. There's a builtin WSGI app if you're in to that kind of thing.\n\nCheck out `the api documentation \u003chttp://alexandra.rtfd.org/\u003e`__ for\nmore details on what alexandra can do.\n\n.. code:: python\n\n\n    import alexandra\n\n    app = alexandra.Application()\n    name_map = {}\n\n    @app.launch\n    def launch_handler():\n        return alexandra.reprompt('What would you like to do?')\n\n    @app.intent('MyNameIs')\n    def set_name_intent(slots, session):\n        name = slots['Name']\n        name_map[session.user_id] = name\n\n        return alexandra.respond(\"Okay, I won't forget you, %s\" % name)\n\n    @app.intent('WhoAmI')\n    def get_name_intent(slots, session):\n        name = name_map.get(session.user_id)\n\n        if name:\n            return alexandra.respond('You are %s, of course!' % name)\n\n        return alexandra.reprompt(\"We haven't met yet! What's your name?\")\n\n    if __name__ == '__main__':\n        app.run('0.0.0.0', 8080, debug=True)\n\ninstalling\n----------\n\nAlexandra uses ``pyOpenSSL``, which requires the ``libffi`` library to\ncompile. Make sure that's installed first.\n\nIf you're on OS X, check out `the special\ninstructions \u003chttps://cryptography.io/en/latest/installation/#building-cryptography-on-os-x\u003e`__\nfor installing the OpenSSL library if you get errors during installation.\n\nAnd then:\n\n``pip install alexandra``\n\nusing alexandra with aws lambda\n-------------------------------\n\nGetting an alexandra app running on lambda is much easier than running\nyour own server, and is probably the right choice unless you need to\naccess the local network or have some other complication that prevents\nyou from using the service.\n\nHere's an example:\n\n.. code:: python\n\n    app = alexandra.Application()\n\n    @app.intent('FooBar')\n    def foo_bar():\n        ...\n\n    # Entry point to our lambda function.\n    def lambda_handler(event, context):\n        return alexa.dispatch_request(event)\n\nrunning with uwsgi\n------------------\n\nThe ``alexandra.Application`` class has a ``run`` method, which is\nuseful enough for testing purposes and simple projects, but for real\ndeployments, you'll probably want to use something a little more robust,\nsuch as uWSGI.\n\nAlexandra works with uwsgi in almost exactly the same way Flask does.\n\n.. code:: python\n\n    # skill_module.py\n\n    app = alexandra.Application()\n    wsgi_app = app.create_wsgi_app()\n\n    @app.intent('FooBar')\n    def foobar():\n        ...\n\nThe above can be run with uwsgi as\n``uwsgi -w skill_module:wsgi_app --http 0.0.0.0:5678``\n\nsetting up a web server\n-----------------------\n\nAmazon requires a real SSL certificate for skills to be rolled out to\nother users, but fortunately for testing and personal projects\nself-signed certificates are acceptable.\n\nTo make it a bit easier to generate a self signed SSL certificate and\nnginx configuration, here's a Python 2.7/3.5.1 compatible\n`standalone script \u003chttps://gist.github.com/erik/119dd32efc269d6dd5d7\u003e`_ to\ngenerate basic config for a standard unix setup.\n\nAfter running the script, simply add a ``location`` block to the nginx\nconfig for any new Alexa skills being hosted on the same box.\n\nFor example, if there's an alexandra skill running on port 6789, you\nwould add:\n\n::\n\n    location /some_random_endpoint {\n        proxy_pass http://localhost:6789;\n    }\n\n.. |Build Status| image:: https://travis-ci.org/erik/alexandra.svg?branch=master\n   :target: https://travis-ci.org/erik/alexandra\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferik%2Falexandra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferik%2Falexandra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferik%2Falexandra/lists"}