Skip to main content

Synchronized dictionaries using Greg Little's 'shelf' CRDT.

Project description

little-shelf

Synchronized dictionaries using Greg Little's shelf CRDT.

Changes/patches can be distributed to peers through any channel. See the understory's Braid implementation as an example of real world usage.

Install

pip install little-shelf

Use

>>> import littleshelf
>>> alice = littleshelf.LittleShelf()
>>> bob = littleshelf.LittleShelf()
>>> patch = alice.set(ham="spam")
>>> patch
[{'ham': ['spam', 0]}, 0]
>>> alice
{'ham': 'spam'}
>>> alice == bob
False
>>> bob.merge(patch)
>>> alice == bob
True
>>> bob.get("ham") == bob["ham"] == "spam"
True

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

little-shelf-0.0.2.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

little_shelf-0.0.2-py3-none-any.whl (5.6 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