pyeventsystem
raw JSON → 0.1.0 verified Mon Apr 27 auth: no python
An event-driven middleware library for Python. Version 0.1.0 is the initial release; it enables defining event handlers and middleware pipelines. Development appears early stage with no recent updates.
pip install pyeventsystem Common errors
error ModuleNotFoundError: No module named 'pyeventsystem' ↓
cause Package not installed or installed in wrong environment.
fix
Run 'pip install pyeventsystem' in the correct Python environment.
error ImportError: cannot import name 'EventSystem' from 'pyeventsystem' ↓
cause The API may not match the expected import; check the exact exported names.
fix
Use 'from pyeventsystem import *' or examine the module's __init__.py for correct symbols.
Warnings
gotcha Library is very early stage (v0.1.0). API is unstable and likely to change. Do not rely on it for production without careful version pinning. ↓
fix Pin exact version in requirements.txt and test thoroughly before upgrading.
gotcha The decorator '@event_handler' is not explicitly documented; may not exist or may be called differently. The README shows minimal examples. ↓
fix Check the source code or README for the correct decorator name (likely 'app.handler' or similar).
gotcha No documentation for middleware ordering or priority. Middleware execution order may be undefined. ↓
fix Review source code or test middleware behavior manually.
Imports
- EventSystem
from pyeventsystem import EventSystem - Event
from pyeventsystem import Event - middleware
from pyeventsystem import middleware
Quickstart
from pyeventsystem import EventSystem, Event
app = EventSystem()
@app.middleware('before')
def logging_middleware(event):
print(f'Before event: {event.name}')
@event_handler
def my_handler(event):
print(f'Handling {event.name}')
app.emit(Event('test'))