Metadata-Version: 2.4
Name: lambda-universal-router
Version: 0.2.4
Summary: A flexible AWS Lambda event router with support for multiple event sources
Home-page: https://github.com/raumildhandhukia/lambda-universal-router
Author: Raumil Dhandhukia
Author-email: raumild@gmail.com
Project-URL: Documentation, https://raumildhandhukia.github.io/lambda-universal-router/
Project-URL: Source, https://github.com/raumildhandhukia/lambda-universal-router
Project-URL: Changelog, https://raumildhandhukia.github.io/lambda-universal-router/changelog
Project-URL: Contributing, https://raumildhandhukia.github.io/lambda-universal-router/contributing
Project-URL: License, https://github.com/raumildhandhukia/lambda-universal-router/blob/main/LICENSE
Project-URL: Issue Tracker, https://github.com/raumildhandhukia/lambda-universal-router/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# Lambda Universal Router

[![PyPI version](https://badge.fury.io/py/lambda-universal-router.svg)](https://badge.fury.io/py/lambda-universal-router)
[![Python Support](https://img.shields.io/pypi/pyversions/lambda-universal-router.svg)](https://pypi.org/project/lambda-universal-router/)
[![License](https://img.shields.io/github/license/raumildhandhukia/lambda-universal-router.svg)](https://github.com/raumildhandhukia/lambda-universal-router/blob/main/LICENSE)
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://raumildhandhukia.github.io/lambda-universal-router/)

A flexible and type-safe router for AWS Lambda functions that supports multiple event sources. This library makes it easy to handle different types of AWS Lambda events in a clean and organized way.

## Documentation

📚 **[Full Documentation](https://raumildhandhukia.github.io/lambda-universal-router/)**

- [API Reference](https://raumildhandhukia.github.io/lambda-universal-router/api)
- [Examples](https://raumildhandhukia.github.io/lambda-universal-router/examples)
- [Event Types](https://raumildhandhukia.github.io/lambda-universal-router/#event-sources)
- [Contributing Guide](https://raumildhandhukia.github.io/lambda-universal-router/contributing)
- [Changelog](https://raumildhandhukia.github.io/lambda-universal-router/changelog)

## Features

- 🎯 Type-safe event handling with proper Python type hints
- 🔄 Support for multiple AWS event sources
- 🎨 Clean decorator-based routing
- 📦 Easy to extend with new event sources
- 🔒 Structured event objects with proper typing
- 🔍 Custom event handler support for unknown event types

## Installation

```bash
pip install lambda-universal-router
```

## Quick Start

```python
from lambda_universal_router import Router
from lambda_universal_router.events import APIGatewayEvent, SQSEvent, CustomEvent

router = Router()

@router.apigateway("/hello", method="GET")
def hello(event: APIGatewayEvent, context):
    name = event.query_string_parameters.get('name', 'World')
    return {
        "statusCode": 200,
        "body": f"Hello, {name}!"
    }

@router.sqs()
def process_queue(event: SQSEvent, context):
    for msg in event.records:
        print(f"Processing message {msg.message_id}: {msg.body}")

@router.custom()
def handle_unknown(event: CustomEvent, context):
    print(f"Handling unknown event type: {event.event_data}")

def lambda_handler(event, context):
    return router.dispatch(event, context)
```

## Supported Event Sources

- [API Gateway](https://raumildhandhukia.github.io/lambda-universal-router/events/api-gateway) (REST/HTTP APIs)
- [SQS](https://raumildhandhukia.github.io/lambda-universal-router/events/sqs) (Simple Queue Service)
- [S3](https://raumildhandhukia.github.io/lambda-universal-router/events/s3) (Object Storage)
- [DynamoDB Streams](https://raumildhandhukia.github.io/lambda-universal-router/events/dynamodb)
- [Kinesis Streams](https://raumildhandhukia.github.io/lambda-universal-router/events/kinesis)
- [SNS](https://raumildhandhukia.github.io/lambda-universal-router/events/sns) (Simple Notification Service)
- [EventBridge](https://raumildhandhukia.github.io/lambda-universal-router/events/eventbridge) (CloudWatch Events)
- [Custom Events](https://raumildhandhukia.github.io/lambda-universal-router/events/custom)

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

See our [Contributing Guide](https://raumildhandhukia.github.io/lambda-universal-router/contributing) for more details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a list of changes and version history.
