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.
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
- Context
- ALBEvent
- APIGatewayRequestAuthorizerEvent
- APIGatewayTokenAuthorizerEvent
- APIGatewayProxyEventV1
- APIGatewayProxyEventV2
- AppSyncResolverEvent
- CloudFormationCustomResourceEvent
- CloudWatchEventsMessageEvent (Deprecated since version 2.10.0: use
EventBridgeEvent
instead.) - CloudWatchLogsEvent
- CodeCommitMessageEvent
- CodePipelineEvent
- CognitoCustomMessageEvent
- ConfigEvent
- DynamoDBStreamEvent
- EventBridgeEvent
- IoTPreProvisioningHookEvent
- KinesisFirehoseEvent
- KinesisStreamEvent
- MQEvent
- MSKEvent
- S3Event
- S3BatchEvent
- SecretsManagerRotationEvent
- SESEvent
- SNSEvent
- SQSEvent
- SNSPublish
- SNSPublishBatch
- ALBResponse
- APIGatewayAuthorizerResponse
- APIGatewayProxyResponseV1
- APIGatewayProxyResponseV2
- IoTPreProvisioningHookResponse
- S3BatchResponse
- PolicyDocument
Activate virtual environment
poetry shell
Install dependencies
poetry install --remove-untracked
Install git hooks
pre-commit install --hook-type pre-commit
Run tests
mypy src tests
Run linter
flake8 .
Format code
black .
Sort imports
isort .
Contributions are welcome via pull requests.
If you encounter any problems, please file an issue along with a detailed description.