Skip to main content

Pythonic event-processing library based on decorators

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

event-processor-3.1.5.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

event_processor-3.1.5-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file event-processor-3.1.5.tar.gz.

File metadata

  • Download URL: event-processor-3.1.5.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for event-processor-3.1.5.tar.gz
Algorithm Hash digest
SHA256 3fa58531655067ab6f7b28e77f5056edfec96dab8835b4d35ca8f0617461a149
MD5 e83d1574152e96aa6edb816760fd4222
BLAKE2b-256 0b6f76d773e4b8873fa6cafb86e7c5b72fdb28da032284a9f3d17f86b086b6fd

See more details on using hashes here.

File details

Details for the file event_processor-3.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for event_processor-3.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 acdbf5d0537ef043a3a7bae0c88e57d9e9a254b0522b36495ede072063c2f77d
MD5 f444c0ea6979f64822904d43b31e0d25
BLAKE2b-256 da556653f1c732eca4420bb3f36d12501bebf78ed894a1b8ecd70011429ba1ad

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page