An universal wrapper (and useful tool) to make event / commands in python
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 Events
# create an event or use it in a class
client = Events()
# create an event
@client.event("event_name")
def test1(data):
do_action_here
# trigger the event
client.trigger("event_name")
# create another event
# you can put as much parameters as you want
@client.event("second_event")
def test1(data, arg1, arg2, *, arg3):
# data is the default parameter, it contain some basic informations that you can format as you want
do_action_here
# trigger the event
client.trigger({"event": "second_event", "parameters": ["arg1", "arg2", "arg3", "arg4"]})
# here the parameters will be :
# 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.2.1.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for easy_events-2.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9ea5685cf214a1ad1f8a48346b205ecff36bcffa8478f9febe36b31be133142 |
|
MD5 | b85707f9fd55417d3f9f7d7313117d3e |
|
BLAKE2b-256 | b596016c5e3c1b99ac1c62fcd63aefafd17909c3d81db8a1831082c129562758 |