Skip to main content

Python package to add compatibility between Flask and AWS Lambda for creating RESTful applications.

Project description


Flask-Lambda2 is a python package to add a compatibility layer between a Flask application and AWS Lambda for creating RESTful applications.

This package is opinionated, in that “it locks or guides you into [our] way of doing things” or “doesn’t make it easy to diverse from [our] golden path.”


$ pip install flask-lambda2


The main assumption here is that your project can comfortably and reasonably fit into a single endpoint, or you separate your Lambda functions to group certain, related API endpoints together.

Firstly, ensure your Lambda handler is set to, where project_api is the filename (excluding the .py extension) containing your project’s API endpoint implementations and where app is the Flask instance (actually a FlaskLambda instance) with which you have added the URL rules onto.

Lastly, ensure that invokation convention from the location you plan to invoke the endpoints from roughly follows the calling convention shown below:

import boto3

client = boto3.client('lambda')

That’s it!


Tests are available in Flask-Lambda2/tests through invoking with python Ensure all dependencies are installed through invoking pip install -r requirements.txt.

Functional Examples


I have created a backend for a mobile application using this library, it’s source code is available here at the GridLight-API repository.

If you have any questions, feel free to e-mail me at

Built With

  • Flask - Micro web-framework based on Werkzeug and Jinja2


This project is licensed under the Apache 2.0 License - see the file for details

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

flask-lambda2-2.0.0.tar.gz (3.6 kB view hashes)

Uploaded source

Built Distribution

flask_lambda2-2.0.0-py2.py3-none-any.whl (5.4 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page