Skip to main content

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

  1. Installation
  2. Usages
  3. Code example
  4. Documentation

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-1.9.6.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

easy_events-1.9.6-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page