Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strgraph-1.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strgraph-1.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for strgraph-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7714b4ae4b990a2a7de91685893d60e680a27f8d612d687ffcd0e0eb1e16b80b
MD5 8a70412a257b1b93c9076656a2f0faef
BLAKE2b-256 0b23d25af8a3b3832a26cbfcf546bd508560b8a3c3a0f57dd0de42e2b3cec4ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for strgraph-1.1.0.tar.gz:

Publisher: release.yml on mabo-du/stratigraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for strgraph-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4f6b8e4b79aa9a0291fd8cf81fbbc404c034c70d1974e91dcd9a8ddc00921dd
MD5 6686e8e5e9fccb9b84a98560bff3c783
BLAKE2b-256 3874a5a245671bfac22e2b938d7678d18ac1fc717160dbb85ba62cca4d777818

See more details on using hashes here.

Provenance

The following attestation bundles were made for strgraph-1.1.0-py3-none-any.whl:

Publisher: release.yml on mabo-du/stratigraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page