Metadata-Version: 2.1
Name: gamgee
Version: 0.3.3
Summary: Gamgee helps you get up and running quickly with an AWS Lambda API.
Home-page: https://github.com/a-poor/gamgee
Author: Austin Poor
Author-email: 45295232+a-poor@users.noreply.github.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# gamgee

[![Test Package](https://github.com/a-poor/gamgee/actions/workflows/test-package.yml/badge.svg?branch=main&event=push)](https://github.com/a-poor/gamgee/actions/workflows/test-package.yml)
[![PyPI](https://img.shields.io/pypi/v/gamgee)](https://pypi.org/project/gamgee)
[![PyPI - License](https://img.shields.io/pypi/l/gamgee)](https://pypi.org/project/gamgee)

A python library for helping to setup an [AWS SAM](https://aws.amazon.com/serverless/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

```python
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

```bash
$ pip install gamgee
```

## To-Do

- [ ] Handle function request type parsing like [FastAPI](https://fastapi.tiangolo.com/)



