Python client for StratiGraph — Yjs real-time collaboration via Node.js sidecar
Project description
stratigraph-sync
Python client for @stratigraph/sync — real-time multi-user editing powered by Yjs CRDTs.
Connects to the sync-sidecar Node.js binary over stdio JSON-RPC. Requires Node.js to be installed.
Quick Start
from stratigraph_sync import SyncClient, InitConfig
client = SyncClient()
snapshot = client.init(InitConfig(room_id="trench-5-west"))
print(snapshot.data) # {"contexts": {}, "observations": {}, ...}
# Register event handlers
def on_change(msg):
print(f"Remote change: {msg}")
client.on("remote_patch", on_change)
# Read and write data
client.add("contexts", {"id": "ctx-1", "type": "fill", "description": "Clay layer"})
client.patch("contexts", "ctx-1", {"description": "Sandy clay"})
all_contexts = client.query("contexts")
single = client.query("contexts", "ctx-1")
full = client.snapshot()
client.leave()
client.close()
Events
| Event | Payload | Description |
|---|---|---|
remote_patch |
{collection, id, fields, by} |
Remote document update |
remote_delete |
{collection, id, by} |
Remote document deletion |
remote_add |
{collection, document, by} |
Remote document addition |
awareness |
{users: [...]} |
User presence update |
sync_status |
{state, pending} |
Connection status change |
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file strgraph-1.1.0.tar.gz.
File metadata
- Download URL: strgraph-1.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7714b4ae4b990a2a7de91685893d60e680a27f8d612d687ffcd0e0eb1e16b80b
|
|
| MD5 |
8a70412a257b1b93c9076656a2f0faef
|
|
| BLAKE2b-256 |
0b23d25af8a3b3832a26cbfcf546bd508560b8a3c3a0f57dd0de42e2b3cec4ce
|
Provenance
The following attestation bundles were made for strgraph-1.1.0.tar.gz:
Publisher:
release.yml on mabo-du/stratigraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strgraph-1.1.0.tar.gz -
Subject digest:
7714b4ae4b990a2a7de91685893d60e680a27f8d612d687ffcd0e0eb1e16b80b - Sigstore transparency entry: 1940351128
- Sigstore integration time:
-
Permalink:
mabo-du/stratigraph@e7799230c716bd23a0a995847658af4d28eba93c -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/mabo-du
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e7799230c716bd23a0a995847658af4d28eba93c -
Trigger Event:
push
-
Statement type:
File details
Details for the file strgraph-1.1.0-py3-none-any.whl.
File metadata
- Download URL: strgraph-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4f6b8e4b79aa9a0291fd8cf81fbbc404c034c70d1974e91dcd9a8ddc00921dd
|
|
| MD5 |
6686e8e5e9fccb9b84a98560bff3c783
|
|
| BLAKE2b-256 |
3874a5a245671bfac22e2b938d7678d18ac1fc717160dbb85ba62cca4d777818
|
Provenance
The following attestation bundles were made for strgraph-1.1.0-py3-none-any.whl:
Publisher:
release.yml on mabo-du/stratigraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strgraph-1.1.0-py3-none-any.whl -
Subject digest:
d4f6b8e4b79aa9a0291fd8cf81fbbc404c034c70d1974e91dcd9a8ddc00921dd - Sigstore transparency entry: 1940351216
- Sigstore integration time:
-
Permalink:
mabo-du/stratigraph@e7799230c716bd23a0a995847658af4d28eba93c -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/mabo-du
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e7799230c716bd23a0a995847658af4d28eba93c -
Trigger Event:
push
-
Statement type: