Welcome to aws_lambda_event Documentation
This library provides Python Class interface, attribute auto-complete, type hint for AWS Lambda Events. It can parse the AWS Lambda event data, and also generate fake event data for testing.
Example:
# An example lambda handler python module
import aws_lambda_event
# parse S3 Put event, convert it into a python object with type hint, auto complete
def handler(event, context):
event_obj = aws_lambda_event.S3PutEvent.from_dict(event)
for record in event_obj.Records:
# access attribute
_ = record.eventTime
# important attributes quick access alias
_ = record.bucket
_ = record.key
_ = record.etag
_ = record.size
...
# generate an fake event for testing
event_obj = aws_lambda_event.S3PutEvent.fake(bucket="my-bucket", key="my-file.txt")
...
List of Supported Event:
CloudWatchLogsEvent
CloudWatchScheduledEvent
S3PutEvent
S3DeleteEvent
SNSTopicNotificationEvent
SQSEvent
DynamodbUpdateEvent
KinesisStreamEvent
KinesisFirehoseEvent
You can find the event JSON schema in two place:
AWS Lambda Event Source Mapping Official Document: https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html
Goto AWS Lambda Function Console -> Create Test Event -> Choose from Event template
Install
aws_lambda_event is released on PyPI, so all you need is:
$ pip install aws_lambda_event
To upgrade to latest version:
$ pip install --upgrade aws_lambda_event
Metadata
Release files for aws-lambda-event 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aws_lambda_event-2.0.2.tar.gz | 24.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aws_lambda_event-2.0.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 61.0 kB
Release files / aws_lambda_event-2.0.2.tar.gz
| Download URL | aws_lambda_event-2.0.2.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a72c88cd975e5d8a25ea0540f477aedf4f60a652f6fafe2831008aa19628a40
|
|
BLAKE2b-256 checksum How to use checksums |
02d4fd45c97a7ef0b1a8f896bb1b09e0c8d1e38d739f2a2446bc90aeaee974f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11
|
Release files / aws_lambda_event-2.0.2-py2.py3-none-any.whl
| Download URL | aws_lambda_event-2.0.2-py2.py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
30f2da7d03f4bb70ffab9f33082864bb9e833f0693a350066c83008eea2573a6
|
|
BLAKE2b-256 checksum How to use checksums |
39e55cbe1a236612cd5ea2f37b64a178b290a295d5cfcb61d27c6dcd41b9bd6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11
|