skillfed

psygnal

Fast python callback/event system modeled after Qt Signals

psygnal v0.15.1 4.1M downloads/30d#2,376 on PyPI132
Permissive license BSD 3-Clause License Active released

What it is and what it does

Psygnal is a pure Python event system that lets you define signals on objects and connect callback functions to them. When a signal is emitted, all connected callbacks are invoked with the signal's arguments. It mimics Qt's signals-and-slots API but requires no Qt dependency, and includes optional runtime type checking to catch mismatched callback signatures.

The library also provides higher-level conveniences: an @evented decorator that automatically emits signals when dataclass fields change (compatible with standard dataclasses, attrs, and pydantic), and evented container types (EventedList, EventedDict, EventedSet) that emit signals on mutation. It has no external dependencies and is compiled with mypyc for performance, though a pure Python fallback is available.

Use it for:

  • Build reactive UIs or data models where UI components need to respond to state changes without tight coupling.
  • Create plugin systems where plugins register callbacks to be notified of application events.
  • Monitor mutations to data structures (lists, dicts, sets) and trigger side effects like logging or validation.
  • Implement evented dataclasses that automatically notify listeners when fields are modified.
  • Coordinate multi-threaded applications where one thread needs to signal completion or state changes to others.

Worth the install?

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

Psygnal implements the observer pattern with a Qt-style signals API, allowing objects to emit events that connected callbacks can listen to, with optional type checking and threading support.

Yes. Psygnal is production-stable, dependency-free, actively maintained, and solves a common architectural need (decoupled event notification) with a clean, familiar API. The zero-dependency design and low install friction make it a safe choice for projects of any size. No known security issues.

Install

psygnal on PyPI

pip

pip install psygnal

uv

uv add psygnal

poetry

poetry add psygnal

Installing psygnal

Before you install

Low friction: pure Python wheel with zero runtime dependencies, actively maintained with recent commits, and supports current Python versions (3.10–3.14).

License in practice

BSD 3-Clause is permissive; you may use, modify, and distribute psygnal freely in commercial and private projects with minimal restrictions.

Quickstart

from psygnal import Signal

class MyObject:
    value_changed = Signal(str)

my_obj = MyObject()

@my_obj.value_changed.connect
def on_change(new_value: str):
    print(f"Value: {new_value}")

my_obj.value_changed.emit('hello')

Verify before relying

  • Whether the optional mypyc compilation is automatically applied in wheel distributions or requires manual build setup.
  • Performance overhead of type checking relative to untyped signal emission.
  • Thread-safety guarantees and behavior when signals are emitted from multiple threads concurrently.

Package facts

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

Evidence: psygnal-0.15.1-py3-none-any.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

observer pattern pythonevent system callbacksqt signals without qtpublish subscribe patternsignal emit connectevent-driven architecturedataclass field change events
event-drivenobserver-patternreactive

More Software Development packages