{ "info": { "author": "Superpedestrian, Inc", "author_email": "dev@superpedetrian.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha" ], "description": ".. image:: https://img.shields.io/travis/Superpedestrian/lambada.svg\n :target: https://travis-ci.org/Superpedestrian/lambada\n :alt: Build status\n.. image:: https://img.shields.io/coveralls/Superpedestrian/lambada.svg\n :target: https://coveralls.io/r/Superpedestrian/lambada\n :alt: Coverage\n.. image:: https://img.shields.io/pypi/v/lambada.svg\n :target: https://pypi.python.org/pypi/lambada\n :alt: 'PyPI Package'\n.. image:: https://readthedocs.org/projects/lambada/badge/?version=latest\n :target: http://lambada.readthedocs.io/en/latest/?badge=latest\n :alt: Latest Documentation\n.. image:: https://readthedocs.org/projects/lambada/badge/?version=release\n :target: http://lambada.readthedocs.io/en/release/?badge=release\n :alt: Release Documentation\n\n\nA `flask `_ like framework for building\nmultiple lambdas in one library/package by utilizing `lambda-uploader\n`_.\n\nQuickstart\n==========\n\n\nAll you'll need to do to create a minimal lambada application is to\nadd the following to a file called ``lambda.py`` :\n\n.. code-block:: python\n\n from lambada import Lambada\n\n tune = Lambada(role='arn:aws:iam:xxxxxxx:role/lambda')\n\n\n @tune.dancer\n def test_lambada(event, context):\n print('Event: {}'.format(event))\n\nand a ``requirements.txt`` file that includes the lambada package\n(either ``lambada`` or ``https://github.com/Superpedestrian/lambada``\nfor the latest release or developer version respectively.\n\nMuch like a flask app, we now have a python file that is configured to\nupload a lambda function with the name ``test_lambada`` in your AWS\naccount in the ``us-east-1`` region (since that is the default), and\nthe handler will be set to ``lamda.tune``, again the default.\n\nSo what is this doing over just writing the same thing without this framework?\n\nFor one it gives you a command line toolset to test, list, and publish\nmultiple functions to AWS as independant Lambda's with one code base.\n\nNow that you have your code, you can run the ``lambada`` command line\ntool after running ``pip install -r requirements.txt`` to do something\nlike ``lambada list``\n\n::\n\n List of discovered lambda functions/dancers:\n\n test_lambada:\n description:\n\nYou can also test that lambda with an event passed on the command line\nusing ``lambada run test_lambada --event 'Hello'`` to get:\n\n::\n\n Event: Hello\n\nwhich creates a faked AWS Context object before running the specified\n*dancer*.\n\nFrom there we can also package the functions (the same package works\nfor all defined *dancers*/Lambda functions). So without configuring\nany AWS credentials, we can run ``lambada package`` to create a zip\nfile with all your requirements packaged up (from the earlier created\n``requirements.txt``) that you can manually upload to AWS Lambda\nthrough the Web interface or similar.\n\nIf you have your AWS API credentials setup, and the correct\npermissions, you can also run ``lambada upload`` to have the function\ncreated and/or versioned with the packaged code for each *dancer*.\n\nPretty neat so far, but where it starts to get cool is when there are\nmany *dancers* with different requirements, VPCs, timeouts, security\nconfiguration, and memory requirements all in the same deployable\npackage similar to the following. We're going to go ahead and call\nour file ``fouronthefloor.py`` just as a reference for the\ncustomization you can do, so the contents of ``fouronthefloor.py``\nwould look like:\n\n.. code-block:: python\n\n from lambada import Lambada\n\n chart = Lambada(\n handler='fouronthefloor.chart',\n role='arn:aws:iam:xxxxxxx:role/lambda',\n region='us-west-2',\n timeout=60,\n memory=128\n )\n\n\n @chart.dancer\n def test_lambada(event, context):\n print('Event: {}'.format(event))\n\n\n @chart.dancer(\n name='not_the_function_name',\n description='Cool description',\n memory=512,\n region='us-east-1',\n requirements=['requirements.txt', 'xtra_requirements.txt']\n )\n def cool_oneoff(event, context):\n print('Wow, so much memory! in a diff region and extra reqs!')\n\n\n @chart.dancer(memory=1024, timeout=5)\n def bob_loblaw(event, _):\n print('Such a great reference!')\n\nWhich gives a ``lambada list`` that looks like:\n\n::\n\n List of discovered lambda functions/dancers:\n\n bob_loblaw:\n description:\n timeout: 5\n memory: 1024\n\n test_lambada:\n description:\n\n not_the_function_name:\n description: Cool description\n region: us-east-1\n requirements: ['requirements.txt', 'xtra_requirements.txt']\n memory: 512\n \nAnd with a few lines we've created three lambdas with different execution\nrequirements all with one ``lambada upload`` command. Such a simple\nseductive dance \ud83d\ude1c.\n\nBouncers\n========\n\nAWS Lambda doesn't yet feature a way to add secure configuration items\nthrough environment variables (if it ever will), but there is often a\nneed to have secrets that you don't want checked into source control\nsuch as API keys, passwords, certificates, etc. Generally it is nice\nto specify these with an out of source tree configuration file or\nenvironment variables. To achieve that here, we have the concept of\n``Bouncer`` objects. This configuration object is created by default\nwhen you instantiate the ``Lambada`` class with a default configuration\nthat you can use out of the box. The default\n:py:obj:`lambada.Bouncer` object looks for YAML configuration files in\nthe following paths:\n\n- Path specified by the environment variable ``BOUNCER_CONFIG``\n- The current working directory for ``lambada.yml``\n- Your ``HOME`` directory for ``.lambada.yml``\n- ``/etc/lambada.yml``\n\nand it does so in that order, terminating as soon as it successfully finds one.\n\n\nIn addition to those configuration files, it also will automatically\nadd any variable prefixed with ``BOUNCER_`` (again default, and can be\nchanged to an arbitrary prefix) to the bouncer configuration. This\nmeans that without any code you can add configuration to your Lambada\nproject by just adding say ``BOUNCER_API_KEY`` to your local\nconfiguration and referencing it in your code as\n``tune.bouncer.api_key`` (assuming ``tune`` is the variable you chose\nfor your lambada class.\n\nSimilarly, if you define a ``lambada.yml`` configuration file that looks like:\n\n.. code-block:: yaml\n\n api_key: 1234abcd\n\nit will be accessible in the same way as ``tune.bouncer.api_key``.\n\nIt is worth noting that the environment variable will override the\nsame named variable in your yaml file.\n\nHow this works in Lamda is that the Bouncer configuration on the\nLambada is read when packaged for AWS and written to a _lambada.yml\nconfiguration and is looked for first when running in Lambda.\n\n\nCustomizing Bouncers\n~~~~~~~~~~~~~~~~~~~~\n\nIf those defaults don't work for you, you can also pass in your own\n``Bouncer`` to the ``Lambada`` object on creation. It allows you to directly pass in the path to the configuration and/or change the environment variable prefix like so:\n\n.. code-block:: python\n\n from lambada import Bouncer, Lambada\n\n bouncer = Bouncer(config='foobar.yml', env_prefix='COOL_')\n tune = Lambada(bouncer=bouncer, role=bouncer.role)\n\n @tune.dancer\n def test_lambada(event, context):\n print(bouncer.role)\n\nas an example, which lets you use bouncer to help configure the ``Lambada`` object\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Superpedestrian/lambada", "keywords": "", "license": "License :: OSI Approved :: Apache Software License", "maintainer": "", "maintainer_email": "", "name": "lambada", "package_url": "https://pypi.org/project/lambada/", "platform": "", "project_url": "https://pypi.org/project/lambada/", "project_urls": { "Homepage": "https://github.com/Superpedestrian/lambada" }, "release_url": "https://pypi.org/project/lambada/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "A framework for multiple AWS lambdas in one library/package", "version": "0.2.1" }, "last_serial": 2415785, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "bdb12073d1451ab8d71d77817ecd8831", "sha256": "75d75c39d02acccf2adc22b85b74cef39e57f2199576a3aed27ba2d7604269a1" }, "downloads": -1, "filename": "lambada-0.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "bdb12073d1451ab8d71d77817ecd8831", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11782, "upload_time": "2016-09-28T14:31:19", "url": "https://files.pythonhosted.org/packages/23/1d/24f3ae9466a4bb070b74f411bd6fb8685b58a6c652854d46a19fee72a9a4/lambada-0.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "18a936fbf49dd660105005d3b29cf9e6", "sha256": "3e07bf3781c9725ed26885427f57c1de16d99423d6f65ed3b314c4fea2401a6d" }, "downloads": -1, "filename": "lambada-0.0.0.tar.gz", "has_sig": false, "md5_digest": "18a936fbf49dd660105005d3b29cf9e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7707, "upload_time": "2016-09-28T14:31:16", "url": "https://files.pythonhosted.org/packages/66/fa/ae0a110218f38a1505ec40b05bacff637655d77ab1250febdddf698614e7/lambada-0.0.0.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "9ac60d2e181254c5af09d1c8a4d169da", "sha256": "3d32ad1f244ff590ad0c3b61dd55c027a5ce579cf05388ef5ceb0f2c44b233d0" }, "downloads": -1, "filename": "lambada-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "9ac60d2e181254c5af09d1c8a4d169da", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16352, "upload_time": "2016-10-04T14:20:08", "url": "https://files.pythonhosted.org/packages/f9/80/d1ee043575d7e624008b80b91ceca4f658fbcb5a3e012faa864f55ce026d/lambada-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fe77dfbb262aee8c8a89690c2100f115", "sha256": "cbae27ff2e505b917b5154a83cf243bbe6b7c3054b073faec605b99e39d66388" }, "downloads": -1, "filename": "lambada-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fe77dfbb262aee8c8a89690c2100f115", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10576, "upload_time": "2016-10-04T14:20:11", "url": "https://files.pythonhosted.org/packages/2e/f1/1b8e1c06de031ced984394d81f601db41881175b568682073134481daf29/lambada-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "932747a632d9e164e60eaea6b50d4069", "sha256": "f2c59bd9bdb5c0a4680955cb2609adffede8117aed9372264bc3272a2503f037" }, "downloads": -1, "filename": "lambada-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "932747a632d9e164e60eaea6b50d4069", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20997, "upload_time": "2016-10-05T04:14:43", "url": "https://files.pythonhosted.org/packages/f9/b4/adc55b43057b0df58ba6bd246e44ccb8d7aeb95eb2d6bba313d730f0201f/lambada-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8a33dd5a199bf472c5969994024781e", "sha256": "9da83aa6e96fcfb2395ad59300b978a1b2f615de1d81ed4d3dd1939b06099ce0" }, "downloads": -1, "filename": "lambada-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e8a33dd5a199bf472c5969994024781e", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 20999, "upload_time": "2016-10-05T04:24:55", "url": "https://files.pythonhosted.org/packages/9b/17/7f072292668535739aee0992a78275e1d974138238750453b328da95460a/lambada-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e68b4feadaf8f1e756a062331ee076c3", "sha256": "be6419700fd2cdc02d8ff939edaded470e124a644dfe93d5b7a4d1d583072a42" }, "downloads": -1, "filename": "lambada-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e68b4feadaf8f1e756a062331ee076c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14200, "upload_time": "2016-10-05T04:14:45", "url": "https://files.pythonhosted.org/packages/29/66/bd7bb2144f52bcea3f34f36c195071e3580e765236e37eae6e1aed032cf5/lambada-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "39aafcc3756ed2efff3d8647d8cbda49", "sha256": "59bb86ded9ad3daef04a5566b648f5d2eb35f16130e855821a06feab92335ec3" }, "downloads": -1, "filename": "lambada-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "39aafcc3756ed2efff3d8647d8cbda49", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21119, "upload_time": "2016-10-21T21:30:38", "url": "https://files.pythonhosted.org/packages/66/45/9e73db871369a9049df032a3737ed2697fd8a31384350f238b6ba770cb0d/lambada-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e755edeabf03137a5eb38aac1caf888", "sha256": "fb7ad7649e8c1879a327264af6bef8e15305331db505065269db449d24606fb7" }, "downloads": -1, "filename": "lambada-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0e755edeabf03137a5eb38aac1caf888", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14331, "upload_time": "2016-10-21T21:30:36", "url": "https://files.pythonhosted.org/packages/da/5f/277986d1a29acd4779aac8606fe17a0f2ddb4e21e761c28c4d712085e3fa/lambada-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "39aafcc3756ed2efff3d8647d8cbda49", "sha256": "59bb86ded9ad3daef04a5566b648f5d2eb35f16130e855821a06feab92335ec3" }, "downloads": -1, "filename": "lambada-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "39aafcc3756ed2efff3d8647d8cbda49", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21119, "upload_time": "2016-10-21T21:30:38", "url": "https://files.pythonhosted.org/packages/66/45/9e73db871369a9049df032a3737ed2697fd8a31384350f238b6ba770cb0d/lambada-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e755edeabf03137a5eb38aac1caf888", "sha256": "fb7ad7649e8c1879a327264af6bef8e15305331db505065269db449d24606fb7" }, "downloads": -1, "filename": "lambada-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0e755edeabf03137a5eb38aac1caf888", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14331, "upload_time": "2016-10-21T21:30:36", "url": "https://files.pythonhosted.org/packages/da/5f/277986d1a29acd4779aac8606fe17a0f2ddb4e21e761c28c4d712085e3fa/lambada-0.2.1.tar.gz" } ] }