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.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24d6dff119030bffed9cd27e18f3eeadac150ac2474323b89ad8061d8fa825f4 |
|
MD5 | 77e06581d11262e78c9ae620d8197279 |
|
BLAKE2b-256 | 8a272ceab2f168084fac292593949aeec0184636f255c176aa45a734d49cdb76 |
Hashes for y_py-0.4.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba70f9020d6ed4d01ecf0fb00940cc2d0da5568c3b9f55941b5de0ca9997fd42 |
|
MD5 | 2a53251a2ab26294de6196c8b629b73f |
|
BLAKE2b-256 | d13fe3193eed191149a71a8f55439e4638005b4869187ba1f16f4b5f4082150f |
Hashes for y_py-0.4.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b3110da6e76ba0a96e535a0f9e4f83f27b8a9af3630893a3a46107b5265e1f3 |
|
MD5 | ed3ca6117e133937caa3168b9e5e7f8f |
|
BLAKE2b-256 | 119fdfa595aeaed5187b36023c03b09239672c771f6d42756e1c6c6609dbf6e7 |
Hashes for y_py-0.4.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffa0505f09449b2ff0deddf85b894f9ac926209eb53d63ef538cc68ce7d6250a |
|
MD5 | 7e9ef137fe8bb6dbb2727e51c2062c86 |
|
BLAKE2b-256 | 22d6fcba07da0fd60dcd632d03f996eb8c9ac9e7239343f870b95965875b1820 |
Hashes for y_py-0.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41e2bf07adbe6aa94df581f153453f11ebe18554f64046086019c00ba47dfee1 |
|
MD5 | 93d670727473734c3fbe457f666d22e4 |
|
BLAKE2b-256 | dc211822f991b6f1150dcb45e89ec2a43014d39ab9788cf95a6caff5fa7ce81c |
Hashes for y_py-0.4.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f77a0a7c8216c3c9b1736823c330cee602fb19fc6663b705156a48900566aae |
|
MD5 | d064a92fc09d06f00267109958645c5a |
|
BLAKE2b-256 | 9ac949d2a482fa5c856b7ddc88fcc29810390560219e4b78f757f2046bd3160c |
Hashes for y_py-0.4.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ee1573b4265b9bd4166e69116ba2402e92f5cdbf66af9ad661bd85145d6ea2c |
|
MD5 | e98cd84816bcb2beb9f884e71c0c90ab |
|
BLAKE2b-256 | 4bf67d5fe97a588de1409ed8954c9010f7dc488956df55ad01125261b54904ba |
Hashes for y_py-0.4.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5059284d9a0c2cb4c9d39d85c04e9b7ef55935554f59493bf2d7095bea46459d |
|
MD5 | c289b97e5d85205997e9b0d45c10b134 |
|
BLAKE2b-256 | c2b40fd74fc4a0027828b6ad4aed96935c7a07bc599afacd8c8aa35d59542657 |
Hashes for y_py-0.4.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c658c4f853a61219d8def5fcf171a3c1755b8b065e2eec2927847c9e6176c849 |
|
MD5 | 761bfa0eed46fe1697f0d100cc385a57 |
|
BLAKE2b-256 | 270b73fb58147c0e022895bbc654ebc855fca974e6e8b30c933b9f58ea3f9972 |
Hashes for y_py-0.4.2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cc635380256aed4652d08a4d8b834f01cd11607e537700b719218e371a5755a |
|
MD5 | 9bd9b226b905b28e715738efb6901855 |
|
BLAKE2b-256 | b520818393ff51031c3cedfb1ae5f6d738fcbb4f8b06244bfb01eaf5e5abeebc |
Hashes for y_py-0.4.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ade157195d0866fec967c0a9424a30b5b1b2de71d407e1be5305d59e0ecf960 |
|
MD5 | 93865ee3d7f62354dca51881b225e485 |
|
BLAKE2b-256 | d7f673f7d4b4b7452212a9e4f83247874100027992758bcb1f1cf7ac780e74ff |
Hashes for y_py-0.4.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b27186e5645ba7e6d8d726fd05dc68489b995cbd92336f9f7bc76f40596daa9 |
|
MD5 | 4da3b4b488147878189694e4292b315c |
|
BLAKE2b-256 | 9927db11e1d910b74a5270bf7da687aa0c1c206505a3b28bb6625fdb5fbaa482 |
Hashes for y_py-0.4.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d9ab0e827c84487842d82c1122b8c5ccd42e870d4739a33ad8906c249078c9d |
|
MD5 | c058e853aac1485eb1c1cea5457b1f62 |
|
BLAKE2b-256 | 05b3476c711ffb5016557d53b87b7f2354ddcdfd0fd4db94daff0445f113517d |
Hashes for y_py-0.4.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 603b1273e8d9fb89295b663b0c98faeec9fe66c6d03053702dfa206b0e967fe3 |
|
MD5 | 80aca99b8013c4d586d93e04f5e1366e |
|
BLAKE2b-256 | c7dec30775ec02d9301ecbf6f3977990665427dc5cd68dee070a3d8010c42967 |
Hashes for y_py-0.4.2-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5646b04f321358492cef8e6cd8b63a37886f5ea6a38656061e85e57292e272c |
|
MD5 | 4355a34fe41980a7136f7d53acbf1a8a |
|
BLAKE2b-256 | c1ed1814e68d90574bb28aca9f5e534a441b103f6e4a22adb6f1d0ac3cc04454 |
Hashes for y_py-0.4.2-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d008dfc8f9d0890d6841cba1cd2eca00ad72d8676f960903da35029c613663f0 |
|
MD5 | 2f00785472775b16fccfc8015b297580 |
|
BLAKE2b-256 | f1c024cce7b1ef720dea5ac8c1bd5492980d8ebd5927943a33a940ae1f900ebd |
Hashes for y_py-0.4.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ff661cc2d629edee5f1285d572ac39a4a3ba7ac8a23d6ec592c83815ba5315a |
|
MD5 | 2276c34c2b3b50d07ee405b57e7e7f4c |
|
BLAKE2b-256 | 71279bf5e0a994777bcd3167fe50695f8ee5c9cb443bea9fda4841e0ca1d3843 |
Hashes for y_py-0.4.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc23486e5979c646a855ea2d3965b589781addd9ed665c0a25191df94d7b97f9 |
|
MD5 | 5c8be841dda0bb1b6a9d1a81a0506eea |
|
BLAKE2b-256 | 54923be6cacb993ce5ddeb7c0a2ccac40844cef6292e75a7e7f0f31567bc91df |