An universal wrapper (and useful tool) to make event / commands in python
Reason this release was yanked:
bug with prefix
Project description
easy-events
A library that help you to manage events
Getting started
Installation
pip install easy-events
GitHub : Github
Usages
text
Code example
from easy_events import EasyEvents
# create an event or use it in a class
client = EasyEvents()
# create another event (can be sync or async)
# you can put as much parameters as you want
@client.add_event("test1")
def test(data, arg1, arg2, *, arg3):
# data is the default parameter, it contain some basic informations that you can format as you want
print(data, arg1, arg2, arg3)
# trigger the event
# dict way
client.trigger({"event": "test1", "parameters": {"arg1": "arg1", "arg2": "arg2", "arg3": ["arg3", "arg4"]}})
# dict way v2
client.trigger({"event": "test", "parameters": ["arg1", "arg2", "arg3", "arg4"]})
# dict way v3
client.trigger({"event": "test1", "parameters": "arg1 arg2 arg3 arg4"})
# list way
client.trigger(["test", "arg1", "arg2", "arg3", "arg4"])
# str way
client.trigger("test arg1 arg2 arg3 arg4")
# the result will be (for all cases):
# arg1 = arg1
# arg2 = arg2
# arg3 = [arg3, arg4]
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
easy-events-2.8.0.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for easy_events-2.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c15ec25d55fbf7e4c1f714a269694f64844e96521e980dd5bd2a2daaf3d782f |
|
MD5 | 286f1417a7c7fc2bb39e9d1ac6dc36ef |
|
BLAKE2b-256 | b06c634679436c7c1ab37d75559ffde9cefac4d8dadb44498a4d25b464e9ac71 |