Whistleopen sourcestable

A dead simple event dispatcher for Python.

Whistle lets parts of a Python application talk to each other without knowing about one another. Code emits named events, listeners subscribe to them, and the dispatcher does the wiring in between. It handles both synchronous and asynchronous listeners, and keeps the two from being mixed by accident.

It is pure Python with no dependencies, small enough to read in one sitting. Maintained since 2015, on Python 3.10 and up.

Screenshots

Screenshot coming soon
Screenshot coming soon

Keyboard shortcuts

/Open search
CtrlKOpen search (Cmd+K on macOS)
?Show this cheat sheet
Ctrl/Show this cheat sheet (Cmd+/ on macOS)
EscClose search or this cheat sheet

Turns off the single-key shortcuts (/, ?). Ctrl/Cmd+K and Ctrl/Cmd+/ stay.