Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tuananh/py-event-ruler

Test EventBridge pattern locally with Python
https://github.com/tuananh/py-event-ruler

Last synced: 12 days ago
JSON representation

Test EventBridge pattern locally with Python

Awesome Lists containing this project

README

        

py-event-ruler
--------------

[![PyPI version](https://badge.fury.io/py/event-ruler.svg)](https://badge.fury.io/py/event-ruler)

## Origin

I love EventBridge and their pattern matching.

The AWS SDK has an [API for testing event pattern](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_TestEventPattern.html) with EventBridge sandbox. The problem is that you have to initialize AWS SDK client and make an API call for each test.

In my case, I want to do lots of pattern matching test without being afraid of hitting API rate limit from AWS.

AWS also releases an [open-source version of this pattern matching library in Java](https://github.com/aws/event-ruler) but in my case, I want to use Python because that's what my teammates are familiar with.

## Install

```sh
pip install event-ruler
```

## Usage

```python
>>> import event_ruler
>>> event_ruler.test_event_pattern('{"foo":true}', '{"foo":[true]}')
True
```

## License

[MIT](./LICENSE)