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.7.3.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for easy_events-1.7.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abb129ca66be0b7b087fea7cefb6705256fdfb372b5def6521572a4493e1491e |
|
MD5 | 6edc408302c164960a80054038de3b83 |
|
BLAKE2b-256 | 25be1377341919a14189aa690d45e28ceb1520a1f30078cf7a38833c9baa599b |