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.3-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64b5d506400d0b4465168eabba66b0d5307999eeb02fa0516294d6d34b676b5f |
|
MD5 | 994af88fce562ba5f99b4b8e66a3de63 |
|
BLAKE2b-256 | 1ab5b9081b7410d4d913a0f08e4900b4728f8e246c25ed4df6d143a2a2ca1651 |
Hashes for y_py-0.4.3-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28025702525226c93e956f980bf8830b7d5d457eeeed95c73506feda601211ff |
|
MD5 | 1ac5b02488c4b44e24c6e0e1b590616a |
|
BLAKE2b-256 | 8ff20aa1a05bdfbac8f1befce6367fc7223971d6de0ebae36d7f6ce0abab2097 |
Hashes for y_py-0.4.3-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0db757215e9e494aa21eefd7ba45e67b4d3b13df5b844f85829ce08e3eec9137 |
|
MD5 | 53d82103b8f8d8543b82993e5f74eeab |
|
BLAKE2b-256 | 80240bd2f6ffb35897f46cedc8e9d71d3b60f4e1295ebcbe103914fae67a4e35 |
Hashes for y_py-0.4.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5710b87c1493ccc71154334ead83dbb8dd9fa51d63f3c0ab1f40f614b269fe68 |
|
MD5 | f88acc0e0f9dc3dd02814a813f8fea21 |
|
BLAKE2b-256 | e8c5242aacba0384a2f8c7eba1a8b10f1ba3b53c70af5d90e9cd2d385d26e0d2 |
Hashes for y_py-0.4.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0850d6fceb032fe0d95753c67c843c468f0d8244bda3c170c2b2e82e3d2437f |
|
MD5 | 9693c6cc338875994cc5b500bf57e0e8 |
|
BLAKE2b-256 | 238bea3d252609472026f3a967e23d3f71384d52b5e6a8163776eb82929a54a2 |
Hashes for y_py-0.4.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb159cd9fe82ab2964a550cf253ccf79be23494f3a1b22d74c341d4e0271fa8b |
|
MD5 | cfb534eb303bfe7c4a3d2faac271988a |
|
BLAKE2b-256 | 269d0249961702e0a25c0d611e661c1db255ca3d3879d8657954861c436fb9ea |
Hashes for y_py-0.4.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2b01c828e17e71e2d60b4e5ba2d1cc04ae2e3d3a2a2e4c04964529313ccee77 |
|
MD5 | 76eff3cd6e44fc8a6deffe94844bc791 |
|
BLAKE2b-256 | 30bf3921aaa849a97e97e9a24350c2635df485b2e9a600c830c51f3794205dc2 |
Hashes for y_py-0.4.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31796ae3d0cae323d6a6e6b6b03b333796fb35a7fd1f0f52811b8edd87cbd6e6 |
|
MD5 | cb90b24ba2f3c8740ec521f647e30e23 |
|
BLAKE2b-256 | 4b376537e8988bdcfcdbf5e49bbc97f84fb5baf6e3e2087d70c65511311d762e |
Hashes for y_py-0.4.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e31d9344796f4c71eae5b7241712ef44514ddf9aef83addb0effc3fb8500340 |
|
MD5 | 02386cbc1fdbbc6836d561010f8f549a |
|
BLAKE2b-256 | 2d5444294643e504cd0be89a50808f9e97abe3376d3788f74eeff2496d16aa9a |
Hashes for y_py-0.4.3-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60fae16ecee074393f3853f0106a539b26a62788e02eb0366dd0236e4a88f5a7 |
|
MD5 | 5e4d5506652f84cdb0fc730df990b5e9 |
|
BLAKE2b-256 | 4c4227d215ca5bd4b4d9546ffcacd6b1f2d6eb66150f9b6be14023c0fa759166 |
Hashes for y_py-0.4.3-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e06ecb2273c804ea0bee2bd59c97d399519348feb6282981c2ebef450e8976b |
|
MD5 | 8288773682f252fd0a8a91c5f97eb074 |
|
BLAKE2b-256 | 39e27d63e78ab341b716ad2a5697f2b108cbc2945bd73d21dbfe29dd892b36f3 |
Hashes for y_py-0.4.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f405d99bece8e0f3886258d03efcf3262a480409438a58eb3fb0240060f8932 |
|
MD5 | e962fc08f074d9b02b91f462af314e12 |
|
BLAKE2b-256 | 51d1653d0f5b4d5d8e32cf2d47fcdb716c12b8f8cdbf4ae97ca2084cb976fded |
Hashes for y_py-0.4.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa9f533c0043e5cf0f5b59f4c81dff0f6e216c2981f0c7c4a791dc0a07ef7814 |
|
MD5 | 1cbc185521a2548f2d01c875e641a1a2 |
|
BLAKE2b-256 | e72b7bcdecc0014e6940f7d4dc4cb5d3fa95c5998afc20aa34686ed3b5813565 |
Hashes for y_py-0.4.3-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d265a732b8fc38fba599e92a56c13fc25e431242f56615c6ef1249c09f5a1b9 |
|
MD5 | 5a94c5b0031d05c2a38d073f88e413de |
|
BLAKE2b-256 | 973df2960d83c9e08dc2d364b9793cada058896e9c724f9b0adc5356f6cc173b |
Hashes for y_py-0.4.3-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3619b0674637ec892d0a91c1f202811cd7b883494248457471b120e818ce7926 |
|
MD5 | e0ec6ff84ce163e6852ce0ecb20a5f84 |
|
BLAKE2b-256 | 702bb2f4f7894bc39fae74db1f348c526f71cd40fd414a305daeaba63ccc540f |
Hashes for y_py-0.4.3-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8378c77f33daa65f897320a79a7e7e9100ef2ec3f89b28e02c631b71dfb9acaa |
|
MD5 | 985de331ffe3c9ad24c7ba159b1fa5b1 |
|
BLAKE2b-256 | 201c554d274770b970567a05473808438a5f04c4358f41326c387513cd06b12e |
Hashes for y_py-0.4.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af2c695d1fff155403860380ad42f62abf477249fac3365a01b041bc25c6a88b |
|
MD5 | 4c4b803478856736421a618604e5bf7d |
|
BLAKE2b-256 | 99df0c89dde008a1c39e6d082a65cb4a8b4c93c672c3e472317e98d6c48971e4 |
Hashes for y_py-0.4.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a460196c0da05b7f130869662e7f3fa4f3ec930d70c12fba18339ce3b5d6acab |
|
MD5 | 642a57639288eff364cd9ce245ab8f2a |
|
BLAKE2b-256 | 8dea23bd087c7cde3835dcaa0ae2eaade669812b767587ea44ec42a29e230b99 |