Registry / communication / pydispatcher

pydispatcher

JSON →
library2.0.7pypypi✓ verified 28d ago

Multi-producer-multi-consumer signal dispatching mechanism for Python, originally from PyDispatcher. Version 2.1.2 is actively maintained via the Scrapy project. Releases are infrequent.

pip install PyDispatcher
INSTALL
IMPORT
SIG · PYDISPATCHER
P
pydispatcher
communicationpythonv2.0.7
Install
1.5s avg
Import
10ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.008s · 17.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.006s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dispatcher
✓ from pydispatch import dispatcher
✗ from pydispatcher import dispatcher
The package name on PyPI is 'PyDispatcher', but the module is 'pydispatch'.

Basic signal dispatch example.

from pydispatch import dispatcher def callback(signal, sender): print(f"Received signal {signal} from {sender}") dispatcher.connect(callback, signal="my_signal") dispatcher.send(signal="my_signal", sender="app")
Debug
Known issues
gotchaImport path confusion: install with 'pip install PyDispatcher' but import from 'pydispatch'.
fix
Use 'from pydispatch import dispatcher' consistently.
affects: all
gotchaSender requirement: the 'sender' argument in connect() and send() can be None or any object; omitting it may cause unexpected behavior.
fix
Always specify sender explicitly (e.g., sender='myapp') to avoid confusion.
affects: all
deprecatedWeak references: by default, receivers are stored via weak references. If the callback is a bound method or a lambda, it may be garbage-collected before signal dispatch.
fix
Use 'dispatcher.connect(callback, signal='...', weak=False)' to keep a strong reference.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pydispatcher'
Attempted to import 'pydispatcher' instead of 'pydispatch'.
fix
Use 'from pydispatch import dispatcher' after installing PyDispatcher.
ValueError: Signal 'my_signal' is not registered
The signal was referenced before any connect() or send() call; signals are not pre-registered.
fix
Call dispatcher.connect() or dispatcher.send() with the signal string; it is automatically registered.
Upgrade
Version history
2.0.7latest on PyPI · released Feb 17, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
Anthropic
1
Resources
pydispatcher — pip install pydispatcher · libregistry