https://github.com/chrisbrake/perceptible
A observable versions of python data structures
https://github.com/chrisbrake/perceptible
data-structures observability observable observer observer-pattern python python-library
Last synced: 27 days ago
JSON representation
A observable versions of python data structures
- Host: GitHub
- URL: https://github.com/chrisbrake/perceptible
- Owner: chrisbrake
- License: bsd-3-clause
- Created: 2018-05-26T16:09:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-17T06:18:31.000Z (over 7 years ago)
- Last Synced: 2026-05-18T05:34:46.240Z (about 2 months ago)
- Topics: data-structures, observability, observable, observer, observer-pattern, python, python-library
- Language: Python
- Size: 56.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
perceptible
===========
Observable versions of python data structures
|Build Status| |Coverage Status| |Docs Status| |Package Status|
.. |Build Status| image:: https://travis-ci.org/chrisbrake/perceptible.svg?branch=master
:target: https://travis-ci.org/chrisbrake/perceptible
.. |Coverage Status| image:: https://coveralls.io/repos/github/chrisbrake/perceptible/badge.svg?branch=master
:target: https://coveralls.io/github/chrisbrake/perceptible?branch=master
.. |Docs Status| image:: https://readthedocs.org/projects/perceptible/badge/?version=latest
:target: https://perceptible.readthedocs.io/en/latest/
.. |Package Status| image:: https://badge.fury.io/py/perceptible.svg
:target: https://badge.fury.io/py/perceptible
.. quick-start-section-marker
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:
.. code-block:: python
>>> 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.
.. code-block:: bash
pip install perceptible