Observable versions of python data structures
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