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. Pyodide covers building and loading transports in a browser.

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.8.0.tar.gz (407.7 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.8.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl (536.2 kB view details)

Uploaded CPython 3.14PyEmscripten 2026.0 wasm32

transports-0.8.0-cp311-abi3-win_amd64.whl (683.6 kB view details)

Uploaded CPython 3.11+Windows x86-64

transports-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl (810.2 kB view details)

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

transports-0.8.0-cp311-abi3-macosx_11_0_arm64.whl (739.8 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for transports-0.8.0.tar.gz
Algorithm Hash digest
SHA256 fa676751457aaf51225b09a6a4b27b6cabfa9dc893218044f26c6bc95c1dde20
MD5 c4e749853c2a76b2cb93acd616cdc95b
BLAKE2b-256 2513570e36e169469ecb97922eab6e0d6451e3b6b67aca467d1c709b576d0748

See more details on using hashes here.

File details

Details for the file transports-0.8.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl.

File metadata

File hashes

Hashes for transports-0.8.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl
Algorithm Hash digest
SHA256 cc93723ce1413c12dd1c5dc30702f9dff1982756860028d878b8746981a66b9c
MD5 c9e44d282f58b0697fcce5fefe8b3129
BLAKE2b-256 cb59d56c77fedc8d3bc26e466c28e635b1b703634d548877ddea3b8afd88a157

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transports-0.8.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 683.6 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.8.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f40b17461522935cd373ccb3a6b8c6ad9cce029a400db4dc91110c3ca9373595
MD5 98dc6d70cccb0fe4b40817b78f95aaea
BLAKE2b-256 5737526e85a2690bce526cbac07ca426595d71d5c7d960981dcfd67c12bdd6f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transports-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8744645acf41e668c3feedb56c9c734cf94b7194909d852097eaf80a54ac999a
MD5 979b1b35ed7c1da99586f1571c1e4e47
BLAKE2b-256 ddf7be359b46a40b8f888332afff257de90f5ec255e973b4725b700aa506b1ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transports-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02b3005ee53d646ca2dec722f26fdd731af40a7c5d8c20e7214cbcca5ccf47a9
MD5 21289d4a023f2ff0ad5295d9f235e383
BLAKE2b-256 e1849621e376c0ac3e3de28ed676a1051f832eab1aa3ac16c322ad4c4ec6c479

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