skip to navigation
skip to content

PyPubSub 3.0a5

Python Publish-Subscribe Module

Latest Version: 3.0.1a2

Pypubsub provides a simple way for your Python application to decouple its components: parts of your application can publish messages (with or without data) and other parts can subscribe/receive them. This allows message "senders" and message "listeners" to be unaware of each other, such that a sender doesn't need to care if any listener will be receiving the message, and similarly, listeners don't need to worry about where messages come from. Message sending and receiving are synchronous (the send ends when the receiving has completed). This is a great tool for implementing a Model-View-Controller architecture or any similar architecture that promotes decoupling of its components.

This pubsub package contains 3 versions of pubsub:

  • pubsub1: hasn't changed from when it was in wxPython (in wx.lib), it is drop-in replacement for wx.lib.pubsub (2.6 - 2.8.x). It is very handy for small applications with few topic types.
  • pubsub2: an "experimental" style messaging based on classes. This didn't provide the expected benefits, such as the ability to use tools like pychecker to check validity of topics. This version will not be maintained.
  • pubsub3: more rigorous handling of topics and message data, making debugging pubsub-based applications easier (especially critical for large applications with many topics). This is still alpha, eventhough there is an extensive test suite (see the test_*.py files). The user docs are not ready yet, though the API is well documented, and example of use can be found in the docs folder in source distribution.

Which version to use in your application can be changed from default (3) via the pubsubconf module installed along pubsub.

See the Pypubsub website (http://pubsub.wiki.sourceforge.net/) for further details. Download area is at http://sourceforge.net/project/showfiles.php?group_id=197063.

Notes:

  • The next release of wxPython should contain PyPubSub. The default will likely be for it to use version 1.
  • This project is different from the PyPubSub project hosted on SourceForge.net, which provides publish/subscribe over a network (it is unfortunate that the author of www.sf.net/projects/pypubsub refused to use a name that wasn't already in use in the PyPI, very un-open-source!).

Log in to rate this package.