["python","events","event-handling","dispatcher"]
Which Python packages offer a stand-alone event system?

I am aware of pydispatcher, but there must be other event-related packages around for Python. Which libraries are available? I'm not interested in event managers that are part of large frameworks, I'd rather use a small bare-bones solution that I can easily extend.
PyPI packages As of February 2025, these are the event-related packages available on PyPI, ordered by most recent release date. psygnal 0.12.0: February 2024 pymitter 1.0.0: January 2025 blinker 1.9.0: November 2024 pluggy 1.5.0: April 2024 Louie 2.0.1: July 2023 Events 0.5: July 2023 2020 zope.event 5.0: June 2023 PyDispatcher 2.0.7: February 2023 python-dispatch 0.2.2: Jun 2023 python-dispatch 0.2.2: Jun 2023 RxPy3 1.0.1: June 2020 PyPubSub 4.0.3: Jan 2019 pyeventdispatcher 0.2.3a0: 2018 buslane 0.0.5: 2018 PyPyDispatcher 2.1.2: 2017 axel 0.0.7: 2016 dispatcher 1.0: 2012 py-notify 0.3.1: 2008 There's more That's a lot of libraries to choose from, using very different terminology (events, signals, handlers, method dispatch, hooks, ...). I'm trying to keep an overview of the above packages, plus the techniques mentioned in the answers here. First, some terminology... Observer pattern The most basic style of event system is the 'bag of handler methods', which is a simple implementation of the Observer pattern. Basically, the handler methods (callables) are stored in an array and are each called when the event 'fires'. Publish-Subscribe The disadvantage of Observer event systems is that you can only register the handlers on the actual Event object (or handlers list). So at registration time the event already needs to exist. That's why the second style of event systems exists: the publish-subscribe pattern. Here, the handlers don't register on an event object (or handler list), but on a central dispatcher. Also the notifiers only talk to the dispatcher. What to listen for, or what to publish is determined by 'signal', which is nothing more than a name (string). Mediator pattern Might be of interest as well: the Mediator pattern. Hooks A 'hook' system is usally used in the context of application plugins. The application contains fixed integration points (hooks), and each plugin may connect to that hook and perform certain actions. Other 'events' Note: threading.Event is not an 'event system' in the above sense. It's a thread synchronization system where one thread waits until another thread 'signals' the Event object. Network messaging libraries often use the term 'events' too; sometimes these are similar in concept; sometimes not. They can of course traverse thread-, process- and computer boundaries. See e.g. pyzmq, pymq, Twisted, Tornado, gevent, eventlet. Weak references In Python, holding a reference to a method or object ensures that it won't get deleted by the garbage collector. This can be desirable, but it can also lead to memory leaks: the linked handlers are never cleaned up. Some event systems use weak references instead of regular ones to solve this. Some words about the various libraries Observer-style event systems: psygnal has a very clean interface with connect() and emit() methods. zope.event shows the bare bones of how this works (see Lennart's answer). Note: this example does not even support handler arguments. LongPoke's 'callable list' implementation shows that such an event system can be implemented very minimalistically by subclassing list. Felk's variation EventHook also ensures the signatures of callees and callers. spassig's EventHook (Michael Foord's Event Pattern) is a straightforward implementation. Josip's Valued Lessons Event class is basically the same, but uses a set instead of a list to store the bag, and implements __call__ which are both reasonable additions. PyNotify is similar in concept and also provides additional concepts of variables and conditions ('variable changed event'). Homepage is not functional. axel is basically a bag-of-handlers with more features related to threading, error handling, ... python-dispatch requires the even source classes to derive from pydispatch.Dispatcher. buslane is class-based, supports single- or multiple handlers and facilitates extensive type hints. Pithikos' Observer/Event is a lightweight design. Publish-subscribe libraries: blinker has some nifty features such as automatic disconnection and filtering based on sender. PyPubSub is a stable package, and promises "advanced features that facilitate debugging and maintaining topics and messages". pymitter is a Python port of Node.js EventEmitter2 and offers namespaces, wildcards and TTL. PyDispatcher seems to emphasize flexibility with regards to many-to-many publication etc. Supports weak references. louie is a reworked PyDispatcher and should work "in a wide variety of contexts". pypydispatcher is based on (you guessed it...) PyDispatcher and also works in PyPy. django.dispatch is a rewritten PyDispatcher "with a more limited interface, but higher performance". pyeventdispatcher is based on PHP's Symfony framework's event-dispatcher. dispatcher was extracted from django.dispatch but is getting fairly old. Cristian Garcia's EventManger is a really short implementation. Others: pluggy contains a hook system which is used by pytest plugins. RxPy3 implements the Observable pattern and allows merging events, retry etc. Qt's Signals and Slots are available from PyQt or PySide2. They work as callback when used in the same thread, or as events (using an event loop) between two different threads. Signals and Slots have the limitation that they only work in objects of classes that derive from QObject.