Blinker

raw JSON →
1.9.0 verified Tue May 12 auth: no python install: verified quickstart: verified

Blinker is a fast and simple object-to-object and broadcast signaling library for Python, currently at version 1.9.0. It is actively maintained with a release cadence of approximately one to two months between major versions.

pip install blinker
error ModuleNotFoundError: No module named 'blinker._saferef'
cause The 'blinker._saferef' module was removed in Blinker version 1.8.0, causing compatibility issues with packages like 'selenium-wire' that depend on it.
fix
Downgrade Blinker to version 1.7.0 by running: 'pip install blinker==1.7.0'.
error ImportError: cannot import name 'signal' from 'blinker'
cause The 'signal' module is not directly importable from 'blinker'; it should be accessed via 'blinker.signal'.
fix
Correct the import statement to: 'from blinker import signal'.
error AttributeError: module 'blinker' has no attribute 'Signal'
cause The 'Signal' class should be accessed using lowercase 'signal' in Blinker.
fix
Use 'from blinker import signal' and then 'my_signal = signal('my-signal')'.
error ImportError: No module named blinker
cause The `blinker` library is not installed in the Python environment, or the Python interpreter cannot find the installed package.
fix
Install the blinker library using pip: pip install blinker
error AttributeError: '_FakeSignal' object has no attribute 'connect_via'
cause This error typically arises when a library (like `Flask-Security`) expects `blinker` to be installed and provides full signal functionality, but `blinker` is missing, causing the library to use a fallback `_FakeSignal` class without the expected `connect_via` attribute.
fix
Install the blinker library: pip install blinker
breaking Support for Python 3.8 has been dropped in version 1.9.0.
fix Upgrade to Python 3.9 or later.
deprecated The `__version__` attribute has been removed in version 1.9.0.
fix Use `importlib.metadata.version('blinker')` to retrieve the version.
deprecated The `WeakNamespace` class has been removed in version 1.9.0.
fix Refactor code to avoid using `WeakNamespace`.
deprecated The `Signal.temporarily_connected_to` context manager has been removed in version 1.9.0.
fix Use alternative methods to temporarily connect signals.
python os / libc status wheel install import disk
3.10 alpine (musl) - - 0.02s 17.8M
3.10 slim (glibc) - - 0.01s 18M
3.11 alpine (musl) - - 0.04s 19.7M
3.11 slim (glibc) - - 0.04s 20M
3.12 alpine (musl) - - 0.04s 11.5M
3.12 slim (glibc) - - 0.04s 12M
3.13 alpine (musl) - - 0.04s 11.2M
3.13 slim (glibc) - - 0.04s 12M
3.9 alpine (musl) - - 0.03s 17.3M
3.9 slim (glibc) - - 0.02s 18M

This example demonstrates how to create a signal, connect a receiver function, and send the signal in Blinker.

import os
from blinker import Signal

# Create a new signal
my_signal = Signal('my_signal')

# Define a receiver function
def my_receiver(sender):
    print(f'Received signal from {sender}')

# Connect the receiver to the signal
my_signal.connect(my_receiver)

# Send the signal
my_signal.send('SenderName')