Skip to main content

Simple Event handler with custom objects for tracking realtime data changes

Project description

SimpleEvents

Simple Event Handler and utility objects for monitoring and responding to changes in data structures.

Changelog

0.1.0 Initial Release

  • Implemented generic Event() object for event processing
  • Implemented EventList(). Custom list with events to respond to adding, removal, and change of entries. And responding to clearing of List.

Installation

pip install eventables

Event() Usage

from eventables.events import Event

class MyObject:
    def __init__(self):
        self.my_event = Event()
    
    def trigger_example(self):
        # do stuff
        self.my_event(my_arg="Successful Event Call")
        
def reaction_function(my_arg):
    print(my_arg)

def demo():
    my_object = MyObject()
    my_object.my_event += reaction_function
    my_object.trigger_example()

Output

>>> demo()
Successful Event Call

EventList() Usage

List

from eventables.events import EventList

class MyObject:
    def __init__(self):
        self.my_list = EventList()
        
def reaction_function(value):
    print(f"Successfully added {value} to list!")

def demo():
    my_object = MyObject()
    my_object.my_list.on_entry_added += reaction_function
    my_object.my_list.append("Test Object")

Output

>>> demo()
Successfully added Test Object to list!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eventables-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eventables-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file eventables-0.1.0.tar.gz.

File metadata

  • Download URL: eventables-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for eventables-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7efc930bd7b8c89d0dd2241e42af04b153eb3e7bb5c4037932fd4c2ee57602c1
MD5 1e40bc1f6c862b5001b3d7bd4398afe3
BLAKE2b-256 166eb1e599c8008b9dea3b2e851e02b2cf24e00c38aacb7238e12ac64a776300

See more details on using hashes here.

File details

Details for the file eventables-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: eventables-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for eventables-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0638c09ba6f03bff41f1cf8de3c49d71666c2d17cb17253792eec09005f4010
MD5 28ef11c7c5e1dbb4e2eef526c1d2213f
BLAKE2b-256 3ad052a30c2ac95d9033d405323c4ea4ed1002ae8729c7a65125148acca977af

See more details on using hashes here.

Supported by

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