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.1

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.1
File Size Uploaded Provenance Actions
spatialbridge-0.2.1.tar.gz 176.9 kB Without provenance Details for spatialbridge-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 256.2 kB

Release files / spatialbridge-0.2.1.tar.gz

Download URL spatialbridge-0.2.1.tar.gz
Size 176.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a4328acf8b7edeaa9df1aa9d7f538835d6aa633a333b3d0f1de85dfa3d838846
BLAKE2b-256 checksum
How to use checksums
dcff16f9431d370709b23982a579065a297d02869a582e94146ff7f96af2af69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL spatialbridge-0.2.1-py3-none-any.whl
Size 79.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0d7b795bd1fd16f5544fcfe65567be493105f9dfe0ecc42c0f2c77eda61c356
BLAKE2b-256 checksum
How to use checksums
b26dd949e4c7529190afd2e98a4fc14a7eadf7c8c2871580a7d2401289748f01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for spatialbridge 0.2.1

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