No project description provided
Project description
Ypy
Ypy is a Python binding for Y-CRDT. It provides distributed data types that enable real-time collaboration between devices. Ypy can sync data with any other platform that has a Y-CRDT binding, allowing for seamless cross-domain communication. The library is a thin wrapper around Yrs, taking advantage of the safety and performance of Rust.
🧪 Project is still experimental. Expect the API to change before a version 1.0 stable release.
Installation
pip install y-py
Getting Started
Ypy provides many of the same shared data types as Yjs. All objects are shared within a YDoc
and get modified within a transaction block.
import y_py as Y
d1 = Y.YDoc()
# Create a new YText object in the YDoc
text = d1.get_text('test')
# Start a transaction in order to update the text
with d1.begin_transaction() as txn:
# Add text contents
text.push(txn, "hello world!")
# Create another document
d2 = Y.YDoc()
# Share state with the original document
state_vector = Y.encode_state_vector(d2)
diff = Y.encode_state_as_update(d1, state_vector)
Y.apply_update(d2, diff)
value = str(d2.get_text('test'))
assert value == "hello world!"
Development Setup
- Install Rust Nightly and Python
- Install
maturin
in order to build Ypy
pip install maturin
- Create a development build of the library
maturin develop
Tests
All tests are located in /tests
. You can run them with pytest
.
pytest
Build Ypy :
Build the library as a wheel and store them in target/wheels
:
maturin build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for y_py-0.4.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e8688edd31bf1a2305184b7f6ff9e4331e057a83e38d1597880a8c2bf4d925 |
|
MD5 | 50273faa27d8422c0f92ebf15e3a7499 |
|
BLAKE2b-256 | aaff312ee98186a8ae7d5552635d0db5cd7b9a4fff1334bb20ef17f76b1459f8 |
Hashes for y_py-0.4.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5f978ce7960230136a2599b53aef80d0561bb88f730bc61eb62e1c1637ef5ac |
|
MD5 | 1caa130dc92bcb859b94514a0f9888d0 |
|
BLAKE2b-256 | fa58b15badb77d2c7354f035ed3f153e194aecee0db951ec87e43ea05c128fa7 |
Hashes for y_py-0.4.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c81d9cc318fc805e63d70429af0f703fec81987c85b538726df3d84bfd5289e |
|
MD5 | 0835f89ee807435b089a1d9c3ac83e82 |
|
BLAKE2b-256 | 0214864fd945e8b006c946c6fc634f4a58a49bdf4d07af4f406b09fa0d9f03e8 |
Hashes for y_py-0.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 071d467f5003d5fe9b17c719a91dc18b71ca85b3b6b66bb9fdaf6ea55e3149a7 |
|
MD5 | a9cd02f49b7ca92995631e1e8c8d0d88 |
|
BLAKE2b-256 | 991d37369831d1b0bc226749a1a14bcd632032277f86a09244d4523fd009d078 |
Hashes for y_py-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f27c5b28f1cfeec0e38b236a4ce535c28e749ddcc24bd352eb2f39e2cc58b44 |
|
MD5 | 86382c3b48fe053d23cf5448e2028a0b |
|
BLAKE2b-256 | e105a846f1b09b2b0659a03a49c996e57cf100ae47d119d450fca2592501587e |
Hashes for y_py-0.4.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 228acd8a2d84bf384fa4af6f438250fd4aad74ac4fc0b10de1f9184d1c98afac |
|
MD5 | 7797c134d6d7e159ff1004386c2df490 |
|
BLAKE2b-256 | b6b937f607a00bf1d6e76e9d678dc502b70e7e9562b248acea312b63b28d0692 |
Hashes for y_py-0.4.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 123ec8911a0f00ef845befcbe8de09c4a90faa11b1f55e0757e079b9b544f89d |
|
MD5 | 375aa2a836a0f2f151cdbe320795cb03 |
|
BLAKE2b-256 | d07a93fbf7aeb56d8951336095fe6d1422e6bce7443e7dfcfdcf17bc545f8026 |
Hashes for y_py-0.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36f865ed6a0fb3268765aff7887892ffef03bd428ba67895d2832cf4f5ef31e3 |
|
MD5 | 4a17b3613b164c536b787998a10eea1b |
|
BLAKE2b-256 | 26e4b5b3c5522fb65f36eb911824b02403db697779e2031445ee5c0c1f0f81f4 |
Hashes for y_py-0.4.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb77a974b9eb956387491ff35279f47c2671317a67f1de61abdb28ef068a49b5 |
|
MD5 | 5a0b367969dd1fa0257709a7b485082d |
|
BLAKE2b-256 | cf212a00b4f7271d10dae51886d0ca15f6d19c76ae46c71e236c72d9c7367363 |
Hashes for y_py-0.4.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a8c04d5ae56cde8f5072f754c5c233fcf16b911a5a13976d2d9a9c93a51ec38 |
|
MD5 | 6b9a7152896aa6f53a1da0d0297a6278 |
|
BLAKE2b-256 | 899c6c20e1a4b8e220384ffcfabf8b1f512f8dcdf0f1e4d6548eb9ad61a5f18c |
Hashes for y_py-0.4.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c250e9770aeb303855def63af3af226d924885fdd2a4a24666f2152c2b42083 |
|
MD5 | bb0604fa4fe40665a7163b399c8d5407 |
|
BLAKE2b-256 | 9985a34a574782c147345f9cefcd2297c58b13e0828f02cd433c8687c512e427 |
Hashes for y_py-0.4.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df644b7445ddc26f442ea2f6743deb54fc95d98f5156dc12fa8374fde9d7eb2d |
|
MD5 | 29f891060b4a9a515b6d1f1902a280cc |
|
BLAKE2b-256 | d250c71c11f9d4a0e9a05af979865f73efab6143141d621f130403278c51c502 |
Hashes for y_py-0.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3cde35976e3c36536faee2abe621eebf12ffb66b29d0e8f72abdb866ac35c29 |
|
MD5 | f818c947b8b472e8a5f7520f1e22230e |
|
BLAKE2b-256 | 0a999e440a93f2489a2149de95dc6e0b54b335a42c2bb622549f5e38ac69d60b |
Hashes for y_py-0.4.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 832f5d1b908aa68dd03a875dcd03038c727c232da82549372cfed1e477cd01ad |
|
MD5 | ea1a9b7a252e787d2aee39a2a8e80792 |
|
BLAKE2b-256 | 62cc7569cdad339f7b7b760f13288b2df71a557e666e646df6be542be9a94cf9 |
Hashes for y_py-0.4.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15c0f12020d9e0eb4ef3d7f4d60a54a9d915d8793b1b80c6af8f369bc6832613 |
|
MD5 | 8bf3201d26ace209f59de29aa9dce0ee |
|
BLAKE2b-256 | a76e143359f53ca01eadcbc7f7fc89ce1c9d3d8abc9a553e2abfab21c080a2b5 |
Hashes for y_py-0.4.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f2ff7fc2337ea984452390a5da838114f555110fc60ee483371ac2efa0da5f5 |
|
MD5 | 03c24735c49b3019ca79dfe41fdf4649 |
|
BLAKE2b-256 | 90a32f48e1efc2184c52702d56857f2b8714f33279a0637aeae480514b1c31a0 |
Hashes for y_py-0.4.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ca9e05f1fcb0bbd2061ceb2b8bd01d499f2d6616676a0e957f6182dc49cba9 |
|
MD5 | 6c9a7b39224a3c9d4469981d5c5815be |
|
BLAKE2b-256 | 33dc0aba9e4086e8ef90d1ab4ec2b00181c5f33b9c900bfaea0cf511532215c7 |
Hashes for y_py-0.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c802019ea7ca7a31df9dfabf80d21d7716951ed9aef10d07e8a6ca4d9929269e |
|
MD5 | f0da0368394075601d10f72fa3316b0d |
|
BLAKE2b-256 | 762e12e9bbbce373f9041048db2b16b53c499a731208885abe7542baa82d3b3c |