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.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa6518b777f66de6be92d509969c11f4f95cfc69f6f0c36e38833041b5457435 |
|
MD5 | a0b29c949264fe718aff5e632f49caf9 |
|
BLAKE2b-256 | 5a7e6ec2e5162aa45c89c7970815c95582f78865931207bad778ec684c57106f |
Hashes for y_py-0.4.4-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdb1e9f438a4ff43b228005e27d1408980a82cc936ac19279a98621509fda416 |
|
MD5 | 095e6b174043b3f404df970d110bfb94 |
|
BLAKE2b-256 | 03be15ed0ee331c22cd026e63669d2373775293047b6797c68c53cb3bb7f2549 |
Hashes for y_py-0.4.4-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1c9ae8ed41858cffccd1f1f1645c5cb350a81017ff4e6e8c0111a3cdd607502 |
|
MD5 | c5ca4200fbfc8036dce3be3105869183 |
|
BLAKE2b-256 | 13c6ce89adf6b05fdf2d8f05c1ee8644aa3a01a7ec89f2731526355b58f49b13 |
Hashes for y_py-0.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a2c1075595a16acb2e5b36c8067c5a44403cbe1b9e148e9b82ec9b7ae4be580 |
|
MD5 | a8db8e27127a7ef77e604006f1e40db5 |
|
BLAKE2b-256 | a7724f130ef8fe96bace25db9f03e8c4265a5560e1fd66e166cd455709c9ffa7 |
Hashes for y_py-0.4.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35a884757af6e7a816341a9b36a88a32a11cbc6875f4dd7e03cd9cf790bf2d67 |
|
MD5 | 558784adfe2f9276fb2080411723e10c |
|
BLAKE2b-256 | 2c9ead7394354fdb823a391ccb9a60b39ffba3770da568b8d2a17855983da5e9 |
Hashes for y_py-0.4.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b5d035249ba088be9d0c0158e10f3b06649c6d80c686a54dbcc09f23aa2f8b5 |
|
MD5 | e11ae7925b80770be00e7d5840b7213c |
|
BLAKE2b-256 | 51cc914617152d0edd80332e4a72f4786ea18cb712cb9860833a9e593cd4f25f |
Hashes for y_py-0.4.4-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a44f023e7b4e7de70135cb33b6166bfca58bf8c340a345f9873f2a03b4f46603 |
|
MD5 | 6eaa1921d6b4ecb9cc8635d17dc118e8 |
|
BLAKE2b-256 | 424bcaf2e99c0d1bc1afccfcc56df48ddfeaa094c988f77908d4dbe681f47085 |
Hashes for y_py-0.4.4-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2849014f30ea9b20a49d010c8cedee1b8c4e0b2861009b290d3f7155c92b13d5 |
|
MD5 | 2138e90a1686dd95d7c5ed14a959bcdf |
|
BLAKE2b-256 | 7390a32a65b228c27f40def476c831d88f3cde26b843401d9cf4cd36daf6fc3c |
Hashes for y_py-0.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b6dddd20db881c227f2f652cc4aa4034231bc798889d33208248d2da02a5672 |
|
MD5 | 875138030e6f6f26a9fd7439d42078c7 |
|
BLAKE2b-256 | 554b5786f132014ae0d823231ece789420506ae8e9a6f9e8d1f8a737c365f9c4 |
Hashes for y_py-0.4.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45c91acd3e68b0be160b9e44add00d585309d35bbe6f02291223fea7a4d3d781 |
|
MD5 | e1b87d0cc012a7e895007d475e166ff5 |
|
BLAKE2b-256 | b7a29bdf6a8454f89425fc73cbf87e78f857f8aec191836675959b5f61fdd963 |
Hashes for y_py-0.4.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545a125b01ede956a6edb2f4d8d1c74be39297b2ccd89f5cb71d38aa32915512 |
|
MD5 | 4477d1621f78d9ae717840a2c61d8882 |
|
BLAKE2b-256 | 60e0dc517f26ba7f75df668fea1a4b160c5386668709d80f347f4d3a86dee86f |
Hashes for y_py-0.4.4-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff68d7a264295e3983df3c04ce25f97611833d15359d457136ff37297e02f53f |
|
MD5 | b65b5adf780e3192d529d9d925a4cc86 |
|
BLAKE2b-256 | e3a51b34b7551fd3f6b04901bff5cd4fed0e98f069ac728e668ff0f60e581dab |
Hashes for y_py-0.4.4-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0cf51dec353fa160f6a00c48e95a7dc01399dd90cdb2b6205f09f342c4cad84 |
|
MD5 | bc03dbd1e2c70d85bc079d041ef3c0e4 |
|
BLAKE2b-256 | f10398b4041a89b0a3ff9b224ccf60e32032196737b074c249da51fd7ddb4c23 |
Hashes for y_py-0.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db372aced560bffd6619f7f8287697dce1a405f72428f472c29679cfc3156004 |
|
MD5 | 599d33b02690f7a3d2ae52a1b2961c4f |
|
BLAKE2b-256 | 9683ef7997ed2924f3087a7302d0b4500a692b1dee58be1f9b0ec4c9aa47a0eb |
Hashes for y_py-0.4.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe6b17452192f75fbd64f1d6e5b2ff17f6a5be740df15d4768503f04a174fc0f |
|
MD5 | d5d60e4d129ac1b92e67bc62491494cf |
|
BLAKE2b-256 | 434add34a9d3c861940d419f082dfb6f65e9351eb799010dc0e7d25a6523e7fd |
Hashes for y_py-0.4.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0faf5b4bd6d524b238a58911a7ebdffc555df41f55065769424f8c3f4afc4476 |
|
MD5 | 91e6abd709e6bec68ce994b476898920 |
|
BLAKE2b-256 | f59534c8c5de7910a20d3a5db484208ee64a2684f3bead93778031c2e5b0cc80 |
Hashes for y_py-0.4.4-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fbf8eced83449797a8ca5f4d29afe621760c31aae47cbdabbe23dbf1cc1dd19 |
|
MD5 | 30a59cdabbfcd4c3bec44521a5f3f431 |
|
BLAKE2b-256 | b23fba5e41fc686a4a299f32075183811bac9d108b150a58460456b90ed06240 |
Hashes for y_py-0.4.4-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd5b6fcdd0fb30961eba3c5c47062161a8c17017de7c207724bdc0064a98a347 |
|
MD5 | d7dc646670435172effe78a640a0cf0e |
|
BLAKE2b-256 | 144fe0d9de6a95567546ba77a106b06b040fd6b6c6a096b34fde72191e55aa9c |
Hashes for y_py-0.4.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c073e7fee74f92878dc9fa7fa927302068f30f2584a816cc3ed30a1f55925406 |
|
MD5 | 0afbb9a733979e258170a5ce2ac01c67 |
|
BLAKE2b-256 | b34741a4fc97fa607d768bb42a9a54c8be3911f15043ec787ffc6081f729bf27 |
Hashes for y_py-0.4.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd01b0623555ea459ee50bcda7b5165e6635e1446cbd2bab221c92d86a890de |
|
MD5 | 86260fe616991095368edd57a1032bee |
|
BLAKE2b-256 | 0adc07ab9d1f8eff4f8f8643cc1deb14541da0ce00e85c8f5336714c42eea919 |
Hashes for y_py-0.4.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 090da7474c2eb5eb39339ca9402a469b66c3f8d2ebc2f0b8948e886873196407 |
|
MD5 | 9d804f6b69d509779a998965ff6494f5 |
|
BLAKE2b-256 | da2f5fce0e10ca0b1e9fa75e9b212b4f853f2d239b915b9f8dd1a170c3c44f18 |
Hashes for y_py-0.4.4-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68a06d5cd2684f29d66bd3193e7880c88e2a2aa0629e5c64171d00d1ce971a49 |
|
MD5 | 11ebc9f433c1ee604a679fb4ed0d03c5 |
|
BLAKE2b-256 | 253cec2a3386284cc7b72101f8f8d41296efcc96f4897610629c2df0ceaa890c |