eclipse-paho/paho.mqtt.python

Public

paho.mqtt.python

  • Stars2.4k+1 tuần này
  • Forks751
  • Watchers77
  • Issues112
  • Ngày tạo17/12/2015
  • Cập nhật gần nhất02/11/2026
  • Ngôn ngữPython
  • Giấy phép—
README.rst46.6 KBRaw

Eclipse Paho™ MQTT Python Client

The full documentation is available here.

Warning breaking change - Release 2.0 contains a breaking change; see the release notes and migration details.

This document describes the source code for the Eclipse Paho MQTT Python client library, which implements versions 5.0, 3.1.1, and 3.1 of the MQTT protocol.

This code provides a client class which enables applications to connect to an MQTT broker to publish messages, and to subscribe to topics and receive published messages. It also provides some helper functions to make publishing one off messages to an MQTT server very straightforward.

It supports Python 3.9+.

The MQTT protocol is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. Designed as an extremely lightweight publish/subscribe messaging transport, it is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.

Paho is an Eclipse Foundation project.

Contents

Installation

The latest stable version is available in the Python Package Index (PyPi) and can be installed using

pip install paho-mqtt

Or with virtualenv:

virtualenv paho-mqtt
source paho-mqtt/bin/activate
pip install paho-mqtt

To obtain the full code, including examples and tests, you can clone the git repository:

git clone https://github.com/eclipse/paho.mqtt.python

Once you have the code, it can be installed from your repository as well:

cd paho.mqtt.python
pip install -e .

To perform all tests (including MQTT v5 tests), you also need to clone paho.mqtt.testing in paho.mqtt.python folder:

git clone https://github.com/eclipse/paho.mqtt.testing.git
cd paho.mqtt.testing
git checkout a4dc694010217b291ee78ee13a6d1db812f9babd

Nội dung README thuộc về eclipse-paho và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/eclipse-paho/paho.mqtt.python