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 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.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ce3d7d8121a2803947d45b6afc53f66d2d6eb8a6f3f37eb459470acf6591612 |
|
MD5 | cd4e3ffbc2f01bb49c4095d43d8e1544 |
|
BLAKE2b-256 | 7927a76cdd0b04ab0361b146146965f73cc6d5aaa428ce1e5bdd19a5a47e6b86 |
Hashes for y_py-0.5.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c0f69e3badfc789eb9e5788c848dd02226aa6edd15aea2982271a2f43a4358a |
|
MD5 | 877a556092f67543cd0ea1a62e75b9f0 |
|
BLAKE2b-256 | 32b0c5c25c28e6fc8e9d8e7d778313c8c29a119289010de588bf3c9f4b57e14a |
Hashes for y_py-0.5.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d5e1bbe2b8f71a1283ab0f665d6fbfadb62c24923ed0db443c8a03ce786a6ed |
|
MD5 | 2b8d375cb4993663e4547a212d1dfb3c |
|
BLAKE2b-256 | d25cbad88bf2a1486dc79fc61d49960d42d016777b2304368160d4fe7cbb4881 |
Hashes for y_py-0.5.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63512b6f5492b5382a53c9ac4890343c1113157c40c637563969941d7ed30712 |
|
MD5 | daa4ec12ea11c678d40788aeba6292f7 |
|
BLAKE2b-256 | 2e3ca0043c27df29d6a871b5b5261225ce934b3fb22aedf3fd2adbc27f3592f5 |
Hashes for y_py-0.5.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e36ab81d22a960bb118bbd90f0edf43173825c4d10a2dbe676611721aa8cdcc |
|
MD5 | deed6127acc0ce4ce870edb9003539f7 |
|
BLAKE2b-256 | 9897781810ef051c2a25f817c0df6dbbcdcb7f0bc0d6ba884b57bc97ad9702c6 |
Hashes for y_py-0.5.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fa2280e9ebb6ccfc330cbee688565badd0c47acc6dc535cba0ba88090d63819 |
|
MD5 | a61f750240b745cb03b45c79e4706f1a |
|
BLAKE2b-256 | 8ebc4eca8d9a3b6daad279c2e67e0a8f347d74974ec9354aece5cad602f856b7 |
Hashes for y_py-0.5.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ea8330c525d7af2d819e665e6dbc7028e921122507687ad1764de3383c38a09 |
|
MD5 | 9cbb5dddb1b781e977ff12cbeba8cd77 |
|
BLAKE2b-256 | e88ed9c2fb4e8b43284d6db7a5dc0376c946a90fd870cc27030d965448c81341 |
Hashes for y_py-0.5.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aff9f405d0d2a4a3ed608297611ac2e38dbc6c8d2ee8cff140534c791a28c016 |
|
MD5 | 1c9dbe5ed457f94eac8f00fdcdc78d5e |
|
BLAKE2b-256 | 3e4eb2e1d6e37d1c439c6f10d2155785c3bd341152a9a6d039c8849bb9c32bf0 |
Hashes for y_py-0.5.2-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cce3910a765c5de8e6dd50e55583e3376e118b6038f290db5ed2e256b54ea37 |
|
MD5 | 6db2b2a803443de71cf93de787d4cd4f |
|
BLAKE2b-256 | 0ca40bcd0459bf330fdae245d9d7ec5c18a5b4cf92fc5168922ea81faafd84fe |
Hashes for y_py-0.5.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9082daf3e16e159cd66a042e7a2f7b76e924e903978502c7090e18aa6a54e1e |
|
MD5 | b007207b7bee702dc7dd182cfe19ccac |
|
BLAKE2b-256 | ee61fa2fc33a9073066167f5005715dc96a8fb950cfbe1c543b1d41f20d32f2e |
Hashes for y_py-0.5.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 409a8e1983ead82d56681cfdc3a02f177912cd4fd27c99fcf5c3273966a3b3d4 |
|
MD5 | 15af90976a243ad9e6431c91452f9b59 |
|
BLAKE2b-256 | 84cb8954dbdedd6dee3905b7766ad7de1c7361fe7d45a5d3139e8197b410df11 |
Hashes for y_py-0.5.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a1134978f20cf6b7648151f9d58677665b67dbc828157d79deba5ee4e5a184a |
|
MD5 | 5bce1f96c404e614e7eb5a0c09103b5b |
|
BLAKE2b-256 | ac6477a9ad407f640639859240c43b538eb09f677dded8cc4225107ee8dff6a3 |
Hashes for y_py-0.5.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7398e22b9602f9ba36ba26e58dba9f8d9736d588c9aacdca8907c2a2587eafd9 |
|
MD5 | 899c20e877d9bb1691fe136d88fd8662 |
|
BLAKE2b-256 | 3bbea4d127140b0587d7898f48125b71ecd44732d04946c9b6ce646ccc7e476e |
Hashes for y_py-0.5.2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65a79e9fa1839109d26896100f89232785e77e72cd7d54c9f005132c6c58e1f0 |
|
MD5 | d12616e1cb992f35548f88296cd729bc |
|
BLAKE2b-256 | ac8f7d6f1bda5aeb0844b23ebce590661cae05539302e2cacf3e9b1e1bab3ec5 |
Hashes for y_py-0.5.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b0dbd129bce5e1fdb4ce12895e81483c3cd452ace25ab185b23b7d0d4878963 |
|
MD5 | de140911b68224545843f57022d63efe |
|
BLAKE2b-256 | 3a90f73b56fd71cc6ce0b8e623eb3b560cb98a688b569a393f4caa6a54fda57a |
Hashes for y_py-0.5.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b001bf44e55ccbfef8627b6945a4ead397fd7fea8f3861937d81e900b517659 |
|
MD5 | 46ac21de76e5c10c96822975bbd0c707 |
|
BLAKE2b-256 | 4d02b46f2792382374eabe1fdf9aa3c829d21fa61e3895aad825d970f41596d6 |
Hashes for y_py-0.5.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7692141df7412a5a8ebaff54a3b37c49824913c34d7bf5dac9ef78b36d696f |
|
MD5 | c4d3921957e42de4cb388038dc75f1f1 |
|
BLAKE2b-256 | c4cfa6d0cc2722c4839209d147c08ff6e81b1dcf9b0f91d4f35fc7822c9fde5d |
Hashes for y_py-0.5.2-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6252e728ce09be3640569e4add99be5b6f864af92c89a62a49f9b609bcad5474 |
|
MD5 | 547feebc4c52bd21b3088d096514f5e4 |
|
BLAKE2b-256 | 72908ee7279db7edc18c0d1808da2059ba160480703a7e67e30a21c3ec7a6053 |
Hashes for y_py-0.5.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b9e11b9cbb03ae9b6ecc7423e558d625d593d880656e9a7c665766dba9b2c0e |
|
MD5 | 7628dad98bd005e419cdf2b25f97f509 |
|
BLAKE2b-256 | d7ade17f3fbe41ba469132ef583e2daedd7ab1e101a6b49dcdc61c2b098e90a2 |
Hashes for y_py-0.5.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d45f3db288d9e5782f915060e54fb97c70c808f740bea60bdfba15d75073f5e |
|
MD5 | 3735c3a6e7a23205f3b968ca602c179c |
|
BLAKE2b-256 | f7d77628546ad98ef7b32aac1615612afe2c22cfc47db4e14871fbfb41cca303 |
Hashes for y_py-0.5.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5529e9a3f90188343a4146352528d69ac534280091a0913ae072bf92baedd55 |
|
MD5 | c5810aebd1ab8b2d1859061bbf215378 |
|
BLAKE2b-256 | 9bebc541218ddd95506490ebe7dd19ecf871dcda1e70d4afe0951b7bd82f268b |
Hashes for y_py-0.5.2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7de6d76622714efcb2e1232fcb6cdde7d9a4438e6dbb509dbe7cd7e9f5aa3383 |
|
MD5 | b169acb5acd35fd46dddc0c6cce05522 |
|
BLAKE2b-256 | a094349108c97eb04592eb05520ff37b6f85fd4e770293e2e481e59eec557719 |