Skip to main content

spatialbridge

The protocol SCIMAP Pro (analysis) and Plexora (viewer, image processing) speak to share one dataset. Either application can hand work to the other, with or without an AI agent in between, and a third tool can join later without either package changing.

Neither application imports the other. Both depend on this package, which defines:

Module What it is
schema Exchange objects: Ref, Dataset, Regions, Gates, Selection, QCResult, CapabilityDescriptor, Provenance, Handoff. JSON Schema copies are in schema/.
workspace The on-disk record both sides read: identity, revision, per-section stamps, external-change detection, leases.
peers Who is running: peers.json, plus Plexora's servers.json and sidecars.json.
client Reaches a peer by the highest rung available: in-process, HTTP, a spawned MCP stdio server, MCP over HTTP.
tools The bridge_* tools each application mounts on its own MCP server.
handoff Hands work to the peer in five steps: ensure_visible, ensure_bound, invoke, collect, record.
registry The merged catalogue, the role vocabulary, and the routing rule.
anndata Readers and writers for the shared keys (uns["gates"], selections, regions).
conformance A pytest plugin a third tool runs to prove it speaks protocol 1.0.
grouping Which images, masks and tables under a folder belong together: one project per sample (a folder holding one sample's multiplex and H&E images is one project with the H&E as a layer), each pairing scored with its reasons and confidence, the folder groups a tree sorts samples into, corrections as overrides. Paths may be local or /-separated web addresses. Stdlib only.

The MCP SDK is the [mcp] extra (pip install 'spatialbridge[mcp]'). Without it, grouping, schema, workspace and the in-process and HTTP rungs work; reaching a peer over MCP raises peer_unavailable with that install as the hint.

There is no daemon. The shared state is a directory: $SPATIAL_WORKSPACE_DIR if set, otherwise the platform user-data directory (.../nirmallab/spatialbridge/workspaces).

Development

The repository lives in a Dropbox-synced folder, and a virtual environment inside it gets corrupted. Keep the environment outside the folder:

export UV_PROJECT_ENVIRONMENT=$HOME/.venvs/spatialbridge
uv sync --all-groups --all-extras
$UV_PROJECT_ENVIRONMENT/bin/python -m pytest

After changing a model in schema/, regenerate the committed JSON Schemas:

$UV_PROJECT_ENVIRONMENT/bin/python -m spatialbridge.schema export schema

A third tool joins by

  1. depending on spatialbridge;
  2. subclassing spatialbridge.adapter.Adapter (the capabilities with roles, plus invoke, bind, collect, on_event);
  3. calling spatialbridge.tools.mount(server, adapter) on its MCP server;
  4. passing pytest --peer "<its mcp command>" -o python_files=__init__.py --pyargs spatialbridge.conformance (the check lives in the package's __init__.py, which pytest collects only when told to).

Metadata

Release files for spatialbridge 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spatialbridge 0.2.3
File Size Uploaded Provenance Actions
spatialbridge-0.2.3.tar.gz 180.9 kB Without provenance Details for spatialbridge-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spatialbridge 0.2.3
File Interpreter ABI Platform Actions
spatialbridge-0.2.3-py3-none-any.whl Python 3 none any Details for spatialbridge-0.2.3-py3-none-any.whl

Total release size: 262.9 kB

Release files / spatialbridge-0.2.3.tar.gz

Download URL spatialbridge-0.2.3.tar.gz
Size 180.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e61d1e64c8b0296de5f08fbe87c0475fec268d743407266d0c308271ce36834b
BLAKE2b-256 checksum
How to use checksums
fbc9c2a45f2078c365deeaf8351a0fc91c2280a60aa4b1b67bb1757a0e6a198a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release files / spatialbridge-0.2.3-py3-none-any.whl

Download URL spatialbridge-0.2.3-py3-none-any.whl
Size 82.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb8eaa0369e522998907ce8ccdb6e9d67f8e5634b1a3fee9ebeb5d98ebf288c3
BLAKE2b-256 checksum
How to use checksums
d24fe3eddae320751da53d695aa628b5150d0aa3ad68f98bb4ad237ffee5a4ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Security for spatialbridge 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page