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 request and 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 it has a significantly smaller feature set by design.
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 the original event sent to Lambda from API Gateway
return app.request.apigr
lambda_handler = app.run
You will 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.
Source Distribution
File details
Details for the file sippycup-0.2.0.tar.gz
.
File metadata
- Download URL: sippycup-0.2.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5254e46709bc6a81bb6b9fb44ca63205512056b94044ec48e4e84c071a7efc63 |
|
MD5 | 0a5d81be0a2bcff88bdd58ad2b5ca69e |
|
BLAKE2b-256 | a38e079440897badb3e0570079a861f64a23fe8193beb9b5ce1a003f181ac151 |