Pycrdt-websocket provides a WebSocket connector for `pycrdt`, enabling real-time, collaborative document synchronization using Y-CRDTs over a network. It facilitates both server-side handling of Y-CRDT documents and client-side connections. The library is actively maintained with frequent minor releases, typically addressing bug fixes and compatibility updates.
pip install pycrdt-websocketVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic pycrdt-websocket setup with a server and a client. The server initializes a YDoc and listens for connections, while the client connects to synchronize its own YDoc. It shows how text changes are synchronized in real-time.
Replace `from pycrdt_websocket import ...` with `from pycrdt.websocket import ...`.
Install `pycrdt-store` (`pip install pycrdt-store`) and update imports from `from pycrdt.websocket import YStore` to `from pycrdt_store import YStore`.
Ensure all calls to asynchronous methods are prefixed with `await` and run within an `async` function, typically managed by `asyncio.run()`.
Refer to the `pycrdt-websocket` project's `pyproject.toml` or `setup.py` for the exact `pycrdt` version range requirement, and upgrade/downgrade `pycrdt` accordingly (e.g., `pip install pycrdt>=0.9.0,<0.11.0`).