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.6-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21d8ac7f2dda444499e9bd2df747f179515367ae2e960445128ce0361bc97d6c |
|
MD5 | 74e99fcde80e8c284baf3012811b202c |
|
BLAKE2b-256 | a8a57ab88135f4c59827c7fdbfdbaa8de2fbc2f3ada9c4296742ddaa11c08a26 |
Hashes for y_py-0.4.6-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32490ddd2f40e3cf2ba68302a222601d7e67c1f2f89675c392c57b514eaacea5 |
|
MD5 | 7d48858c71f3706b81713580855f1ee2 |
|
BLAKE2b-256 | fe3946ba0545f21c19c427cf8216d7da1a3617e62b8bc530abbd569fbdd9d159 |
Hashes for y_py-0.4.6-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e54e9fc6fa86ace04cbbcf1af598f32c8b27c5709bd33d36c05aadf6ef8c8905 |
|
MD5 | 01815178edcc75f92aaa2f0f7b85bd7c |
|
BLAKE2b-256 | 88033872066843856ab92704949640b6fb0012aace625fe868fb464e1ef89c11 |
Hashes for y_py-0.4.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f99bb8f93aa87160b14d51a8301c7053baf5b7db855f95df4d6ae75a711a8c3 |
|
MD5 | 583b73339710ff1df594f67e04a69e8c |
|
BLAKE2b-256 | 91138809163d335282c481583d9e06e5beab8b8f69bac642a40bb4623eb8d0e1 |
Hashes for y_py-0.4.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a7dc6093236ad84c8ae190881f24348f2f3d5fb04bd539896f454e4b6c5ffb3 |
|
MD5 | 84066a601c40c94659c429e5f8c2f67d |
|
BLAKE2b-256 | 371a903991f3c1c3068c9c491c9d1965ed9d2bfe19f689bd7d9adbea83cd4e81 |
Hashes for y_py-0.4.6-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28350708bd9a424a9c71b95a8449f599096516c2901d23b47f96391fdb5eacf5 |
|
MD5 | 133c466343e7a44485608439adfa55f9 |
|
BLAKE2b-256 | be02a5dff7973bd45c78b2e2f97c0ec7aab3f5c8d4ee4282af5ae90bdf6dd954 |
Hashes for y_py-0.4.6-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f17d858d01883acc98fe75998e0e3396203de8eda8fe6d3b1d3dd079d0109b8 |
|
MD5 | e370ea97941b544dd590d3507e556e3a |
|
BLAKE2b-256 | 57147becf936d13e7e85761215e1c74bd5af3a6d060b81b3a20a63c7df834dbb |
Hashes for y_py-0.4.6-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6afe04270c69da0142b784351bbb5963369fb6ea75c84158396b5d5e76a1ce36 |
|
MD5 | 539fa547640660f13bdaa5dc84ad1ad5 |
|
BLAKE2b-256 | c70098a82da0a5f97fb2732f1e54d0812313ea872bd4a8c2a46b29f1458b5d7d |
Hashes for y_py-0.4.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a453360c0dae9fcd19da156054ecb21311c8c981add5247b6d6791fad45d0c85 |
|
MD5 | 47067d938ba34a3b8ab8f676dc5d2bc6 |
|
BLAKE2b-256 | 1ee9e1760646e1fa5ba6256416293a86c8e458a7b0a3c5bb0a3abf6b5a8f5a64 |
Hashes for y_py-0.4.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79976f5d05c6f9628e7615d6706cd421f4cf471c08c4b5709797f6fc3bc724d8 |
|
MD5 | b5def372f14aefb60ff385580abb4c0e |
|
BLAKE2b-256 | 2464eef76bd5883e70367e6fc31a9d016d67fef045f52f6f259ed81516acbc7e |
Hashes for y_py-0.4.6-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01506dd74fb7319e01c808d6e7d70c2e42ca4071302a1d839d1f7425a13c3a2e |
|
MD5 | b2e54a6d1d09b301ffdba2021cc5ffca |
|
BLAKE2b-256 | fc569ed060a8e92e60e5dd7da310a209f1f0ffc7e5edb093c5953018670dab2d |
Hashes for y_py-0.4.6-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 616761a92570d8d487bbb14e99adf1d8af45565589f0db63318d3e29c86a9b0e |
|
MD5 | 5a635076c5689297ae8b9bb9f7df7cd2 |
|
BLAKE2b-256 | e3fedf11b5a5ad61c2e79246a2e478c1a27884e9be05bb84577c29af50b4b9be |
Hashes for y_py-0.4.6-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79d95e898d02768300843a6a79c694565d9a953b5c47cb2d6b71450913a471f4 |
|
MD5 | c59675bec1f2eec76037aa55f3953946 |
|
BLAKE2b-256 | 38c3dc44a432a46a20938087842e07fdfd28a956cb196db5e4966023c76fe945 |
Hashes for y_py-0.4.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787e4318f345e9926f4628f965f10c2a7ff88c8422d7aa7e250a78f506984bae |
|
MD5 | 7064da976f34829b3538d6aee4e75c55 |
|
BLAKE2b-256 | ff5788ed6287dd758a22f8af25546ad68a6d63997d64af7325e67732bd91e233 |
Hashes for y_py-0.4.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfaaefe0887a308d9f749dff623ece7c5275622acced8df1a2c897b6458aabf2 |
|
MD5 | a3ffdb85a24ec26e9439b655cce3bda2 |
|
BLAKE2b-256 | e162fb30e7f384f364077e6232e77a714a83070dd07330e0177f7dc7d39c0f5f |
Hashes for y_py-0.4.6-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72c797b058c3cd6d35e37dab6b4bae61bf187124c5bd6b69489c32ca1d9c12e3 |
|
MD5 | 7968b6a857e55a9a4464371fca536364 |
|
BLAKE2b-256 | 57be32eaa8d48e1e6776dc34ecc7614c8f73ca6c0fc1046fd95d5cda80d1d3cd |
Hashes for y_py-0.4.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 007698afc0f4f71b007139b9aa800fdb831be1a3a330d7c4cf1b37c6241d4bcd |
|
MD5 | a900403ec901d305a2747f2fdbfe4c0b |
|
BLAKE2b-256 | 22bc117d8f5f257639ac276f3039dc371176b066516e5a15d2acee974a93be1b |
Hashes for y_py-0.4.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ebe7ec7023a1877cc5790c95b5ba1229892c2c3e66bc681617015331ed78a98 |
|
MD5 | 95411f922f9dabe004bc362cb6e54f8f |
|
BLAKE2b-256 | 5086c41e4d3896cdf9d86e7b5c5fe0aabe02adbb5c73da484da76028883eb7dc |
Hashes for y_py-0.4.6-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e9251d7fa025f3bf9b76d856c23a63aaa91989bd24f47345bbc64db0d4d1f1 |
|
MD5 | cccd142ee69adfa7a9fabe0e3ff9bc40 |
|
BLAKE2b-256 | ba4e2ab3a89772f9df970b8b89c99f05dda3191cd1fb159d43334d65ce5995bd |
Hashes for y_py-0.4.6-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 320634156439034d964f2bc46dd7854edd01c4b0b9dc7aba178788c7626a263a |
|
MD5 | 6db4583b8e9be0283867ffed7934a940 |
|
BLAKE2b-256 | e72a3217655b23bc72ba0f5c2d4e58a9f46a3910ecfda873810d812de861747f |