Skip to main content
https://badge.fury.io/py/Pypubsub.svg https://github.com/schollii/pypubsub/actions/workflows/ci.yml/badge.svg

News

  • December 2025: pypubsub 4.0.7 released! (update to latest packaging system, testing, docs).

  • … (has it really been this long since I cleaned this up?!)…

  • January 2019: pypubsub 4.0.3 released! (for those – and only those – who use Python >= 3).

  • March 2019: pypubsub 3.4.2 released (for those – and only those – who use Python 2.7.x).

Overview

Provides a publish-subscribe API to facilitate event-based or message-based architecture in a single-process application. It is pure Python and works on Python 3.7+ (tested through 3.14). It is centered on the notion of a topic; senders publish messages of a given topic, and listeners subscribe to messages of a given topic, all inside the same process. The package also supports a variety of advanced features that facilitate debugging and maintaining topics and messages in larger desktop- or server-based applications.

Install most recent stable with “pip install pypubsub”.

Useful links:

Contributing and testing

Install uv, then run the test matrix with tox (uses tox-uv under the hood):

uv tool install tox --with tox-uv
tox  # or: tox -e py312

Package build verification is available via tox -e pkg (runs python -m build and twine check).

Python 3.7 note: uv does not auto-provide CPython 3.7. tox -e py37 will skip locally if 3.7 isn’t available; it is exercised in GitHub CI.

Local development install

Create a virtual environment and install in editable mode:

uv venv .venv && source .venv/bin/activate
uv pip install -e .

Then you can open a Python shell (python) and import pubsub, or run examples such as:

python examples/advanced/advanced_main.py
python examples/basic_kwargs/console_main.py

To run a small example suite, use the helper script (assumes your venv is active):

bash examples/runall.sh  # uses 'python' from your venv

Versioning and tags

Versions come from git tags via setuptools_scm. To see the last tagged release:

git describe --tags --abbrev=0

To create a new tag, pick your next version (e.g. v4.0.7) and tag the current commit:

git tag v4.0.7
git push origin v4.0.7

There is also a helper script with subcommands for tagging/pushing:

python release.py get-latest            # show latest vX.Y.Z tag (or v0.0.0)
python release.py init-tag v4.0.7       # create a specific tag
python release.py bump-local [patch]    # create a local tag (major/minor/patch; default patch)
python release.py push-tag              # push latest tag (prompts/warns about PyPI release)

Warning: pushing a v* tag triggers the GitHub Actions release workflow, which builds and uploads to PyPI using the configured token.

CI will build and publish from that tag (using the tag version; no manual bump needed).

wxPython on Ubuntu 22+

If you want to run the wx examples, install wxPython and SDL2 runtime in your venv on Ubuntu 22.x+:

pip install --upgrade pip setuptools wheel
pip install --only-binary=:all: -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython==4.2.4
sudo apt-get install libsdl2-2.0-0  # runtime for the wheel

If the wheel is not found for your distro/Python combo, you’ll need GTK3/SDL build deps to compile from source instead.

Docs

Install deps into a local venv and build:

pip install -r docs/requirements.txt
make docs          # builds docs/_build/html
make clean-docs    # removes docs/_build

Helpers:

  • make venv sets up a local venv at .venv (uses system python).

  • make clean-venv removes that venv.

  • make add-wxpy-ubuntu installs wxPython 4.2.4 wheel + SDL2 runtime on Ubuntu (requires sudo). Useful for running wx examples in that venv.

  • Release helpers can be run via Makefile wrappers, e.g. make init-tag TAG=v4.0.7 or make bump-local BUMP=patch.

Release helpers can be run via the Makefile wrappers, e.g. make init-tag TAG=v4.0.7 or make bump-local BUMP=patch.

Release files for Pypubsub 4.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Pypubsub 4.0.7
File Size Uploaded
pypubsub-4.0.7.tar.gz 179.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Pypubsub 4.0.7
File Interpreter ABI Platform
pypubsub-4.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 251.4 kB

Release files / pypubsub-4.0.7.tar.gz

Download URL pypubsub-4.0.7.tar.gz
Size 179.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ec8b5cb147624958320e992602380cc5d0e4b36b1c59844d05e425a3003c09dc
BLAKE2b-256 checksum
How to use checksums
c9ae873ab0911ba6ae395f05a788cd509af4ade15585740e1f0bc7673775f469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / pypubsub-4.0.7-py3-none-any.whl

Download URL pypubsub-4.0.7-py3-none-any.whl
Size 72.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89c3e274e634fea19de881bb45152815d9c1aaa0120215f85200ba56843372f4
BLAKE2b-256 checksum
How to use checksums
47bf17587e7cdefbf66cb3f0bced126c11a6d4c0b9b78a3eb90bbd0a49963d58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

4.0.7 This release

2 release files

4.0.3

2 release files

4.0.0

1 release file

3.4.2

1 release file

3.3.0

1 release file

3.2.0

3.1.2

1 release file

3.1.1b1

3.0.1a2

3.0a8

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page