Python bindings for mq-bridge (basic: all-platform messaging set)
Project description
mq-bridge Python bindings
Thin Python bindings for the Rust mq-bridge core.
Install
Pick exactly one distribution. Both install the same import path: mq_bridge.
| Package | Install | Includes |
|---|---|---|
| Full | pip install mq-bridge-py |
Basic set plus Kafka, AWS, gRPC, MongoDB, SQLx |
| Basic | pip install mq-bridge-py-basic |
HTTP, NATS, MQTT, AMQP, WebSocket, ZeroMQ, middleware |
Memory and file endpoints are always present in both packages. Use mq-bridge-py-basic when you want the lean all-platform wheel set. Use mq-bridge-py when you need Kafka or the heavier non-messaging backends.
The public API stays close to mq-bridge itself:
Route.from_yaml(path, name)loads one named routeRoute.with_handler(...)attaches a rawMessagehandler, with lazyjson()/text()readers andwith_json()/with_payload()response helpersRoute.add_handler(kind, ...)uses mq-bridge'skinddispatch and delivers decoded JSONRetryableErrorandNonRetryableErrorlet Python handlers signal retry intentPublisher.from_yaml(path, name)loads one named publisherPublisher.send_json(...)andPublisher.request_json(...)serialize Python JSON values in Rust
The Python surface is synchronous and blocking. Tokio, broker I/O, routing, and batching all stay in Rust.
Local development
uv is a good fit here for the Python-side developer workflow, while maturin stays the build backend:
cd python/mq-bridge-py
uv sync --group dev --no-install-project
uv run maturin develop
uv run pytest -q
Performance smoke tests are skipped by default because they start routes and measure local throughput:
cd python/mq-bridge-py
MQ_BRIDGE_RUN_PERF_TESTS=1 uv run pytest -q -m performance
Examples
Raw message handler:
cd python/mq-bridge-py
uv run python examples/raw_route.py
Kind-based JSON handler:
cd python/mq-bridge-py
uv run python examples/json_route.py
Memory benchmark:
cd python/mq-bridge-py
uv run maturin develop --release
uv run python examples/bench_memory.py --messages 100000
Analysis
HTTP comparison benchmark, driven by a native load generator (wrk) so the
client is never the bottleneck. It boots each server itself (mq-bridge in worker
and direct executor modes, plus FastAPI, Starlette, Sanic, aiohttp, and
FastStream when installed) and drives each with wrk:
cd python/mq-bridge-py
uv run maturin develop --release
uv sync --group bench # optional Python HTTP peers
uv run python analysis/bench_http_native.py --connections 1,8,32 --duration 8
Requires wrk on PATH (brew install wrk). The FastStream target compares its
ASGI custom-route path over Uvicorn; it is not a broker-backed subscriber/publisher
benchmark. The examples use included sample configs or create temporary configs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mq_bridge_py_basic-0.2.16.tar.gz.
File metadata
- Download URL: mq_bridge_py_basic-0.2.16.tar.gz
- Upload date:
- Size: 686.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33b6c1364e4339552e582469e807f5db43b98561628ab4527fd84a62a045202f
|
|
| MD5 |
006c54451167ba5291a2dbc1d2cfe9dc
|
|
| BLAKE2b-256 |
e92eda2d0d3859acf3b0e40dcdc1515c7ae4cd14ee65ee8d67f8cae4199ae189
|
Provenance
The following attestation bundles were made for mq_bridge_py_basic-0.2.16.tar.gz:
Publisher:
publish-python.yml on marcomq/mq-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mq_bridge_py_basic-0.2.16.tar.gz -
Subject digest:
33b6c1364e4339552e582469e807f5db43b98561628ab4527fd84a62a045202f - Sigstore transparency entry: 1810136328
- Sigstore integration time:
-
Permalink:
marcomq/mq-bridge@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/marcomq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mq_bridge_py_basic-0.2.16-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: mq_bridge_py_basic-0.2.16-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bb8825dd2cd41ecbed81c92617eed5d3d7ed10662f96d0aeb0bf77e89336f8a
|
|
| MD5 |
87028b48e610ce499a7cba6e0f95e031
|
|
| BLAKE2b-256 |
c3be668b236bb52696c56f653185c21cb844b429e5d5372315f30d07a4ad311a
|
Provenance
The following attestation bundles were made for mq_bridge_py_basic-0.2.16-cp38-abi3-win_amd64.whl:
Publisher:
publish-python.yml on marcomq/mq-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mq_bridge_py_basic-0.2.16-cp38-abi3-win_amd64.whl -
Subject digest:
2bb8825dd2cd41ecbed81c92617eed5d3d7ed10662f96d0aeb0bf77e89336f8a - Sigstore transparency entry: 1810136594
- Sigstore integration time:
-
Permalink:
marcomq/mq-bridge@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/marcomq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.4 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d0ff5d172e5e4c7cfc7aec711f4215fe765018cbe9b102771eae0b1f58a5dc9
|
|
| MD5 |
2ef02cb0784f66ab8123b665e31247e0
|
|
| BLAKE2b-256 |
3cc5c79f0f475432bfce34446e2534589be70b522037c873531fbff5f1c31ec7
|
Provenance
The following attestation bundles were made for mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish-python.yml on marcomq/mq-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
0d0ff5d172e5e4c7cfc7aec711f4215fe765018cbe9b102771eae0b1f58a5dc9 - Sigstore transparency entry: 1810137082
- Sigstore integration time:
-
Permalink:
marcomq/mq-bridge@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/marcomq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.1 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d11fd0b0c5c7e17592cb0a221f16802524bc1d58f323c99658a7288b45f6beec
|
|
| MD5 |
45988bc174f8bfc172db71d1f685cf1b
|
|
| BLAKE2b-256 |
2a58a880230e61469f4f167ee08270b14f96000eea6d69026c2509633ee8e7e3
|
Provenance
The following attestation bundles were made for mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish-python.yml on marcomq/mq-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mq_bridge_py_basic-0.2.16-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
d11fd0b0c5c7e17592cb0a221f16802524bc1d58f323c99658a7288b45f6beec - Sigstore transparency entry: 1810136951
- Sigstore integration time:
-
Permalink:
marcomq/mq-bridge@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/marcomq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b5e3ff59a70b5055eeabeaf09118667201020a97f5b1cc9843414c37c968dcf
|
|
| MD5 |
033a0b49c73c5f5b2943888bbd337eeb
|
|
| BLAKE2b-256 |
d1345c5a4f15bf356252b8b4c573c44984caad08fe26e714e8f8c6ed5ff02630
|
Provenance
The following attestation bundles were made for mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-python.yml on marcomq/mq-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
8b5e3ff59a70b5055eeabeaf09118667201020a97f5b1cc9843414c37c968dcf - Sigstore transparency entry: 1810137415
- Sigstore integration time:
-
Permalink:
marcomq/mq-bridge@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/marcomq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 7.1 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73b0a8d14958456118c14f7bdfbe4a72fe8dd9843c8b5006dac3ad543117e9ed
|
|
| MD5 |
8947794f2a2c4873f96496007c610b23
|
|
| BLAKE2b-256 |
07a2cfa8297961a013d159e52f2703852fc6280a020b03f3a8317cf7d024274e
|
Provenance
The following attestation bundles were made for mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish-python.yml on marcomq/mq-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mq_bridge_py_basic-0.2.16-cp38-abi3-macosx_10_12_x86_64.whl -
Subject digest:
73b0a8d14958456118c14f7bdfbe4a72fe8dd9843c8b5006dac3ad543117e9ed - Sigstore transparency entry: 1810137185
- Sigstore integration time:
-
Permalink:
marcomq/mq-bridge@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/marcomq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a9ff4ab81a243c90fea9edcb18243e4f80e8fb44 -
Trigger Event:
workflow_dispatch
-
Statement type: