tb-paho-mqtt-client
MQTT version 5.0/3.1.1 client class
What it is and what it does
This is the Eclipse Paho MQTT Python client, a library for connecting applications to MQTT brokers to send and receive messages over a lightweight publish-subscribe protocol. It supports MQTT versions 5.0, 3.1.1, and 3.1, making it suitable for IoT and machine-to-machine communication where bandwidth and code footprint matter. The library provides a full Client class for fine-grained control, plus helper functions for simple one-off publish or subscribe operations.
The client offers multiple network loop modes: a threaded loop (loop_start/loop_stop) for non-blocking operation, a blocking loop (loop_forever) that handles reconnection automatically, and a manual loop for custom event integration. Callbacks allow your application to react to connection, message receipt, and publish acknowledgment events. Known limitations include in-memory-only session storage (sessions are lost on restart) and potential message loss for unacknowledged QoS 1 and QoS 2 messages.
Use it for:
- Build IoT applications that publish sensor readings or receive commands from a central broker.
- Implement lightweight remote monitoring where network bandwidth is constrained.
- Create publish-subscribe messaging systems for real-time data distribution across devices.
- Integrate MQTT communication into Python applications with automatic reconnection handling.
- Subscribe to multiple topics and process incoming messages via callbacks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an MQTT client library implementing protocol versions 5.0, 3.1.1, and 3.1 for publishing and subscribing to message topics on an MQTT broker.
Yes, with conditions. The package is stable and well-maintained by Eclipse Foundation, with no known vulnerabilities and low install friction. However, the 494-day gap since last release warrants checking whether your use case can tolerate the known limitations: in-memory session storage (no persistence across restarts) and potential QoS 2 message duplication under certain reconnection scenarios. If those constraints are acceptable, it is a solid choice for MQTT connectivity.
Install
tb-paho-mqtt-client on PyPI
pip
pip install tb-paho-mqtt-clientuv
uv add tb-paho-mqtt-clientpoetry
poetry add tb-paho-mqtt-clientInstalling tb-paho-mqtt-client
Before you install
Low install friction with no runtime dependencies. Maintenance status is aging (494 days since last release), though the package remains supported for current Python versions (3.7+).
License in practice
Dual-licensed under EPL-2.0 or BSD-3-Clause with copyleft treatment. Users may choose either license; EPL-2.0 requires source disclosure for modifications, while BSD-3-Clause is more permissive.
Quickstart
pip install tb-paho-mqtt-client
import paho.mqtt.client as mqtt
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
mqttc.subscribe("topic/name")
mqttc.loop_forever()
Requires Python 3.7 or later. Release 2.0+ contains breaking API changes; migration guide available in release notes.
Verify before relying
- Whether the 494-day gap since last release reflects stable maturity or abandonment risk
- Current state of the known session persistence limitation (in-memory only, not persisted across restarts)
- Whether QoS 2 double-delivery behavior under clean_session=True is acceptable for your use case
Package facts
| License | EPL-2.0 OR BSD-3-Clause (copyleft) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 494 days since the last release |
| First released | |
| Downloads | 118,441/month — #12,118 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tb_paho_mqtt_client-2.1.2-py3-none-any.whl
Keywords: paho
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
paho-mqttProvides an MQTT client library for connecting…
copyleft · top 5,000 on PyPI
tb-mqtt-clientPython client SDK for ThingsBoard IoT platform,…
permissive · top 15,000 on PyPI
gmqttgmqtt is an async Python MQTT client that…
permissive · top 15,000 on PyPI
aiomqttAn asyncio-native MQTT client that wraps…
permissive · top 5,000 on PyPI
asyncio-mqttProvides an async/await interface to MQTT…
permissive · top 15,000 on PyPI
kuksa-clientKUKSA Python SDK provides a client library and…
permissive · top 15,000 on PyPI
types-paho-mqttProvides type stubs for paho-mqtt 1.6.* to…
permissive · top 15,000 on PyPI
pymysensorsPython API for communicating with MySensors…
permissive · top 15,000 on PyPI
HATasmotaParses and constructs Tasmota MQTT messages,…
permissive · top 15,000 on PyPI
solace-pubsubplusSolace Messaging API for Python provides client…
permissive · top 15,000 on PyPI