Note
This site is specific to PyPubSub v3.1.2 and prior. The up-to-date site is always at pubsub.sf.net.
The Python Pubsub package provides a publish - subscribe API that allows data to be sent between different parts of your application. In many cases, using publish - subscribe in your application will dramatically simplify its design and improve testability. Robin Dunn, the creator of wxPython, summerizes Pubsub nicely:
Basically you just have some part(s) of your program subscribe to a particular topic and have some other part(s) of your program publish messages with that topic. All the plumbing is taken care of by pubsub. – Robin Dunn, Jun 2007
The Publish - Subscribe pattern has the following capability:
A listener is “a part of the application that wants to receive messages”. A listener subscribes to one or more topics. A sender is any part of the application that asks Pubsub to send a message of a given topic. The sender provides data, if any. Pubsub will send the message, including any data, to all listeners of the message’s topic.
Schematically:
Please consider contributing to this project! More details in the Contributing section.