Python binding for omq.rs (Rust libzmq port). Drop-in pyzmq replacement on the common path.
Project description
pyomq
Python binding for omq.rs, a Rust libzmq port. Drop-in pyzmq replacement on the common path.
Install
uv pip install pyomq
# Optional extras (built into the wheel via cargo features):
uv pip install 'pyomq[curve]'
uv pip install 'pyomq[blake3zmq,lz4,zstd]'
uv pip install 'pyomq[test]' # adds pytest, pyzmq for the interop suite
Usage
import pyomq as zmq # drop-in for `import zmq` from pyzmq
ctx = zmq.Context()
push = ctx.socket(zmq.PUSH)
push.connect("tcp://127.0.0.1:5555")
push.send(b"hello")
push.close()
ctx.term()
For asynchronous code:
import pyomq.asyncio as zmq_async
ctx = zmq_async.Context()
sock = ctx.socket(pyomq.PUSH)
await sock.connect("tcp://127.0.0.1:5555")
await sock.send(b"hello")
await sock.close()
Status
Sync and asyncio APIs both ship in this release. All 19 ZMTP socket types are wired:
- Standard (RFC 28 + 47): PAIR, PUB, SUB, REQ, REP, DEALER, ROUTER, PULL, PUSH, XPUB, XSUB.
- Draft: SERVER, CLIENT (RFC 41), RADIO, DISH (RFC 48), GATHER, SCATTER (RFC 49), PEER, CHANNEL (RFC 51).
Transports: tcp://, ipc://, inproc://, and udp:// (RADIO/DISH only).
Optional features built into the wheel: curve, blake3zmq, lz4, zstd.
DISH groups: use socket.join(b"group") / socket.leave(b"group") to manage
subscriptions; messages are sent as multipart [group, body].
Backend
pyomq is built on omq-compio (single-threaded io_uring on Linux). The runtime
runs on a dedicated background thread; every Python call releases the GIL
across the runtime trip. This is the only backend pyomq supports — the
omq-tokio backend exists in the upstream Rust workspace for callers that need
a multi-thread tokio integration, but pyomq's per-call overhead is shaped
around compio's single-thread invariant.
Performance
Loopback PUSH/PULL throughput vs pyzmq, on a Linux 6.12 (Debian 13) VM on an Intel Mac Mini 2018 (i7-8700B, 3.2 GHz), Rust 1.95.0, default features:
| Size | inproc pyomq | inproc pyzmq | ratio | tcp pyomq | tcp pyzmq | ratio |
|---|---|---|---|---|---|---|
| 8 B | 1.30 M/s | 627 k/s | 2.08× | 1.36 M/s | 565 k/s | 2.41× |
| 32 B | 1.29 M/s | 620 k/s | 2.08× | 1.36 M/s | 576 k/s | 2.37× |
| 128 B | 1.31 M/s | 516 k/s | 2.54× | 1.29 M/s | 496 k/s | 2.61× |
| 512 B | 1.29 M/s | 480 k/s | 2.69× | 1.21 M/s | 461 k/s | 2.62× |
| 2 KiB | 1.17 M/s | 461 k/s | 2.54× | 908 k/s | 342 k/s | 2.65× |
| 8 KiB | 1.04 M/s | 368 k/s | 2.83× | 349 k/s | 102 k/s | 3.41× |
| 32 KiB | 622 k/s | 196 k/s | 3.17× | 116 k/s | 46 k/s | 2.50× |
| 128 KiB | 203 k/s | 70 k/s | 2.91× | 32 k/s | 24 k/s | 1.32× |
zmq.proxy() forwarding (128 B, TCP)
| pyomq | pyzmq | ratio | |
|---|---|---|---|
| PUSH/PULL msg/s | 963 k/s | 520 k/s | 1.85× |
| REQ/REP rt/s | 8,764/s | 6,521/s | 1.34× |
pyomq's proxy() runs as a native Rust async loop on the compio thread — no
Python per-message overhead. pyzmq's zmq.proxy() calls libzmq's C-level
zmq_proxy. PUSH/PULL forwarding is throughput-bound and pyomq is ~1.9× faster.
REQ/REP is latency-bound (4 TCP hops per round-trip) so both are similar.
Run scripts/update_perf.py (after maturin develop --release) to re-measure and update the tables above.
Develop
cd bindings/pyomq
uv venv && source .venv/bin/activate
uv pip install maturin pytest pyzmq
maturin develop --release
pytest -v
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 pyomq-0.4.2.tar.gz.
File metadata
- Download URL: pyomq-0.4.2.tar.gz
- Upload date:
- Size: 322.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf4a11895e33f85a75d9c4568603d49de6ee8e18c3c8b25f9a27932d95539ced
|
|
| MD5 |
fab23e0c87e00ee5cc0caeffd1da6610
|
|
| BLAKE2b-256 |
8894a6e078c701e43b9bce305c71be00a6bcc8f8ff0266920895f2ccf08d3285
|
Provenance
The following attestation bundles were made for pyomq-0.4.2.tar.gz:
Publisher:
release-pyomq.yml on paddor/omq.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyomq-0.4.2.tar.gz -
Subject digest:
bf4a11895e33f85a75d9c4568603d49de6ee8e18c3c8b25f9a27932d95539ced - Sigstore transparency entry: 1575937316
- Sigstore integration time:
-
Permalink:
paddor/omq.rs@e25c07787f8930d72b1814372cae884927726687 -
Branch / Tag:
refs/tags/pyomq-v0.4.2 - Owner: https://github.com/paddor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pyomq.yml@e25c07787f8930d72b1814372cae884927726687 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyomq-0.4.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyomq-0.4.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9+, 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 |
14d82f828ef2d06f6e9f307e9d640a51d01118cc1c5da6a4f328b99383c5e970
|
|
| MD5 |
23a398e7aa394a22c9617a7a5d2d83ca
|
|
| BLAKE2b-256 |
258beea70dea2d971deaa5a5cc0dee1b7142a07ba211cbd6a0d9716b9d577cef
|
Provenance
The following attestation bundles were made for pyomq-0.4.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release-pyomq.yml on paddor/omq.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyomq-0.4.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
14d82f828ef2d06f6e9f307e9d640a51d01118cc1c5da6a4f328b99383c5e970 - Sigstore transparency entry: 1575937339
- Sigstore integration time:
-
Permalink:
paddor/omq.rs@e25c07787f8930d72b1814372cae884927726687 -
Branch / Tag:
refs/tags/pyomq-v0.4.2 - Owner: https://github.com/paddor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pyomq.yml@e25c07787f8930d72b1814372cae884927726687 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyomq-0.4.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pyomq-0.4.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9+, 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 |
121ab23d68733c6925699f8122d43ec47b25f8f57386811980a68a7203223a3c
|
|
| MD5 |
6b35519f7a3467e070be107c757ec950
|
|
| BLAKE2b-256 |
27faf1fc2007c9cdb23f609657b96b664515ab72a434561a96d6cc3f33851f59
|
Provenance
The following attestation bundles were made for pyomq-0.4.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release-pyomq.yml on paddor/omq.rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyomq-0.4.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
121ab23d68733c6925699f8122d43ec47b25f8f57386811980a68a7203223a3c - Sigstore transparency entry: 1575937329
- Sigstore integration time:
-
Permalink:
paddor/omq.rs@e25c07787f8930d72b1814372cae884927726687 -
Branch / Tag:
refs/tags/pyomq-v0.4.2 - Owner: https://github.com/paddor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pyomq.yml@e25c07787f8930d72b1814372cae884927726687 -
Trigger Event:
push
-
Statement type: