Skip to main content

Transmit Server & Client

Install

pip install transmit

Usage

Server

from transmit.server import Server

class TestServer(Server):
    def __init__(self,port=18100):
        super().__init__(port)

    def test_function(self,msg):
        print('Testing:',msg)
        return {"say":"Happy everyday!!!"}

if __name__ == '__main__':
    ts = TestServer()
    ts.run()

Result

START SERVER 0.0.0.0:18100

Success Response

{
    "code":1,
    "msg":"success",
    "data":"handle result data. AnyType"
}

Error Response

{
    "code":0,
    "msg":"error message",
    "data":null
}

Client

from transmit.client import Client

with Client("127.0.0.1",18100) as c:
    result = c.test_function({"msg":"hello world"})
    print(type(result))
    print(result)

Result

> <class 'dict'>
> {'say': 'Happy everyday!!!'}

Advanced Usage

  1. debug mode

debug mode will print and log all request and response data.

# debug server
> python test_server.py --debug 1
# debug client
with Client("127.0.0.1",18100,debug=True) as c:
    ...
  1. server cli setting
> python test_server.py --host="127.0.0.1" --port=3000 --workers=3 --type=<process|thread> --debug=1
  1. docker health check
python -m transmit.health_check

Refs

Thrift thrift几种server模式的比较

Metadata

Release files for transmit 0.5.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 transmit 0.5.1
File Size Uploaded
transmit-0.5.1.tar.gz 8.1 kB Details

Built distribution (wheel)

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

Total release size: 20.4 kB

Release files / transmit-0.5.1.tar.gz

Download URL transmit-0.5.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8c88d33bf851a1baf49c35d784df29f9cabee42b71facfc79f1f912d8177ff90
BLAKE2b-256 checksum
How to use checksums
68fa928cc771f62b1b6acd60ddb8c2541d64713007e38a375d0992d95ecbd2a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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 / transmit-0.5.1-py3-none-any.whl

Download URL transmit-0.5.1-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
562a35a5027f93e24e42837260ff1f9adb7dc1957d571ec07da6dfbc2d773b47
BLAKE2b-256 checksum
How to use checksums
29ccc9648c2f61984d8236d8d5dacdbf2e9a39685a8ce560eacd495d9ae7500c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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 history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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