semvec/pypi-packages huggingface dataset:
dyspatch 0.0.1
A simple events handler package.
License: MIT
Requires Python: >=3.8.0

# Dyspatch
A simple package that implements basic events handling in Python.

## Installation
```
pip install dyspatch
```

## Usage
A basic example is as follows:
```py
import dyspatch

users = []

def on_room_join(user):
    print(f'{user} joined the room.')
    users.append(user)
    print(f'We now have {len(users)} users')

events = dyspatch.Events()
events.add_listener('room_join', on_room_join)
events.dispatch('room_join', args=['Alex'])
events.dispatch('room_join', args=['Bob'])
```
The output is like this:
```
Alex joined the room.
We now have 1 users
Bob joined the room.
We now have 2 users
```