I made a Python signal/slot library that works like Qt but without Qt dependency

Hi everyone!

What My Project Does:
I've been working on TSignal, a library that implements Qt-style signals and slots in pure Python. It handles async operations and thread communication automatically, making it easy to build event-driven applications without pulling in heavy dependencies.

Target Audience:
This is meant for production use, especially for:

  • Python developers who like Qt's signal/slot pattern but don't want Qt as a dependency
  • Anyone building async applications that need clean component communication
  • Developers working with multi-threaded applications who want easier thread communication

Comparison:
While Qt provides a robust signal/slot system, it comes with the entire Qt framework. Other alternatives like PyPubSub or RxPY exist, but TSignal is unique because it:

  • Provides Qt-like syntax without Qt dependencies
  • Has native asyncio integration (unlike Qt)
  • Handles thread-safety automatically (simpler than manual PyPubSub threading)
  • Is much lighter than RxPY while keeping the essential event handling features

Here's a quick example:

@t_with_signals
class Counter:
    @t_signal
    def count_changed(self):
        pass

    def increment(self):
        self.count += 1
        self.count_changed.emit(self.count)

@t_with_signals
class Display:
    @t_slot
    async def on_count_changed(self, value):
        print(f"Count is now: {value}")

# Connect and use
counter = Counter()
display = Display()
counter.count_changed.connect(display, display.on_count_changed)
counter.increment()  
# Triggers async update

You can find it here: https://github.com/TSignalDev/tsignal-python

I'd love to hear what you think! If you're building anything with async/await or need thread communication in Python, give it a try and let me know how it works for you. Any feedback or suggestions would be super helpful!