Metadata-Version: 2.1
Name: aws-lambda-typing
Version: 2.9.4
Summary: A package that provides type hints for AWS Lambda event, context and response objects
Home-page: https://github.com/MousaZeidBaker/aws-lambda-typing
License: MIT
Keywords: typing,type hints,aws,lambda,serverless,development
Author: Mousa Zeid Baker
Requires-Python: >=3.6,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: typing-extensions (>=4.0.1,<5.0.0); python_version < "3.8"
Project-URL: Repository, https://github.com/MousaZeidBaker/aws-lambda-typing
Description-Content-Type: text/markdown

# AWS Lambda Typing

![build](https://github.com/MousaZeidBaker/aws-lambda-typing/workflows/Publish/badge.svg)
![test](https://github.com/MousaZeidBaker/aws-lambda-typing/workflows/Test/badge.svg)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
![python_version](https://img.shields.io/badge/python-%3E=3.6-blue.svg)
[![pypi_v](https://img.shields.io/pypi/v/aws-lambda-typing.svg)](https://pypi.org/project/aws-lambda-typing)
[![pypi_dm](https://img.shields.io/pypi/dm/aws-lambda-typing.svg)](https://pypi.org/project/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](#usage)
- [Demo](#demo)
- [Types](#types)
  - [Context](#context)
  - [Events](#events)
  - [Responses](#responses)
- [Test](#test)
- [Contributing](#contributing)
- [Issues](#issues)

## Usage
### Example: AWS SQS event

```python
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](https://raw.githubusercontent.com/MousaZeidBaker/aws-lambda-typing/master/media/ide_autocomplete.gif)

### IDE code reference information
![code_reference_information](https://raw.githubusercontent.com/MousaZeidBaker/aws-lambda-typing/master/media/code_reference_information.gif)

## 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
```shell
poetry shell
```

Install dependencies
```shell
poetry install --remove-untracked
```

Install git hooks
```shell
pre-commit install --hook-type pre-commit
```

Run tests
```shell
mypy tests
```

Run linter
```shell
flake8 .
```

Format code
```shell
black .
```

Sort imports
```shell
isort .
```

## Contributing
Contributions are welcome via pull requests.

## Issues
If you encounter any problems, please file an
[issue](https://github.com/MousaZeidBaker/aws-lambda-typing/issues) along with a
detailed description.

