Skip to main content

gamgee

Test Package PyPI PyPI - License

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, 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

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.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gamgee-0.3.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file gamgee-0.3.3.tar.gz.

File metadata

  • Download URL: gamgee-0.3.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for gamgee-0.3.3.tar.gz
Algorithm Hash digest
SHA256 ab95ddb95f626e09d076244635052498e9bb4bb1578955b5d647aad8afee6f14
MD5 779ff638132241b10f2067b9568a16d0
BLAKE2b-256 5367aee1d129ee3c6b42f1644e47b9a150c7262fd3ec1650eb3f848ddb6ec7d9

See more details on using hashes here.

File details

Details for the file gamgee-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: gamgee-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for gamgee-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 347c7e37e2cd645289ab0c33c9636dd4292930d2c880aaed2e1d21ff18f21a3a
MD5 28d1dca2bea41514d9116522d172144c
BLAKE2b-256 1a61ae0ec037da1eb84fec66a6bb65aeb10afd212d371bcc5548c6fc06c7abee

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 files

0.3.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page