Event dispatcher (see python-whistle.readthedocs.io).
Project description
A lightweight, pure-Python event dispatcher for building decoupled applications.
Key Features:
🚀 Pure Python - No external dependencies
🔄 Sync & Async - Full support for both synchronous and asynchronous workflows
🎯 Type Safe - Prevents mixing sync and async listeners
📦 Lightweight - Minimal footprint, maximum flexibility
🎛️ Priority Control - Order listener execution
⚡ Event Propagation - Stop event flow when needed
Installation
pip install whistle
Requires Python 3.10 or later. No dependencies.
Quick Start
Create an event dispatcher:
from whistle import EventDispatcher
dispatcher = EventDispatcher()
Add a listener to react to events
def on_spectacle_starts(event):
print('Please turn down your phones!')
dispatcher.add_listener('spectacle.starts', on_spectacle_starts)</code></pre>
Dispatch!
dispatcher.dispatch('spectacle.starts')
Documentation
For complete documentation, visit https://python-whistle.readthedocs.io/
Links
Homepage: https://python-whistle.github.io/
Documentation: https://python-whistle.readthedocs.io/
Source Code: https://github.com/python-whistle/whistle
Issue Tracker: https://github.com/python-whistle/whistle/issues
Made with ♥ by Romain Dorgueil and contributors.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whistle-2.1.4.tar.gz.
File metadata
- Download URL: whistle-2.1.4.tar.gz
- Upload date:
- Size: 161.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15fb4c9d46d32e658472da475697cb2573768a19579f1d139606fe1de5285fee
|
|
| MD5 |
60a2f0fde55d30300bf89a98e57e5cee
|
|
| BLAKE2b-256 |
22625e2357cb0b02d5323094d0010892295bfe7eb745e5588ee15ddcddee8c72
|
Provenance
The following attestation bundles were made for whistle-2.1.4.tar.gz:
Publisher:
release.yml on python-whistle/whistle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whistle-2.1.4.tar.gz -
Subject digest:
15fb4c9d46d32e658472da475697cb2573768a19579f1d139606fe1de5285fee - Sigstore transparency entry: 639805456
- Sigstore integration time:
-
Permalink:
python-whistle/whistle@3080662c85c3eca5e7dcd2eda1952d94dacd5685 -
Branch / Tag:
refs/tags/2.1.4 - Owner: https://github.com/python-whistle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3080662c85c3eca5e7dcd2eda1952d94dacd5685 -
Trigger Event:
push
-
Statement type:
File details
Details for the file whistle-2.1.4-py3-none-any.whl.
File metadata
- Download URL: whistle-2.1.4-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9ecb230380caa64e52174091de7d16eacd0425bd8967410aa266c87bcd5b6b
|
|
| MD5 |
68f3fd8b2772c5b88c0a1f0c97c40124
|
|
| BLAKE2b-256 |
c24f66cbfef4a8502ff627f628ffd8c5dbfddb06dcd4fedefd0112c6beb0bbff
|
Provenance
The following attestation bundles were made for whistle-2.1.4-py3-none-any.whl:
Publisher:
release.yml on python-whistle/whistle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whistle-2.1.4-py3-none-any.whl -
Subject digest:
fc9ecb230380caa64e52174091de7d16eacd0425bd8967410aa266c87bcd5b6b - Sigstore transparency entry: 639805459
- Sigstore integration time:
-
Permalink:
python-whistle/whistle@3080662c85c3eca5e7dcd2eda1952d94dacd5685 -
Branch / Tag:
refs/tags/2.1.4 - Owner: https://github.com/python-whistle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3080662c85c3eca5e7dcd2eda1952d94dacd5685 -
Trigger Event:
push
-
Statement type: