Event-driven Data Pipelines

1.0.3 · active · verified Thu Apr 16

Eventkit is a Python library designed for creating event-driven data pipelines and enabling communication between loosely coupled components. It leverages Python's `asyncio` for seamless integration with asynchronous programming patterns. The library's interface is kept Pythonic, using familiar names and idioms. The current version is 1.0.3, with releases tied to development cycles rather than a fixed cadence, though updates appear infrequent based on PyPI history.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the core functionality of `eventkit`: creating an event, connecting multiple listeners to it, and emitting values. It also shows a basic synchronous data pipeline using `Sequence`, `map`, and `enumerate` operators.

import eventkit as ev

def my_listener1(value):
    print(f"Listener 1 received: {value}")

def my_listener2(value):
    print(f"Listener 2 processed: {value * 2}")

# Create an event
my_event = ev.Event()

# Connect listeners to the event
my_event += my_listener1
my_event += my_listener2

# Emit a value, triggering all connected listeners
my_event.emit(5)
my_event.emit(10)

# You can also use method chaining for pipelines
pipeline_event = (
    ev.Sequence([1, 2, 3])
    .map(lambda x: x * 10)
    .enumerate()
)

# Run a synchronous pipeline
print("Pipeline output:", pipeline_event.run())

view raw JSON →