skillfed

Pypubsub

Python Publish-Subscribe Package

pypubsub v4.0.7 324.0K downloads/30d#7,599 on PyPI212
Permissive license BSD-2-Clause Active released

What it is and what it does

Pypubsub is a pure-Python publish-subscribe library that implements event-driven messaging within a single process. It centers on the concept of topics: publishers send messages to named topics, and subscribers register listeners to receive those messages. The package works on Python 3.7 through 3.14 and has no external runtime dependencies, making it lightweight and easy to integrate into desktop or server applications.

The library is designed for applications that need decoupled, event-based communication between components running in the same process. It supports advanced features for debugging and managing topics and messages in larger applications, though the core use case is straightforward topic-based message dispatch where senders and receivers don't need to know about each other directly.

Use it for:

  • Build event-driven GUI applications where UI components emit and listen to application state changes without tight coupling.
  • Implement observer patterns in server applications where different modules need to react to the same business events.
  • Create plugin architectures where plugins can subscribe to and emit events without direct dependencies on each other.
  • Decouple data model updates from view updates in desktop applications using topic-based notifications.
  • Coordinate multi-step workflows where each step publishes completion events that trigger downstream actions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a publish-subscribe messaging system for event-driven architecture within a single Python process, where publishers send messages to named topics and subscribers receive them.

Yes. Pypubsub is a stable, actively maintained library with no dependencies, permissive licensing, and broad Python version support. It solves a clear problem—decoupled in-process messaging—with a simple, proven API. Choose it if you need event-driven architecture within a single process and want to avoid the complexity of external message brokers.

Install

pypubsub on PyPI

pip

pip install pypubsub

uv

uv add pypubsub

poetry

poetry add pypubsub

Installing Pypubsub

Before you install

Low friction: pure Python with no runtime dependencies, distributed as a wheel, and actively maintained with a recent release in December 2025.

License in practice

BSD-2-Clause is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you retain the license notice.

Quickstart

pip install pypubsub

import pypubsub

# Subscribe a listener to a topic, then send a message to it

Requires Python 3.7 or later.

Verify before relying

  • Specific API methods and call signatures for subscribing listeners and sending messages.
  • Whether the package supports thread-safe or async message delivery patterns beyond basic synchronous dispatch.
  • Performance characteristics when handling high message volume or deeply nested topic hierarchies.

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 249 days since the last release
Last repo commit
First released
Downloads 324,044/month — #7,599 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pypubsub-4.0.7-py3-none-any.whl

Keywords: publish, subscribe, observer, signal, signals, event, events, message, messages, messaging, dispatch, dispatching

Natural Language :: EnglishProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python Modules

Tags

publish subscribe messagingevent-driven architecture pythonobserver pattern implementationtopic-based message dispatchin-process event systemsignal and event handlingmessage broker single process
event-drivenmessagingobserver-pattern

More Python Modules packages