A package that provides type hints for AWS Lambda event, context and response objects
Project description
AWS Lambda Typing
A package that provides type hints for AWS Lambda event, context and response objects. It's a convenient way to get autocomplete and type hints built into IDEs. Type annotations are not checked at runtime but are only enforced by third party tools such as type checkers, IDEs, linters, etc.
Table of Contents
Usage
Example: AWS SQS event
from aws_lambda_typing import context as context_, events
def handler(event: events.SQSEvent, context: context_.Context) -> None:
for record in event['Records']:
print(record['body'])
print(context.get_remaining_time_in_millis())
message: events.sqs.SQSMessage
Demo
IDE autocomplete
IDE code reference information
Types
Context
- Context
Events
- APIGatewayRequestAuthorizerEvent
- APIGatewayTokenAuthorizerEvent
- APIGatewayProxyEventV1
- APIGatewayProxyEventV2
- CloudWatchEventsMessageEvent
- CloudWatchLogsEvent
- CodeCommitMessageEvent
- CodePipelineEvent
- ConfigEvent
- DynamoDBStreamEvent
- KinesisFirehoseEvent
- KinesisStreamEvent
- MQEvent
- S3Event
- S3BatchEvent
- SESEvent
- SNSEvent
- SQSEvent
Responses
- APIGatewayProxyResponseV1
- APIGatewayProxyResponseV2
- S3BatchResponse
Develop
Activate virtual environment
poetry shell
Install dependencies
poetry install --remove-untracked
Install git hooks
pre-commit install --hook-type pre-commit
Run tests
mypy tests
Run linter
flake8 .
Format code
black .
Sort imports
isort .
Contributing
Contributions are welcome via pull requests.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aws-lambda-typing-2.2.1.tar.gz
(12.8 kB
view hashes)
Built Distribution
Close
Hashes for aws_lambda_typing-2.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d7bf8e9dede00363344dda87a7befc9c1e18c6856e953ac9ba5ab54bb5879bb |
|
MD5 | 27dd43a550b84a90c45de3c24220518c |
|
BLAKE2b-256 | f88f704085fb43c5db68ff9f1786a521334a150eaefad8d53558771bef5a0e6a |