Serverless nanoframework for AWS API Gateway and AWS Lambda
Project description
Sippy Cup is an extremely minimalistic Python framework to quickly create serverless applications using AWS API Gateway and AWS Lambda.
Sippy Cup converts the input format sent to an AWS Lambda function by API Gateway into a WSGI environment to provide a set of Werkzeug-based requestand response objects, converting the latter to the return format expected by API Gateway.
It is intended to be similar in use to Python frameworks such as Flask and Chalice, although by design it has a significantly smaller feature set.
Getting started
Installation
Because you will eventually need to create a deployment package, it is highly recommended that you use a virtualenv when using Sippy Cup.
pip install sippycup
Create a simple application
lambda_function.py provides a demo application
# lambda_function.py
from sippycup import SippyCup
app = SippyCup()
@app.route('/hello/<string:name>', methods=['GET', 'POST'])
@app.mimetype('text/plain')
def hello_world(name='World'):
return 'Hello, {0}!'.format(name)
@app.route('/')
def index():
return app.request
lambda_handler = app.run
You will the need to create a deployment package and use that to create a new AWS Lambda function.
Finally, set up an API Gateway proxy resource with the lambda proxy integration. It is recommended to create resources on both ‘/’ and ‘/SOMEPREFIX’ unless you don’t need the ‘/’ route.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.