No project description provided
Project description
PyEvent: A simple event handling library for python
Getting Started
- Simply Run this Command:
pip install signally
- Here are the examples on how to run events and add a listeners:
from signally.event import Event
test_event = Event()
def greet(name, **kwargs):
print(f"Hello, {name}!")
def greet_with_exclamation(name, **kwargs):
print(f"Hello, {name}!!!")
def greet_with_age(name, age, **kwargs):
print(f"Hello, {name}! You are {age} years old.")
@test_event.emittable
def greet_with_decorator(name, **kwargs):
print(f"Hello, {name} from decorator!")
def main():
# Add listeners to the event
test_event.add_listener(greet) # Greet the user
test_event.add_listener(greet_with_exclamation) # Greet with exclamation
test_event.add_listener(greet_with_age) # Greet with age
test_event.add_listener(lambda name, **kwargs: print(f"Hello, {name} from lambda!")) # Greet from lambda
# test_event.emittable(greet_with_decorator) # This should be a decorator and throws error
# Emit the event
test_event.emit(name="John", age=20)
if __name__ == "__main__":
main()
Just Copy to try and get started...
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
signally-0.1.1.tar.gz
(1.5 kB
view details)
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 signally-0.1.1.tar.gz.
File metadata
- Download URL: signally-0.1.1.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5121b7a77ba6da6b7b0bb131831b3eb0d51b73e0d855a8c1b5a7d4f2a2bbe2e2
|
|
| MD5 |
a3265c8c497a5e645a11c69781a6bdba
|
|
| BLAKE2b-256 |
3c6c4ac30e3c491e044f53fcfb3365d565b146d8cabd7982b931470b974933c6
|
File details
Details for the file signally-0.1.1-py3-none-any.whl.
File metadata
- Download URL: signally-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b54428d5b84f1bda66b1a1325a0f0ff327eb8573e5e82ac289a7a3f7a00054b7
|
|
| MD5 |
5e84c26a41f668ca8196361434e5c075
|
|
| BLAKE2b-256 |
0b6837261153b3b7ba130ff3ece8e930f7891b090cff8ef85f73c3ab25a228ea
|