Skip to main content

The MQTTv5 protocol for Python written in Rust

Project description

mqtt5

PyPI downloads PyPI version Supported Python versions

A sans-I/O implementation of the MQTTv5 protocol for Python, written in Rust. Serialization is ~5x faster and deserialization ~20x faster than comparable Python code (benchmarked against mqttproto).

Reading/Writing a QoS=1 Publish packet with a 256 bytes payload.

Write a packet

import mqtt5

buffer = bytearray(1024)
n = mqtt5.ConnectPacket(client_id="Bulbasaur").write(buffer)

Read a packet

import mqtt5

buffer = bytearray(b"\x20\x03\x00\x00\x00")
packet, n = mqtt5.read(buffer)

Installation

pip install mqtt5

Note that mqtt5 implements only the low-level packet de/serialization. If you're looking for a complete MQTT client, check out aiomqtt.

Documentation

See the stub file for an API reference and the MQTTv5 specification for details about the de/serialization.

Invalid packets raise exceptions rather than being silently ignored or partially parsed.

Versioning

This project adheres to Semantic Versioning.

Changelog

See CHANGELOG.md, which follows the principles of Keep a Changelog.

Acknowledgments

mqtt5 was inspired by Brett Cannon's sans-I/O documentation. I've also learned a lot from Alex Grönholm's mqttproto, which is an excellent pure-Python MQTTv5 protocol implementation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mqtt5-0.3.0.tar.gz (39.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mqtt5-0.3.0-cp310-abi3-win_amd64.whl (276.5 kB view details)

Uploaded CPython 3.10+Windows x86-64

mqtt5-0.3.0-cp310-abi3-win32.whl (255.8 kB view details)

Uploaded CPython 3.10+Windows x86

mqtt5-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl (526.7 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

mqtt5-0.3.0-cp310-abi3-musllinux_1_2_i686.whl (547.0 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ i686

mqtt5-0.3.0-cp310-abi3-musllinux_1_2_armv7l.whl (610.4 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARMv7l

mqtt5-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl (508.5 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

mqtt5-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (354.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

mqtt5-0.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (384.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ s390x

mqtt5-0.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (376.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ppc64le

mqtt5-0.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (346.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARMv7l

mqtt5-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (329.2 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

mqtt5-0.3.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl (369.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.5+ i686

mqtt5-0.3.0-cp310-abi3-macosx_11_0_arm64.whl (317.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

mqtt5-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl (345.1 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file mqtt5-0.3.0.tar.gz.

File metadata

  • Download URL: mqtt5-0.3.0.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for mqtt5-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a6c6892bbadc1e498760ade1eaf7ea6ae14e913474532d7697b131a26304b9e5
MD5 6c5f16e4a6e5bf683e2c6f076f6a9b6e
BLAKE2b-256 6987c6e4b3f79a445aa996823a1ee05b1bd798e801c066e260e4f73e3829a8cf

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: mqtt5-0.3.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 276.5 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0168cbdc5d7b98fe51fdeb74285a27dd979fab2b10cc372b314053cc16efa9ae
MD5 78d7deed2635017c8b0420ad096e349e
BLAKE2b-256 c1aadc82f5c36f3d410af114cbde2ba4e21d7dcbe2096a7c7bf97013c24f67b9

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-win32.whl.

File metadata

  • Download URL: mqtt5-0.3.0-cp310-abi3-win32.whl
  • Upload date:
  • Size: 255.8 kB
  • Tags: CPython 3.10+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 06e8ee3910043bb46eb4cdc928e22d7ad165fda116c47ac2e7ee73c05a3fc5c9
MD5 1d6c9ab81766469af524eb407e91893b
BLAKE2b-256 f097dcc46972eb0dddc6ce75dd6923077ae9a7a0611d0a1f773d1d891aba61c7

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 87ab08097f711458977e2b796da62eebba9dd735997b69b9ceed824f0237b79d
MD5 8cbe88af60281b1f1ceb6e9cab78b5ef
BLAKE2b-256 d7536101d2c7ce441b03eb12a987f516873c93af51ddf1addaeaef1d50e91ea1

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 831c46d1b17aee15340af664612532a90dbc4ac0c129c7eade6e70b65972cea0
MD5 692bc77fc823df9cb33749e65a3a9cb7
BLAKE2b-256 5a937c37671ad98ffdd7ce4142f79b87638111b0464b79816ea4e1bc1dd0e309

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 ccbde6c4249ba313ed563e8a4455e8133ad1d5d52e31bd5a2330f246bd4f64be
MD5 ed1c706681e4f63411f66daf6c09f889
BLAKE2b-256 d17890fa62fda71ad98b406a23ec97fd1d8253f050bf27185964026b8663f7f6

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1135828e28398bcdf59e4e5fac99c0c9fe9ebbfac7e23dde633a8898c5335d41
MD5 57ae0046bb38d8924bdb08ca890d76d1
BLAKE2b-256 57e3dee363c6cb1338d6ec8f7b23e591f6bf94768e4ccf095809ef9e0f9de376

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b37220fc14d3042655486ceaf1c6b654a8a0328fc3a756c30552b8eefb7ee3ba
MD5 09416dfb23be2686b9a17ae7b6a4cdaf
BLAKE2b-256 b6a4f7a0bd4b96a14f66bf63ae0fc989b8c8bf07b6beb50aa379d815efde4b06

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a72e1be5b2bdf01393b66394f8579a1386fdd18b836b2e1b9fc1adc6d6ba6867
MD5 4349ffd8080e219931d846e6d9df7359
BLAKE2b-256 825cf759e8c61f6f7b682036b35a02fb5e8237a2b910d30e53f19eb7842e04fe

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 37c04890e953058cc127994921a84e2ead8b3288beafef5dae6b24124551f1e2
MD5 aeda62dfa6fc540a15bf6766d0630eee
BLAKE2b-256 c8db7e8e2d4fe4a7e0e427981ab1709d63ad66124f8adf871b2b187d685085df

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 84b6611539fc21753970c58f99eda9829371f89574be81e13905169992f3930b
MD5 631b36f4a8178e7c05e1a0cc3b70656d
BLAKE2b-256 9bc1cd64fa8110cc3b9182b3a7c3a9636b1e1922733d6df14361c91440316dce

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 75563cb74d032a7cefdaf0d667369c0742b1d54bbdc829b55f4e3179b793c255
MD5 4d8d2416558ae874926f093c9240021d
BLAKE2b-256 45e6accd7d1953aa34afa711626da52f0e3e7379a6bb285e13033a1213a88721

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 d755b6edd371c084c02865c42ef8b43f6d13de6cad6c9e585a66dc623f318c61
MD5 6c5f0e622173e21780322c9dd10d9089
BLAKE2b-256 8f4ea8dcd75c37261de9ef72eee9c0807cf3cf4381a25f44923bb4bdb1481a17

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f36316ef04b2ce5b4807e8898b8033d591e019a2b77ed57bd40e84078fe9c831
MD5 fd6e1ca6ba9e4f6f8826da472b0a9cc5
BLAKE2b-256 60e067b860109c10f4ea900d0abd0e9551119132394b6e51a39850e0ee9010d1

See more details on using hashes here.

File details

Details for the file mqtt5-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mqtt5-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f7f8c3926fb112133c25ba3928589c05d3f3b6f0fe87b7d9ff53f383321ccb3e
MD5 9a17e5f64a89d22b12e7ff834fb675c2
BLAKE2b-256 985c2ca29b0983a5dc51e65dbc9ca799823ec3990834a198ba8fce73ffbea0bc

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 Pingdom Monitoring Sentry Error logging StatusPage Status page