paho-mqtt
MQTT version 5.0/3.1.1 client class
What it is and what it does
paho-mqtt is the Eclipse Paho MQTT Python client library, a reference implementation for connecting applications to MQTT brokers. It provides a Client class and helper functions to publish messages, subscribe to topics, and receive published messages over the MQTT protocol. The library supports MQTT versions 5.0, 3.1.1, and 3.1, making it compatible with a wide range of brokers and IoT platforms.
The package is designed for lightweight, bandwidth-constrained environments typical of machine-to-machine (M2M) and Internet of Things (IoT) applications. It offers multiple network loop modes—threaded (loop_start/loop_stop), blocking (loop_forever), and manual (loop)—to fit different application architectures. Callbacks handle connection, message receipt, and publish acknowledgment events. However, the library has known limitations: session state is stored in memory only, not persisted, which can result in message loss on client restart; QoS 2 message delivery guarantees are not fully compliant with the MQTT standard.
Use it for:
- Build IoT sensor applications that publish temperature, humidity, or other metrics to a central MQTT broker for aggregation.
- Create home automation systems where devices subscribe to control topics and publish status updates.
- Implement remote monitoring dashboards that subscribe to device topics and display real-time data.
- Develop lightweight edge applications on resource-constrained devices using the minimal code footprint MQTT provides.
- Connect legacy systems to modern IoT platforms via MQTT publish/subscribe messaging.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an MQTT client library for connecting to MQTT brokers to publish and subscribe to messages, supporting MQTT protocol versions 5.0, 3.1.1, and 3.1.
Yes, with conditions. paho-mqtt is a stable, well-established MQTT client with no known vulnerabilities and low installation friction. However, maintenance is dormant (837 days since last release), so expect no active support or bug fixes. Install it if you need a reliable, mature MQTT client for production IoT or M2M applications and can tolerate the lack of ongoing development. Avoid it if you require active maintenance, recent security patches, or help with migration from version 1.x to 2.x.
Install
paho-mqtt on PyPI
pip
pip install paho-mqttuv
uv add paho-mqttpoetry
poetry add paho-mqttInstalling paho-mqtt
Before you install
Low installation friction with no runtime dependencies. Maintenance status is dormant—last release was 837 days ago—so expect no active bug fixes or feature development, though the library remains functional for existing use.
License in practice
Dual-licensed under EPL-2.0 or BSD-3-Clause (copyleft treatment). Users may choose the more permissive BSD-3-Clause for proprietary projects, but EPL-2.0 requires source disclosure if modifications are distributed.
Quickstart
pip install paho-mqtt
import paho.mqtt.client as mqtt
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60)
mqttc.loop_forever()
Requires Python 3.7 or later. Breaking changes introduced in version 2.0; existing code may need migration.
Verify before relying
- Whether dormant status reflects stable maturity or abandoned maintenance—no recent commits or activity data provided.
- Extent of real-world production use and community support despite 837 days since last release.
- Whether session persistence limitations (in-memory only when clean_session=False) are 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 | dormant — 837 days since the last release |
| First released | |
| Downloads | 8,532,451/month — #1,609 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: paho_mqtt-2.1.0-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
gmqttgmqtt is an async Python MQTT client that…
permissive · top 15,000 on PyPI
kuksa-clientKUKSA Python SDK provides a client library and…
permissive · top 15,000 on PyPI
tb-paho-mqtt-clientProvides an MQTT client library implementing…
copyleft · 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
tb-mqtt-clientPython client SDK for ThingsBoard IoT platform,…
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
victron-mqttAn asynchronous Python library for…
permissive · top 15,000 on PyPI
awsiotsdkConnects Python applications to AWS IoT Core…
permissive · top 5,000 on PyPI