Code Monkey home page Code Monkey logo

aws-lambda-typing's Introduction

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 (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

Requests

  • SNSPublish
  • SNSPublishBatch

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 src 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.

aws-lambda-typing's People

Contributors

chuckwondo avatar curekoshimizu avatar jtetrault avatar mousazeidbaker avatar niumxp avatar tekdj7 avatar tenzer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.