Skip to main content

A package that provides type hints for AWS Lambda event, context and response objects

Project description

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

  • Context

Events

  • ALBEvent
  • APIGatewayRequestAuthorizerEvent
  • APIGatewayTokenAuthorizerEvent
  • APIGatewayProxyEventV1
  • APIGatewayProxyEventV2
  • AppSyncResolverEvent
  • CloudFormationCustomResourceEvent
  • CloudWatchEventsMessageEvent
  • CloudWatchLogsEvent
  • CodeCommitMessageEvent
  • CodePipelineEvent
  • ConfigEvent
  • DynamoDBStreamEvent
  • IoTPreProvisioningHookEvent
  • KinesisFirehoseEvent
  • KinesisStreamEvent
  • MQEvent
  • MSKEvent
  • S3Event
  • S3BatchEvent
  • SecretsManagerRotationEvent
  • SESEvent
  • SNSEvent
  • SQSEvent

Responses

  • ALBResponse
  • APIGatewayAuthorizerResponse
  • APIGatewayProxyResponseV1
  • APIGatewayProxyResponseV2
  • IoTPreProvisioningHookResponse
  • S3BatchResponse

Other

  • PolicyDocument

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


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.9.6.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_lambda_typing-2.9.6-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file aws-lambda-typing-2.9.6.tar.gz.

File metadata

  • Download URL: aws-lambda-typing-2.9.6.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.12 Linux/5.11.0-1025-azure

File hashes

Hashes for aws-lambda-typing-2.9.6.tar.gz
Algorithm Hash digest
SHA256 d9562d5334630600fa3ba96561e7833ad36e6fe15eadb1cf22d559973cd5ce91
MD5 529010490848b429403d4bd7ebed7bb3
BLAKE2b-256 cdf6e684ce1d821e50b5398f03c814b52dd0c59dc2136d81afb928af5819d1f1

See more details on using hashes here.

File details

Details for the file aws_lambda_typing-2.9.6-py3-none-any.whl.

File metadata

  • Download URL: aws_lambda_typing-2.9.6-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.12 Linux/5.11.0-1025-azure

File hashes

Hashes for aws_lambda_typing-2.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8c5a8b79a21182faaddee5fc5af7061e7c66a8edf9ebfc114551ea6aa34f6a
MD5 b172188f270f16e9a11cd1af1cd9d958
BLAKE2b-256 64d65222306c08ec068a4df7608dd45fe7c82a0e5ddd90dab2e72368d27df6c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page