skillfed

paho-mqtt

MQTT version 5.0/3.1.1 client class

paho-mqtt v2.1.0 8.5M downloads/30d#1,609 on PyPI
Copyleft license EPL-2.0 OR BSD-3-Clause DORMANT released

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-mqtt

uv

uv add paho-mqtt

poetry

poetry add paho-mqtt

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI ApprovedNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: CommunicationsTopic :: Internet

Tags

mqtt client librarypublish subscribe messagingiot connectivity protocolmqtt broker connectionlightweight message transportmachine to machine messagingmqtt python client
mqttiotmessaging

More Internet packages