lambda_router: Python Helpers for AWS Lambdas
lambda_router is a Python package that provides a few helpers for writing Python-based AWS Lambda functions.
Its main goal is to reduce the boilerplate code when writing lambda functions that need to handle multiple routes.
Getting Started
Install with:
$ pip install lambda_router
Creating a basic, single-route app:
import lambda_router
config = lambda_router.Config()
# Load all environment variables prefix with JSR_.
config.load_from_environment(prefix="JSR_")
app = lambda_router.App(name="example_lambda", config=config)
app.route()
def main(event):
# This is the main route of your lambda
return {"message": "success"}
Or a multi-route app that uses the type field in the lambda event for routing:
import lambda_router
config = lambda_router.Config()
# Load all environment variables prefix with JSR_.
config.load_from_environment(prefix="JSR_")
app = lambda_router.App(name="example_lambda", config=config, route=lambda_router.routers.EventField(key="type"))
app.route("route_one")
def main(event):
return {"message": "success from route_one"}
app.route("route_two")
def main(event):
return {"message": "success from route_two"}
Contributing
Use poetry to install the dev requirements:
$ poetry install
Install the git pre-commit hooks:
$ poetry run pre-commit install
Metadata
Release files for lambda-router 2021.3.1
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 |
|---|---|---|---|---|
| lambda_router-2021.3.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for lambda_router-2021.3.1-py2.py3-none-any.whl |
Release files / lambda_router-2021.3.1-py2.py3-none-any.whl
| Download URL | lambda_router-2021.3.1-py2.py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e201c0c24a7e46377cf098c9a48640df1ff7d2c5eee7b011df8d494103477649
|
|
BLAKE2b-256 checksum How to use checksums |
d3940c2b0b92b6bfea702a0d6dba9ed2fe9ece1b910971a8a883b9ae442a2221
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.0
|
Security for lambda-router 2021.3.1
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.