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
eventdictionaries 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, json
In [2]: event = {"body": "{\"hello\":\"world\"}", "queryStringParameters": {"name": "samwise"}}
In [3]: @gamgee.sam(body=json.loads, queryString=True)
...: def lambda_handler(body, query):
...: return body["hello"]
...:
In [4]: lambda_handler(event, None)
Out[4]: {'statusCode': 200, 'body': '{"success": true, "result": "world"}'}
Installation
$ pip install gamgee
To-Do
- Handle function request type parsing like FastAPI
Metadata
Release files for gamgee 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gamgee-0.3.3.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gamgee-0.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.5 kB
Release files / gamgee-0.3.3.tar.gz
| Download URL | gamgee-0.3.3.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab95ddb95f626e09d076244635052498e9bb4bb1578955b5d647aad8afee6f14
|
|
BLAKE2b-256 checksum How to use checksums |
5367aee1d129ee3c6b42f1644e47b9a150c7262fd3ec1650eb3f848ddb6ec7d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Release files / gamgee-0.3.3-py3-none-any.whl
| Download URL | gamgee-0.3.3-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
347c7e37e2cd645289ab0c33c9636dd4292930d2c880aaed2e1d21ff18f21a3a
|
|
BLAKE2b-256 checksum How to use checksums |
1a61ae0ec037da1eb84fec66a6bb65aeb10afd212d371bcc5548c6fc06c7abee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|