Bails Lambda Utils
For making lambda's easier
pip install bails-lambda-utils
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
Metadata
Release files for bails-lambda-utils 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bails_lambda_utils-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for bails_lambda_utils-0.3.0-py3-none-any.whl |
Release files / bails_lambda_utils-0.3.0-py3-none-any.whl
| Download URL | bails_lambda_utils-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
596bd967df6852fe630775ec1a66750b5a43782f9c96c842f4b5675176d16e19
|
|
BLAKE2b-256 checksum How to use checksums |
3b0393cb830b172b5b94664d831e006b49ac37517976bfc85ce1c844f9e6246e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.10
|
Security for bails-lambda-utils 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.