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.5.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5191fdd7f70a4bad135af24d8e4f2ffddade4a44598a6b1430f6d3b3b6eac3b8 |
|
MD5 | b1ed967a51fc919d064a46385b2a24dc |
|
BLAKE2b-256 | f22c83814c4db21d417c947ff9bf454a9a429bb44f461873810393a4f68abe10 |
Hashes for y_py-0.5.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b7e90abbbdd533523a10d22f03dd7e2fe72c991b9df16e159f049385b05fb95 |
|
MD5 | 0c6a54a8a025f123687ffdafaa4c9c5e |
|
BLAKE2b-256 | 6a91d4d2fcb3e2d470cd3d29d2863397f63ddf896b431dea3bf9d1e2c6f73628 |
Hashes for y_py-0.5.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07b9bb9039157e684f16c47fdaf3d08334874ec97ecc8f3c450dd41d072cde3a |
|
MD5 | 3bfbd2516f9278d76adbb5f5e10529c6 |
|
BLAKE2b-256 | 83ce17e1809e2a6100765741cfd34f7e90a6a663f17beee119806f70baa57aee |
Hashes for y_py-0.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bb4856453c7b52da020b03de20ea111a5eae3b6b7448a5cef32b910509c72fe |
|
MD5 | 10b3f69a442a19d7af6ff35bdf7b4bef |
|
BLAKE2b-256 | c3e8ab1a5ba7cc4fa75cc322a90c7dd12e3f4165c9053ec09b9ad4351f6ee065 |
Hashes for y_py-0.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc25b4c3f9e248353293ab05988525f5e8b8a9c0c8e5228278c2bfa95d30b08d |
|
MD5 | d013a5c45ddefae973d2d541a3092ad4 |
|
BLAKE2b-256 | f0693e5ab6cb678f8eefd0c7c8d482c8a5874d037723a2f53e82a11a6b0d7f0f |
Hashes for y_py-0.5.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73746abb0bfb273b807371d0ebffad9c635e601fe691458718e18990bb3a6e6c |
|
MD5 | 69cb3b4af2f50c4a95d46b3e85836450 |
|
BLAKE2b-256 | 3e1bf684a793a7f589a6d311111855ce10785fc1ee247bfe464892a7594cb85a |
Hashes for y_py-0.5.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dce4f492c6e06c67242241ce27d7864343291fbc6d8ac6b22c5fd062c989e193 |
|
MD5 | e3396825b4195250eb2996e961d9f252 |
|
BLAKE2b-256 | a065fe231ce724fee44f854794f9eb44ed1afe89bbad1de2328a3e0c259e804c |
Hashes for y_py-0.5.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a87afc7f986367ae5ca46519a88d00858d984e7b049455fd728f2ffba0f03f3 |
|
MD5 | 836b36582395ec8455f3697f0a385049 |
|
BLAKE2b-256 | 6b052df3ddb5de86fca87cd1afe110ea4216f3347adab7cec827d40d765a2c76 |
Hashes for y_py-0.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f63278dff66953e56a664d0369d51b092d1b4ca231da0e69d12af131fc82444 |
|
MD5 | ca52c99a6634388b5c6869f39a556091 |
|
BLAKE2b-256 | a44c2969210795e919264917c244a1ae49c90aa5c15d1725774ebc65006aed5e |
Hashes for y_py-0.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2c7f31f40ba13905798974db44c0930d2f94746513fc225c9ed38e1143b41f7 |
|
MD5 | 5692c6f3a208e1a9b44cd16b261ab467 |
|
BLAKE2b-256 | 179af41c15a7c80f4f60c522232417fef8041c5163bb079e7b03ff6e8bc0248f |
Hashes for y_py-0.5.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c8579fd265b6d8001e3c30c9607e72b9def9b60babc951dec8025eeac97dde6 |
|
MD5 | d33583eb44ca648ac7c09914ebddac81 |
|
BLAKE2b-256 | 4a5fec214646f64761f3067405bb831a261cf49c99bb93d55657929be777fc76 |
Hashes for y_py-0.5.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66699e79601cbde6133a37691a340b4f613d7fcae3e9b5b4740cb9c203c85177 |
|
MD5 | ca3e4dd0c3c87b401d95f9ae2f5a2e58 |
|
BLAKE2b-256 | d0505cc96f7b28ff021fd75e3eb633d8461bbd671abc5ee200820d414f171b6f |
Hashes for y_py-0.5.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b4eabbdde0a99e7d029719f225b21a9e12ab57a7635fe3a0c866b18f244c348 |
|
MD5 | 96eec17650b4dc0eda3ec66cfc310452 |
|
BLAKE2b-256 | 3d22021c86e3c51884f041fa314a2e707725bc81f00c915b3d86777876cfb344 |
Hashes for y_py-0.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e196de2fba239f09d14853004eccb91158306648f5accfe92d8cb9b87e86c7f |
|
MD5 | 3c3f905fc110ffaa294593a1b400a0da |
|
BLAKE2b-256 | d7ee6bba680c91dfd93c02624e3f05476622a9fd5f7b04eb9ad8be5b5f478ff1 |
Hashes for y_py-0.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c25475dad1c9440f76f0932179746a7122eb20d7a8ce9c0897e5ad60abe48796 |
|
MD5 | f0130aed39546b73adff241dcfff60b4 |
|
BLAKE2b-256 | 783f7b1306862ecbea1f3646504c370001c2e05cf533c88298b351934028b60f |
Hashes for y_py-0.5.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d15a5fb0650c17f215303643a6e48ca6411dfb3b01cc442f072b3013b83e7ca |
|
MD5 | 28f735fc7d7fa2445b7ff8db87aa4e67 |
|
BLAKE2b-256 | 1672c693b338a68f32ef9b7a32d9cbaefe538eccfc20122b2fc36102401569e8 |
Hashes for y_py-0.5.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff75eb2267a864cddd9088a67c881bc3d2218d435cbf928c05101f867a4e179f |
|
MD5 | fb31eb0c63632f347afd26996aa500aa |
|
BLAKE2b-256 | 15932b84c56fad892cb10dfb887c5613c0a121d4e6017f7de29e171fe87bea16 |
Hashes for y_py-0.5.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1817f495bbcc17947575f5cdd57e635b8fee4faa405b5ae1ff02a36ee182d731 |
|
MD5 | bd946b34da79d491eaafaf6fe30ed408 |
|
BLAKE2b-256 | e32fa7aa05cd8b912c8f5dcb67c60bad7fd79147bdc3d71e1f5590e16541fba8 |
Hashes for y_py-0.5.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adae327db74d18066360b41e8fa45c9094f7cae039da4f1f0699913c83e0f6df |
|
MD5 | 5c87062701411407c9aa004ced4a16ce |
|
BLAKE2b-256 | 113ca92233d56c9910114b8d69a9efa9e42ff09c3636a7bbc4d9823ec76da5b6 |
Hashes for y_py-0.5.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba5f2da058f4d0f899d0e7900644671e0c00397571acbf2eafc7bb9cfb727b3 |
|
MD5 | dfe367e6ca0e9e13740c8e72446025c5 |
|
BLAKE2b-256 | 9ac7fba10af199e302fb3f8ca239ecde0783b54e32c40c6c495c02f69f323027 |