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.7.0.tar.gz (380.9 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.7.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl (277.3 kB view details)

Uploaded CPython 3.14PyEmscripten 2026.0 wasm32

transports-0.7.0-cp311-abi3-win_amd64.whl (632.7 kB view details)

Uploaded CPython 3.11+Windows x86-64

transports-0.7.0-cp311-abi3-manylinux_2_28_x86_64.whl (757.8 kB view details)

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

transports-0.7.0-cp311-abi3-macosx_11_0_arm64.whl (693.8 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for transports-0.7.0.tar.gz
Algorithm Hash digest
SHA256 7aabd31b257ef2407b5bd736139160f44d531731aa0278d5a233f5881a1e8c8e
MD5 7da38897a4103b63bada44589ae19fd6
BLAKE2b-256 aa36811f05233aa55a2ebae10261f9fe2de35e70044025d73309696b5a07eff6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transports-0.7.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl
Algorithm Hash digest
SHA256 0c7d7ab1427931d1881a8053373260483fa841398b981a5adeb508d4f4974715
MD5 97d03e06df161a9100b1a9024b97fd0b
BLAKE2b-256 7219e0c13063f4a27bb579e9e6ebc0eb025d1f0a818d0f58d081a1a55d3ea62e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: transports-0.7.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 632.7 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.7.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 824915dc2057455c1793b3e602a462ac132f18b40ac37bb17151c007df878cf7
MD5 4d81195feaef9a9b7420d9c5cb56fa2b
BLAKE2b-256 90a539565b99ef674baac2e4b5a442d1f4909e9cf75cc0e0bdd54ec83e22be41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transports-0.7.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1e01745a2c5130683d73b676bb1db0cc213177cd22e2afe582f3e7a89f7aede9
MD5 95bad808a37b114f97a4bac060adcb91
BLAKE2b-256 4f12790cfbecf53d99f8b53268243c180be6de078d9a4e7f022679cc68fa5d11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transports-0.7.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c74e16dbf43cf6525340f1579ff026e06ae04418da209a40094418f9c0e76bb
MD5 258cc65322409ad19f126bc3bb32c1f1
BLAKE2b-256 4df0ce670e5704844a14ad6dac70778abbe49a295675933982b63be4666c43d7

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