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 Commands
# create an event or use it in a class
client = Commands()
# create an event
@client.event("event_name")
def test1(data):
do_action_here
# trigger the event
client.process_data("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.process_data({"command": "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-1.8.2.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for easy_events-1.8.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5267bfb4e33650d6beeaafab4dbd968e50cfd53f2ef8e58f541ab014d32f2087 |
|
MD5 | 06735b5b1bd9e3000a485391545250ed |
|
BLAKE2b-256 | 95f53d857a7ddc6e2fa5b2e679eab7b1740ac958d2d4670d6f9077c3372b7ee4 |