Pypubsub
Python Publish-Subscribe Package
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 pypubsubuv
uv add pypubsubpoetry
poetry add pypubsubInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
EventsProvides a publish-subscribe event system where…
permissive · top 1,000 on PyPI
pubnubPubNub Python SDK provides real-time…
unclear · top 15,000 on PyPI
blinkerBlinker provides a lightweight event…
permissive · top 1,000 on PyPI
solace-pubsubplusSolace Messaging API for Python provides client…
permissive · top 15,000 on PyPI
psygnalPsygnal implements the observer pattern with a…
permissive · top 5,000 on PyPI
azure-messaging-webpubsubserviceManages WebSocket connections and real-time…
permissive · top 15,000 on PyPI
google-cloud-pubsubPython client library for Google Cloud Pub/Sub,…
permissive · top 1,000 on PyPI
azure-servicebusAzure Service Bus client library for Python…
unclear · top 1,000 on PyPI
azure-eventhubPublishes and consumes events from Azure Event…
unclear · top 5,000 on PyPI
wslinkwslink provides bi-directional websocket…
permissive · top 5,000 on PyPI