Archived
This project has been archived by its maintainers, and is no longer receiving any updates.
Drift MQTT tools
A collection of helpers to work with MQTT:
Client- wrapper aroundpaho.mqtt.Clientthat correctly handles subscriptions after reconnect
Installation
pip install drift-mqtt
Or get the latest version from GitHub:
pip install git+https://github.com/panda-official/DriftMqtt.git
Usage
Producer
from drift_mqtt import Client
client = Client('tcp://127.0.0.1:8000', 'client_id')
client.connect()
client.loop_start()
...
client.publish('topic', 'some message')
Consumer
from drift_mqtt import Client
def message_handler(message):
print('Got message ', message.payload, message.topic)
client = Client('tcp://127.0.0.1:8000', client_id='test_subscriber')
client.subscribe('test_topic', message_handler)
client.connect()
client.loop_forever()
For more details please check examples/ folder
Metadata
Release files for drift-mqtt 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drift_mqtt-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / drift_mqtt-0.2.2-py3-none-any.whl
| Download URL | drift_mqtt-0.2.2-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d021b98b0bcefc20275c3c58b4450b76efff6f66e8f835511dc84bde4114c82
|
|
BLAKE2b-256 checksum How to use checksums |
77250f8162eaa0ed80bde1168c8612dc7cd959e40f487793d263ab60482f964e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|