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.extend(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 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.5.3-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6099751cb6bd9b1c70f78118daff439b0e49d4b3093f0ce7eb2a5a25afdbc912 |
|
MD5 | 2ff25e21f0d4bd2ae4954c8591df8f2e |
|
BLAKE2b-256 | 3f67a9b093ef5eebae9969d6cd56f0120a8d3ce1d7260e016946b40164d9903f |
Hashes for y_py-0.5.3-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b9176d1b8c6bb7b792225bd863bcc5cfa63e721c5d63315b3a98e850f767f8c |
|
MD5 | f3f3851f1bfb7578b80a60b7aaddd91b |
|
BLAKE2b-256 | 07b55bb7b0149a69b0b35735e9d1d2952843cbde0d1db4fcd551855b1345937c |
Hashes for y_py-0.5.3-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03accf3940ac1ba38e633b434431baa8b7e36378c10d5894006194eb685db49e |
|
MD5 | 9c1aefff8b3718a06b06d7ffbc9d2e34 |
|
BLAKE2b-256 | ca81232618a1bb3ac7286af9c22640e9760e0772d560b1399d7b52208e091fca |
Hashes for y_py-0.5.3-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5d0c844eae13c4daf125ac928cacbf122664a99521a79f602af301d11212339 |
|
MD5 | 40adddf4285b3eff6f434ec1f43b1824 |
|
BLAKE2b-256 | 81c89dee0539f187a27cc908ee5c49cf213740c7f18ed8bf9d14a9f6d0efc31f |
Hashes for y_py-0.5.3-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7df5d14c66bc7a606ed1a6da2ce392c305a7ae57ad139af72347af1c102e728 |
|
MD5 | 1bd8ea85ef9a3f014173b7b86785c7f7 |
|
BLAKE2b-256 | 5aed1f407995fa60d60626f6e7341fdbb128a95cf145877621a3b885e717d3b7 |
Hashes for y_py-0.5.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92df69d62740248a6d557ea5e9c804b2a5bbd88cbaf7d94bc568bbf32190bd62 |
|
MD5 | c7907275b69f3b29d931b778ba4bf112 |
|
BLAKE2b-256 | b2f43527805bda38e9e37eb41efd324da73a80dc0b76fdcc73f1a7850b327226 |
Hashes for y_py-0.5.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812e97bb8bc5a4ca3349f8c052022ed6f2c2706acbb6da8cc8909360c3604dfb |
|
MD5 | 794572be3fd607bb902e796b8e92761d |
|
BLAKE2b-256 | 2c09e0dd6d63d98f5a445805262e51b4acf030c22475bfe3235a4f07f9999ed7 |
Hashes for y_py-0.5.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b2c10bd111808a71f86c186a7b7b5b72b9fb154387ebd8d6300b20d2a56b142 |
|
MD5 | 0cb3f39463abd83f505bd5834199fbf6 |
|
BLAKE2b-256 | 9e079a2bbcec0b4137f197b9f0b8aecc6799f3a78a2a1e040b7b0cf4f444057e |
Hashes for y_py-0.5.3-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3555055ec2cd4e1f3c0f93ddaacc09f7ba747d4f864d096f178dde7126a9f5c1 |
|
MD5 | a7faa3ec657b84f08d59229b87280de0 |
|
BLAKE2b-256 | 61812e9ddca1f774b0131eb5c6343959ee362040c73f6ea4814691cb223ed4f0 |
Hashes for y_py-0.5.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58227767d5faf15a559bac9f92404f7e19259b1bb64ab7d83aca9d522acbaa4d |
|
MD5 | 7e6ad6803123ee4602b868ef18e5102b |
|
BLAKE2b-256 | fc39c1a87a57f0209847dc613395524ffeb2c5372b60fc1192dce3bc09c7cb13 |
Hashes for y_py-0.5.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68d9299700223a39dd88cee4b6f19ed73eb96625f7a3d546d57ba0c268cc1181 |
|
MD5 | 271462a3540637e8b282738000f75e7a |
|
BLAKE2b-256 | dc9bd8af83ba3dedba7847b357cd45c708c33464ecd97716d88bd357cbc5e1ae |
Hashes for y_py-0.5.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c789dd17484dccafabf4ba1b38b5f5b2ecdf8b48c7d9ac6213aab2cee1bc2ae |
|
MD5 | b6c49988aaf2e0ecf54f80de7193ddb7 |
|
BLAKE2b-256 | 9b642bb985c21be54dcdacfbc510ee5b30a87545715fe9908c0226ee6f22f236 |
Hashes for y_py-0.5.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8d7fa566584c73b98e9a7be379e7da43cf67b07f634e56d543fe34bf9db4ed |
|
MD5 | 535cf95758097dcc920c0ef7ca7843a8 |
|
BLAKE2b-256 | 5e195b4e17d104ff47c5b5f4a47525566d3043bd0924d564f330477fbfedec8b |
Hashes for y_py-0.5.3-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 318392d6bed28140a5f5ab4f18302335b5ca38f798a7583c6493db5386f2677c |
|
MD5 | 1ce4d509be207cb6442abb709235475b |
|
BLAKE2b-256 | ba5363021275b49903a5bd8f8dde7e01dae7baf32d13034c1e5983ef69d6beb4 |
Hashes for y_py-0.5.3-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2470c1bb48dc6c342b1a5d7fe559f37b47459264798787439e6778661753d47 |
|
MD5 | 0d587ce08e8160db8fb342cd46030ca5 |
|
BLAKE2b-256 | bb7c8d45ba06d202bfd75ae309bd846707a1f8ca7f6a4eb171dd7bcaa7b964a0 |
Hashes for y_py-0.5.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f7bbb1df2e1843b7b63f3f0d5e43bf61ccaecb2a1263c734c8299d4b5a34f69 |
|
MD5 | ae6ebade8d72ecdbaad709ce69098db0 |
|
BLAKE2b-256 | 6ad9cff64cbc486c95e9fd2cd7b423483590f82f291dac89068d637043f7d157 |
Hashes for y_py-0.5.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af8645e182cd5e5f309c99b01d8f1386e1eecbd74103cf7f65a0fb851651cbd5 |
|
MD5 | 464ccd8b5de3c8515c2151314561049d |
|
BLAKE2b-256 | cc3a104cfda9551ffa8a585750cfba1ea7bac1e6976a2e972e3a7be53a9cfa90 |
Hashes for y_py-0.5.3-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a82979c08135de5315f142cff528f63d9663393b36d87dfc7437e7ef33321a |
|
MD5 | 03291c7dce0b41a8103b14ee737938c2 |
|
BLAKE2b-256 | 9b16dc9fb295e77c73a353b64e410b72b60af1fe66c24009641a896169bf5d89 |
Hashes for y_py-0.5.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7471d0920f7955719a5f37904319aa591b949b0cefff62eb1bc5686a3b16306a |
|
MD5 | f186a0bdbbece058767598abf408b4e2 |
|
BLAKE2b-256 | 84fbc65b0d3c4a606a368f364b68ecc7d26cc056fa7c47aaf6e0adcef05ca2d2 |
Hashes for y_py-0.5.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9e90656fa9918542c8ef6ad6d40845fcc885644a54e6b52e3d2b48e141f67ba |
|
MD5 | 1618d1457290b2aab9f4a05b198c411d |
|
BLAKE2b-256 | 063a40023ed2bcea31facb0898de0ea330e155cd193d921326ceafe29659ecb9 |
Hashes for y_py-0.5.3-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc4db08b796e1d6f9049a2d992ca73e490655648b2137bb1dd90dd826c53b2e9 |
|
MD5 | 16e3fd241567eb0cb88a7bd6ba0acacc |
|
BLAKE2b-256 | 37c58c3eca62bb15f9461378296904d0d33735d514e14358df5d18362043ca91 |
Hashes for y_py-0.5.3-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a59cdc24e061a56c3e033c3aea359bb2f6716b664004529d1262d21ecb3def4 |
|
MD5 | e0fea03cfdde720ddc665c46cace46fc |
|
BLAKE2b-256 | 23528df526485ff9dbc2eecea224218277611da7cae4c2cfb4aa768132583be2 |