Skip to main content

transports

Move typed models across any wire as incremental patches.

Define a model once as a pydantic model, stdlib dataclass, or msgspec struct. Host it in Python, mutate it normally, and send only the patch needed to update a remote mirror. The same Rust core drives Python (PyO3) and JavaScript (wasm), so both sides use the same Value, diff, patch, and codec machinery.

Build Status codecov License PyPI

import transports
from pydantic import BaseModel

class Device(BaseModel):
    name: str
    on: bool = False

session = transports.Session()
lamp = Device(name="lamp")
model_id = session.host(lamp)

lamp.on = True
print(session.drain())
# [(1, {'rev': 1, 'ops': [{'Set': {'path': [{'Key': 'on'}], 'value': {'Bool': True}}}]})]

Install

pip install transports
pip install "transports[connections]"   # WebSocket server/client adapters
pip install "transports[sse]"           # Server-Sent Events adapter
pip install "transports[jupyter]"       # Jupyter comm adapter

Documentation

Tutorial

Quickstart builds one hosted model and mirrors it with the in-process server/client protocol.

How-to guides

Model bridges covers pydantic, dataclasses, msgspec, schemas, and plain JavaScript objects. Connections covers WebSocket, SSE, Jupyter comm, and anywidget adapters. Codecs covers JSON, MessagePack, and custom codecs. Multi-tenancy and sharing covers tenant isolation, shared models, and merge strategies.

Reference

API reference lists the Python API. Wire protocol reference describes Value, patch operations, protocol messages, codecs, and model ids.

Explanation

Concepts explains why transports uses incremental patches, server-owned revisions, a shared Rust core, and transport-agnostic adapters.

[!NOTE] This library was generated using copier from the Base Python Project Template repository

Download files

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

Source Distribution

transports-0.6.0.tar.gz (802.6 kB view details)

Uploaded Source

Built Distributions

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

transports-0.6.0-cp311-abi3-win_amd64.whl (607.1 kB view details)

Uploaded CPython 3.11+Windows x86-64

transports-0.6.0-cp311-abi3-manylinux_2_28_x86_64.whl (732.2 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

transports-0.6.0-cp311-abi3-macosx_11_0_arm64.whl (668.4 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file transports-0.6.0.tar.gz.

File metadata

  • Download URL: transports-0.6.0.tar.gz
  • Upload date:
  • Size: 802.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for transports-0.6.0.tar.gz
Algorithm Hash digest
SHA256 136f4a77e6fd4c2fa7d345b17c631da28d0d27d82f4cc82459dea74dd5f4c6ee
MD5 b0c7200ee2dfe9ec8e1d6c8a4e3d1211
BLAKE2b-256 c5248b4abbfd5d6d976b8565b8256e71d1bc0f2abcb41c09661757652045a07a

See more details on using hashes here.

File details

Details for the file transports-0.6.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: transports-0.6.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 607.1 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for transports-0.6.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5450cdd4c9f1e2d405b23644b3822a9a228f4ea0d41590a7c527a6b62163496b
MD5 6c1a3474e26a0e075a9b4dda19c2b612
BLAKE2b-256 8e90e10a6c7c81eab98543a2d757bf7fa301f2dbc6c8e3d82d5680db7a7e3ca7

See more details on using hashes here.

File details

Details for the file transports-0.6.0-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for transports-0.6.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5ef46c52639f9120c8580b77ad65ee9a6fb2ca3f35f45b793dab206cb19e0ba1
MD5 a3a4b8e29fb9a5dce81de5dc41895783
BLAKE2b-256 cf7f789656bde229ae16b35130dae1094f1c59e5497054f7bd34343320f1088f

See more details on using hashes here.

File details

Details for the file transports-0.6.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for transports-0.6.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a216452948647c794f3df2d07e2a66a0f91158c562c850f2ad60d807a18e990
MD5 6f0e13d10e3a956816ca80fa176e1525
BLAKE2b-256 b951e05b5b8aa93277d75b54958ec1aa6cd6fd7edc6d162052895b6e3ad815f0

See more details on using hashes here.

Supported by

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