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.4-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 626f2d2325e5c03ace5d38fddb003c5ec276d4acb9480e4743518c3c88d69ca3 |
|
MD5 | 29abc2b5e445edce555eee4372c86a01 |
|
BLAKE2b-256 | 77915fc1cd2710d32cfa5058bc5ea91619590451005f35c48bfdb40d08af8690 |
Hashes for y_py-0.5.4-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d87679c6bf5b0eff7d0b323beb967c73177a62ee866d0dc7f48877543b4df50 |
|
MD5 | 34315abdff037036b88ee617df7c204f |
|
BLAKE2b-256 | 9d703aa6a035ce1b4747286ae760a2e0151aff73c56a19cab8cf46d5dc25ab66 |
Hashes for y_py-0.5.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e33e5afaafae805ccd53aea1491f49a23c9ff680f107758da39dbc7cf334c956 |
|
MD5 | 2e43f986252a4ce34d4a6232bb36f9d3 |
|
BLAKE2b-256 | 0e10eccf7f6eb0c946a4b81edae24fc1e825a43d6d28136f820bf261913049c9 |
Hashes for y_py-0.5.4-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db126bcf8ca5f1890d93cdbf6d7b08fe23160e2ce70b57c33b5c3592e0cf3374 |
|
MD5 | ebf6df6218f320917e6105751a448957 |
|
BLAKE2b-256 | 130e70e611db7bcee68af95aff8f834fe8bf66ab3f0cae29c7a82198cc375528 |
Hashes for y_py-0.5.4-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbad5866eb7df8ee47abd1e7f59837c483c99cd267fcb1e7e735ca4992322cb3 |
|
MD5 | 7960ee82a1a8c7bed6291ce5ceab9f52 |
|
BLAKE2b-256 | a8991154bfa48d2bb0e6e21812d74032c3fbd19a211b074af53b73f6329213dc |
Hashes for y_py-0.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eec62ad463d0d1613456c233c00e813bfeca76d5a972e298c97fb654a5b8c2dc |
|
MD5 | f74c0e88d737ef5f726db42e88cc4238 |
|
BLAKE2b-256 | f88915b3dec6c18ccc97efd91f4986ea645be48f18e4a406232f9a42c2c9a18f |
Hashes for y_py-0.5.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a0462899170f01e213908589b985eabc101b5d2ed8a3545223d2dd8c32eefc0 |
|
MD5 | c2370f5bb61bac34c9e7563e971c32aa |
|
BLAKE2b-256 | 892fd178a72111ea983e7edcc24cf4cecfb15a0bfd13bd7ca7638f84b21efa2e |
Hashes for y_py-0.5.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ed92ebcedf52e019fdc5ef7335a3bc935ce8ca5724fdca138f1c7e2135c119 |
|
MD5 | decf6b3254af26ab5d7c4ecf7414716c |
|
BLAKE2b-256 | f16a180d96e08264c08057500eef2d40173729895214bea4dfa4708375c15a2a |
Hashes for y_py-0.5.4-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62ff3bbe4a82b0f828d40d69e1d60bda4f3566df61883a1c8f95b4ee4c4d9716 |
|
MD5 | f45b62e6b0049b604413723cdd971973 |
|
BLAKE2b-256 | d8eebc241f163be207daa61652d7472793bb06183a6d8b0b9c57c5795d183e76 |
Hashes for y_py-0.5.4-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e9f6e39fae774adcc2885081fe4a9a68c54bfd7f1bdeeeeedd6f77328f4ff72 |
|
MD5 | 1dec1257ee20cd207f8934c2ee41da4d |
|
BLAKE2b-256 | c72cc477a0597ef7eca95bc4445be7de4ab20b8d21d9f6cc0b672c350e6d198b |
Hashes for y_py-0.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94683afbc69c5e01f7fa31654561fc15d8b249341faf247f78621e249ac64be1 |
|
MD5 | 5cccc9ce072753f61d2b2658d15e7261 |
|
BLAKE2b-256 | f42ae72aa286736e43a58d73be4262e08c0312ae7b3f61f80efe38c8439e88d1 |
Hashes for y_py-0.5.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11e2339b90c6fb7fe8ef358c68f7623fafa78c9b1ec8d8e703c13d65742ebf5b |
|
MD5 | ca4eb2285e67cc460bebb8fef2a0aec4 |
|
BLAKE2b-256 | 50aebb2e20f0679c88dcf01cf11889f412733ed11777c4d4c1ec570f305f1a6a |
Hashes for y_py-0.5.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 510726a81e4d1a187754831a08d2d5c75e57a20d6d63d98ba252ef896e5dac0e |
|
MD5 | 089bf3fe26dd9fa4b559b55e4ed11fe7 |
|
BLAKE2b-256 | 817553d841ea650e4fdc0128ba8a6c2b195257cc421b2ae83e0e7f59ba9fb695 |
Hashes for y_py-0.5.4-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8fe5dd795d18b4468d00a34637aa17f5aeceb298963edd80f8faee89cfe4f8e |
|
MD5 | 884f900d37c17fc020ee48391a41619c |
|
BLAKE2b-256 | 4461bb2e0de80a8a1e7851057ef4953e2ab8c4491890a19fa20137fe7d710707 |
Hashes for y_py-0.5.4-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90fb0fc139dab70432e88be6e2012037c95e2f24398056138aa51cb7169c953f |
|
MD5 | 479a49f7f5be32a17c2952df5fdeb153 |
|
BLAKE2b-256 | 690f86786d1d74d72c6784d3c79ad680d8a0521ae6a776e2c0b8dd82b46a0b16 |
Hashes for y_py-0.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cba562ee041d6257b3591a3d1a317c19737a6237e0b863c98039612745c16ba |
|
MD5 | 78c4aaf5959224031446f7bf8c1ff3ce |
|
BLAKE2b-256 | 2acd166b6420a2a8d7c6f10d3022bd47b97a575a2d8d9009e35f7366d17272d4 |
Hashes for y_py-0.5.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4f4d50bdb3865bbd7a1efbe565111dda7b40d036e20aefae2449bafcde2ca7 |
|
MD5 | d7f90f53f1cd069b209815360c60f1e4 |
|
BLAKE2b-256 | 6893744e93719c67254e40236f712fcf2cbe0ef4bf1d0c3ded3de67ec70a4570 |
Hashes for y_py-0.5.4-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 611fb1ecc2487f76ec468cb08ba1083ae3377901f736a18a9792900225085f0e |
|
MD5 | aa10d6dcec1b423aecd152575256f25d |
|
BLAKE2b-256 | 764ebb149ec5a7a5912ae4097730e2698d3983258820f9c824c4f62512e91b32 |
Hashes for y_py-0.5.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 221df2750eb01cd284d9effb0b662a482dea6f7710e81589bc1493ed17983947 |
|
MD5 | 85b4fa69c47c644f20a99e038098bf9f |
|
BLAKE2b-256 | 33856e9b5b829b6812e335d7130bc17421bdb8127b22169958d93ff36be97d99 |
Hashes for y_py-0.5.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80878aed61e664d6a9035cbd22988ceae384c17d32a7cae2724b161ce558122d |
|
MD5 | fc9a8e11c5a1e8f000af109d3967a193 |
|
BLAKE2b-256 | 296e16a7f8a213c9071dc7766a1982f6491f0a866e5e267371931b1f2bc86c20 |
Hashes for y_py-0.5.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53ed530e9f5e9f1c755e2464c2e4b41a3dc3bd7842f6eb1632ba55f5ec1755d6 |
|
MD5 | babb5b02f65db90ab04d9e2d3f178a5c |
|
BLAKE2b-256 | 20f2329ed0d6d29a3748459c6035cb5df05e921b1fce29c8520eadac90d10c3e |
Hashes for y_py-0.5.4-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b01720ed1f6aa8967a116c1075621fdcd8e3149f6488ac2e70e759c2ca8cb51 |
|
MD5 | ed12955069685334215428d25ab0a7e5 |
|
BLAKE2b-256 | 48e790ad8cd37d2cec0851ed1c7e3f0768a5473d549cc297288ae421b8fe6aa9 |