Skip to content

Commit 366de23

Browse files
authored
Update README.md
1 parent 3f82ab3 commit 366de23

File tree

1 file changed

+36
-29
lines changed

1 file changed

+36
-29
lines changed

README.md

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
# TSignal
22

3-
A Python Signal-Slot library inspired by Qt
3+
Are you looking for a signal/slot pattern in Python without Qt dependencies? TSignal provides a lightweight, thread-safe, and asyncio-compatible implementation that gives you all the power of Qt's signal/slot pattern without the heavyweight dependencies. Perfect for:
44

5-
## Features
6-
- Easy-to-use signal-slot mechanism with decorators
7-
- Support for both synchronous and asynchronous slots
8-
- Thread-safe signal emissions
9-
- Automatic connection type detection (direct/queued)
10-
- Compatible with Python's asyncio
5+
- Async applications needing event handling
6+
- Thread communication in Python applications
7+
- Event-driven architectures
8+
- Decoupled component communication
119

12-
## Installation
13-
14-
Currently, this package is under development. You can install it directly from the repository:
15-
16-
```bash
17-
git clone https://github.com/tsignal/tsignal-python.git
18-
cd tsignal-python
19-
pip install -e .
20-
```
21-
22-
For development installation (includes test dependencies):
23-
```bash
24-
pip install -e ".[dev]"
25-
```
10+
## Why TSignal?
11+
- 🚀 Pure Python implementation - no Qt or external dependencies required
12+
- ⚡ Async/await support out of the box
13+
- 🔒 Thread-safe signal emission and slot execution
14+
- 🎯 Simple, decorator-based API similar to Qt
15+
- 🔄 Automatic thread handling for cross-thread signals
2616

2717
## Quick Start
2818

@@ -37,7 +27,6 @@ class Counter:
3727

3828
@t_signal
3929
def count_changed(self):
40-
"""Signal emitted when count changes"""
4130
pass
4231

4332
def increment(self):
@@ -47,18 +36,14 @@ class Counter:
4736
@t_with_signals
4837
class Display:
4938
@t_slot
50-
def on_count_changed(self, value):
39+
async def on_count_changed(self, value):
5140
print(f"Count is now: {value}")
5241

53-
# Usage
42+
# Connect and use
5443
counter = Counter()
5544
display = Display()
56-
57-
# Connect signal to slot
5845
counter.count_changed.connect(display, display.on_count_changed)
59-
60-
# Increment will trigger signal emission
61-
counter.increment() # Output: Count is now: 1
46+
counter.increment() # Will print: "Count is now: 1"
6247
```
6348

6449
### Async Example
@@ -84,6 +69,28 @@ async def main():
8469
asyncio.run(main())
8570
```
8671

72+
## Features
73+
- Easy-to-use signal-slot mechanism with decorators
74+
- Support for both synchronous and asynchronous slots
75+
- Thread-safe signal emissions
76+
- Automatic connection type detection (direct/queued)
77+
- Compatible with Python's asyncio
78+
79+
## Installation
80+
81+
Currently, this package is under development. You can install it directly from the repository:
82+
83+
```bash
84+
git clone https://github.com/tsignal/tsignal-python.git
85+
cd tsignal-python
86+
pip install -e .
87+
```
88+
89+
For development installation (includes test dependencies):
90+
```bash
91+
pip install -e ".[dev]"
92+
```
93+
8794
## Documentation
8895
- [Detailed Usage Guide](docs/usage.md)
8996
- [API Reference](docs/api.md)

0 commit comments

Comments
 (0)