All Projects → erdewit → eventkit

erdewit / eventkit

Licence: BSD-2-Clause license
Event-driven data pipelines

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to eventkit

rule-engine
基于流程,事件驱动,可拓展,响应式,轻量级的规则引擎。
Stars: ✭ 165 (+75.53%)
Mutual labels:  data-flow, event-driven
Dffml
The easiest way to use Machine Learning. Mix and match underlying ML libraries and data set sources. Generate new datasets or modify existing ones with ease.
Stars: ✭ 123 (+30.85%)
Mutual labels:  data-flow, asyncio
Datakit
Connect processes into powerful data pipelines with a simple git-like filesystem interface
Stars: ✭ 951 (+911.7%)
Mutual labels:  pipeline, data-flow
InterReact
Interactive Brokers reactive C# API.
Stars: ✭ 28 (-70.21%)
Mutual labels:  rx
trellio
Python3 asyncio based microframework for microservice architecture
Stars: ✭ 19 (-79.79%)
Mutual labels:  asyncio
event-driven-example
An example Event-Driven application in Go built with Watermill library.
Stars: ✭ 81 (-13.83%)
Mutual labels:  event-driven
async retrial
Python package for retrial of asyncio based coroutines
Stars: ✭ 14 (-85.11%)
Mutual labels:  asyncio
rx-reason
Reactive programming library for ReasonML/OCaml
Stars: ✭ 49 (-47.87%)
Mutual labels:  rx
templating-engine-plugin
create tool-agnostic, templated pipelines to be shared by multiple teams
Stars: ✭ 138 (+46.81%)
Mutual labels:  pipeline
kingdom-python-server
Modular, cohesive, transparent and fast web server template
Stars: ✭ 20 (-78.72%)
Mutual labels:  event-driven
aiotinydb
asyncio compatibility shim for tinydb
Stars: ✭ 42 (-55.32%)
Mutual labels:  asyncio
reskit
A library for creating and curating reproducible pipelines for scientific and industrial machine learning
Stars: ✭ 27 (-71.28%)
Mutual labels:  pipeline
qp-arduino
QP real-time embedded frameworks/RTOS for Arduino (AVR and SAM)
Stars: ✭ 37 (-60.64%)
Mutual labels:  event-driven
aioneo4j
asyncio client for neo4j
Stars: ✭ 29 (-69.15%)
Mutual labels:  asyncio
antirobot aiogram
Телеграм бот для блокировки спама
Stars: ✭ 26 (-72.34%)
Mutual labels:  asyncio
multibranch-action-triggers-plugin
MultiBranch Actions Trigger Plugin
Stars: ✭ 29 (-69.15%)
Mutual labels:  pipeline
discord-hero
A powerful, modular and easy-to-use Discord bot framework. Batteries included!
Stars: ✭ 30 (-68.09%)
Mutual labels:  asyncio
yutto
🧊 一个可爱且任性的 B 站视频下载器(bilili V2)
Stars: ✭ 383 (+307.45%)
Mutual labels:  asyncio
knxmap
KNXnet/IP scanning and auditing tool for KNX home automation installations.
Stars: ✭ 97 (+3.19%)
Mutual labels:  asyncio
RxPagination
Implement pagination in just few lines with RxPagination
Stars: ✭ 20 (-78.72%)
Mutual labels:  rx

Build PyPi Documentation

Introduction

The primary use cases of eventkit are

  • to send events between loosely coupled components;
  • to compose all kinds of event-driven data pipelines.

The interface is kept as Pythonic as possible, with familiar names from Python and its libraries where possible. For scheduling asyncio is used and there is seamless integration with it.

See the examples and the introduction notebook to get a true feel for the possibilities.

Installation

pip3 install eventkit

Python version 3.6 or higher is required.

Examples

Create an event and connect two listeners

import eventkit as ev

def f(a, b):
    print(a * b)

def g(a, b):
    print(a / b)

event = ev.Event()
event += f
event += g
event.emit(10, 5)

Create a simple pipeline

import eventkit as ev

event = (
    ev.Sequence('abcde')
    .map(str.upper)
    .enumerate()
)

print(event.run())  # in Jupyter: await event.list()

Output:

[(0, 'A'), (1, 'B'), (2, 'C'), (3, 'D'), (4, 'E')]

Create a pipeline to get a running average and standard deviation

import random
import eventkit as ev

source = ev.Range(1000).map(lambda i: random.gauss(0, 1))

event = source.array(500)[ev.ArrayMean, ev.ArrayStd].zip()

print(event.last().run())  # in Jupyter: await event.last()

Output:

[(0.00790957852672618, 1.0345673260655333)]

Combine async iterators together

import asyncio
import eventkit as ev

async def ait(r):
    for i in r:
        await asyncio.sleep(0.1)
        yield i

async def main():
    async for t in ev.Zip(ait('XYZ'), ait('123')):
        print(t)

asyncio.get_event_loop().run_until_complete(main())  # in Jupyter: await main()

Output:

('X', '1')
('Y', '2')
('Z', '3')

Real-time video analysis pipeline

self.video = VideoStream(conf.CAM_ID)
scene = self.video | FaceTracker | SceneAnalyzer
lastScene = scene.aiter(skip_to_last=True)
async for frame, persons in lastScene:
    ...

Full source code

Distributed computing

The distex library provides a poolmap extension method to put multiple cores or machines to use:

from distex import Pool
import eventkit as ev
import bz2

pool = Pool()
# await pool  # un-comment in Jupyter
data = [b'A' * 1000000] * 1000

pipe = ev.Sequence(data).poolmap(pool, bz2.compress).map(len).mean().last()

print(pipe.run())  # in Jupyter: print(await pipe)
pool.shutdown()

Inspired by:

Documentation

The complete API documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].