{ "info": { "author": "Jeordy Rebbereh", "author_email": "jeordy@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# LambdaALBRouter\n\nLambdaALBRouter is a small package with flask-like syntax for routing requests from an AWS ALB in Lambda. It parses out all relavent information from the triggering event and passes it through to a matching registered route. With exceptions handled and turned into json responses, utilities for quickly exiting and returning json it is very easy to make quick APIs with ALB-fronted Lambdas in AWS.\n\nCurrently there is nothing implemented for handling templates or returning HTML, but that will be added in the future. Runtime data is stored in a separate class and not stored in the instance of ALBRouter to allow that instance to be a global variable (and cached between lambda executions) without running into caching issues.\n\n## Installing\n\n`pip install -U LambdaALBRouter`\n\n\n## Example\n\n```\nfrom LambdaALBRouter import router, abort, response\n\napp = router.ALBRouter()\n\ndef lambda_handler(event, _context):\n return app.process_lambda_alb_event(event)\n\n@app.route(\"/\")\ndef hello():\n return response(\"Hello world!\")\n\n@app.route(\"/hello/\")\ndef hello_user(user):\n return response(f\"Hello {user}!\")\n\n@app.route(\"/update/\", route_methods=[\"POST\"])\ndef update_user(user, context):\n input_data = context.data\n query_string = context.query_string\n request_headers = context.request_headers\n\n if not \"something\" in input_data.keys():\n abort(400, \"Missing required input 'something'\")\n\n # Update user in a database...\n\n return response(\n {\n \"message\": f\"Updated {user}!\",\n \"context\": context.__dict__\n }\n )\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JeordyR/LambdaALBRouter", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "LambdaALBRouter", "package_url": "https://pypi.org/project/LambdaALBRouter/", "platform": "", "project_url": "https://pypi.org/project/LambdaALBRouter/", "project_urls": { "Homepage": "https://github.com/JeordyR/LambdaALBRouter" }, "release_url": "https://pypi.org/project/LambdaALBRouter/0.2/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A package with flask-like syntax for routing requests from an AWS ALB in Lambda", "version": "0.2" }, "last_serial": 5524738, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "022be5b725da27b8a2482cc32249b3e2", "sha256": "01180d8434b44eac5b941abf007cd184cf28670d6f3d2da8eb59f14c4d4f8d65" }, "downloads": -1, "filename": "LambdaALBRouter-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "022be5b725da27b8a2482cc32249b3e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8581, "upload_time": "2019-07-07T15:22:18", "url": "https://files.pythonhosted.org/packages/e8/62/7bbd80479a987856a711733b831fd40d19995d7f97802a279dd9e35c4833/LambdaALBRouter-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "714b3aae97ee5a17a6ed0509375cef4e", "sha256": "1cc6f09300381751f33444e071e3b0b2089e96401b75ed5aa4f31f484958852e" }, "downloads": -1, "filename": "LambdaALBRouter-0.1.tar.gz", "has_sig": false, "md5_digest": "714b3aae97ee5a17a6ed0509375cef4e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7121, "upload_time": "2019-07-07T15:22:20", "url": "https://files.pythonhosted.org/packages/f2/99/7f83428e89c4a740991b7f2ca23ec4cfd3586b9c008a9af2bd4c4098366c/LambdaALBRouter-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "26ee27e5a78523ef360971c1eeaf907f", "sha256": "581641e03df71730841981c7f16d9ab13d2bdd2f9585d93c361fad5da7f76039" }, "downloads": -1, "filename": "LambdaALBRouter-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "26ee27e5a78523ef360971c1eeaf907f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8641, "upload_time": "2019-07-12T19:50:19", "url": "https://files.pythonhosted.org/packages/a0/dd/b038abd51ad403708915edf87f3f59eaa8f83b055e3a91a14fa006f6983a/LambdaALBRouter-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ac401133a042daef96b7495c2b5d9e7", "sha256": "2ddd1413b05d36083fe3b6c7a77b5d4d15f2382359a2d3e0c33b1cc4e60dd616" }, "downloads": -1, "filename": "LambdaALBRouter-0.2.tar.gz", "has_sig": false, "md5_digest": "0ac401133a042daef96b7495c2b5d9e7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7493, "upload_time": "2019-07-12T19:50:20", "url": "https://files.pythonhosted.org/packages/9c/c8/a217230420bf69345af727ae711f3ed32cf99f0fc65f6233b597a9a1214b/LambdaALBRouter-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "26ee27e5a78523ef360971c1eeaf907f", "sha256": "581641e03df71730841981c7f16d9ab13d2bdd2f9585d93c361fad5da7f76039" }, "downloads": -1, "filename": "LambdaALBRouter-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "26ee27e5a78523ef360971c1eeaf907f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8641, "upload_time": "2019-07-12T19:50:19", "url": "https://files.pythonhosted.org/packages/a0/dd/b038abd51ad403708915edf87f3f59eaa8f83b055e3a91a14fa006f6983a/LambdaALBRouter-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ac401133a042daef96b7495c2b5d9e7", "sha256": "2ddd1413b05d36083fe3b6c7a77b5d4d15f2382359a2d3e0c33b1cc4e60dd616" }, "downloads": -1, "filename": "LambdaALBRouter-0.2.tar.gz", "has_sig": false, "md5_digest": "0ac401133a042daef96b7495c2b5d9e7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7493, "upload_time": "2019-07-12T19:50:20", "url": "https://files.pythonhosted.org/packages/9c/c8/a217230420bf69345af727ae711f3ed32cf99f0fc65f6233b597a9a1214b/LambdaALBRouter-0.2.tar.gz" } ] }