--- id: psygnal version: "0.15.1" license: BSD 3-Clause License license_treatment: permissive maintenance: active --- # psygnal — Fast python callback/event system modeled after Qt Signals License: permissive · Maintenance: active · Downloads: 4.1M/mo ## 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 above — 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 pip install psygnal uv add psygnal 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_current - Install friction: low - Maintenance: active - Downloads: 4.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags observer pattern python, event system callbacks, qt signals without qt, publish subscribe pattern, signal emit connect, event-driven architecture, dataclass field change events, event-driven, observer-pattern, reactive [View on SkillFed](https://skillfed.io/packages/psygnal) · [View on PyPI](https://pypi.org/project/psygnal/)