Skip to main content

For making lambdas easier

Project description

Bails Lambda Utils

For making lambda's easier

pip install bails-lambda-utils

Quality Gate Status Coverage

Usage

Decorators

The libarary provides a decorator lambda_handler which should be attached to the any handler recieiving API calls. The decorator will automatically map exceptions to appriorate response types:

Exception Response
pynamodb.exceptions.DoesNotExist 404 - Not Found
bails_lambda_utils.errors.PermissionError 403 - Forbidden
bails_lambda_utils.errors.RequiredParamException 400 - Specifying which param is missing
Exception 500 - With reference to aws_request_id

Example:

from bails_lambda_utils.handler import lambda_handler
from bails_lambda_utils.responses import Response

@lambda_handler
def get(event, context={}):
    #... some logic
    return Response(status_code=200, message="ok").to_dict()

Responses + Encoders

Docs coming soon

Misc Utils

Docs coming soon

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

bails_lambda_utils-0.3.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file bails_lambda_utils-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bails_lambda_utils-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 596bd967df6852fe630775ec1a66750b5a43782f9c96c842f4b5675176d16e19
MD5 597c9e6256dc4143bdf0f9eb093d4e40
BLAKE2b-256 3b0393cb830b172b5b94664d831e006b49ac37517976bfc85ce1c844f9e6246e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page