Skip to main content

Process Events In Style

build coverage code-size docs

This library aims to simplify the common pattern of event processing. It simplifies the process of filtering, dispatching and pre-processing events as well as injecting dependencies in event processors.

The only requirement is that your events are regular python dictionaries.

Take a look at the following examples to get an overview of the features available! Of course, you can mix and combine them in any way you like to create more complex scenarios.

from event_processor import EventProcessor, Event
from event_processor.filters import Eq


event_processor = EventProcessor()


@event_processor.processor(Eq("service.type", "service_a"))
def process_service_a(event: Event):
    return event["service"]["status"] == "up"

@event_processor.processor(Eq("service.type", "service_b"))
def process_service_b(event: Event):
    return event["authorized"]

service_a_event = {
    "service": {
        "type": "service_a",
        "status": "down"
    }
}
service_b_event = {
    "service": {
        "type": "service_b",
        "authorized": False
    }
}
event_processor.invoke(service_a_event)  # False
event_processor.invoke(service_b_event)  # False

Documentation

Find the full documentation on Read the Docs.

Metadata

Release files for event-processor 3.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for event-processor 3.2.1
File Size Uploaded
event-processor-3.2.1.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for event-processor 3.2.1
File Interpreter ABI Platform
event_processor-3.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 45.1 kB

Release files / event-processor-3.2.1.tar.gz

Download URL event-processor-3.2.1.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
be987cb2cd18a0a3eb0a5f5be799b624418aa99168c7c07b834abba9e719f941
BLAKE2b-256 checksum
How to use checksums
58bc0c76a5f7cb23572f8982d62704a42609f504e0e47578aa1f06f24f7d0a04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / event_processor-3.2.1-py3-none-any.whl

Download URL event_processor-3.2.1-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4974b41d7b032d8b8eb43dee3eb882b1abec4d53559a26d5f061c91419d55e18
BLAKE2b-256 checksum
How to use checksums
70d8637bccad2489112f0b3e4486fd7624ecf97bb5c989034abcbe2bd7876c42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

3.2.1 This release

2 release files

3.2.0

2 release files

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page