MousaZeidBaker / aws-lambda-typing

Python type hints for AWS Lambda
MIT License
106 stars 19 forks source link

AWS Lambda Typing

build test License python_version pypi_v pypi_dm

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_autocomplete

IDE code reference information

code_reference_information

Types

Context

Events

Requests

Responses

Other

Contributing

Contributions are welcome! See the Contributing Guide.

Issues

If you encounter any problems, please file an issue along with a detailed description.