Gamgee helps you get up and running quickly with an AWS Lambda API.
Project description
gamgee
A python library for helping to setup an AWS SAM app -- specifically API Gateway SAM apps. gamgee
aims to help users avoid rewriting boilerplate code within AWS Lambda handler functions.
The core functionality is wrapped up in the decorator function @gamgee.sam
-- which can help with:
- Converting API request
event
dictionaries to function params (gathered from path-params, the query string, and the request body) - Handling errors and responses by catching them and returning them with the propper HTTP status codes
- Authenticating / authorizing users making requests
Quick Start
In [1]: import gamgee
In [2]: event = {"queryStringParameters": {"name": "samwise"}}
In [3]: @gamgee.sam()
...: def lambda_handler(name: gamgee.Query(str)) -> int:
...: return len(name)
...:
In [4]: lambda_handler(event, None)
Out[4]: {'status_code': 200, 'body': '{"success": true, "result": 7}'}
Installation
$ pip install gamgee
To-Do
- Handle function request type parsing like FastAPI
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
gamgee-0.3.2.tar.gz
(6.7 kB
view hashes)
Built Distribution
gamgee-0.3.2-py3-none-any.whl
(7.8 kB
view hashes)