perceptible

Observable versions of python data structures


Keywords
perceptible, observable, observer, data-structures, observability, observer-pattern, python, python-library
License
BSD-3-Clause
Install
pip install perceptible==0.4.2

Documentation

perceptible

Observable versions of python data structures

Build Status Coverage Status Docs Status Package Status

This library is meant to be API compatible with standard Python objects, but with the addition of observability. Currently supports Lists and Dictionaries.

A simple use looks like this:

>>> from perceptible import ObservableDictionary
>>> def observer(o):
...     print('observer was called with', o)
...
>>> o_dict = ObservableDictionary()
>>> o_dict.add_observer(observer)
>>> o_dict['key'] = 'value'
observer was called with {'key': 'value'}

Installation is as simple as installing via pip.

pip install perceptible