Code for using MQTT in analytics-related applications. Based on Eclipse Paho™ MQTT Python Client.
- Python ^3.11
Using pip, execute the following
pip install mqttconsumer- set the following environment variables
MQTT_BROKER_ADDRESSMQTT_BROKER_PORT(defaults to 1883)MQTT_TOPIC_EXAMPLE_1- e.g. via Windows powershell
$env:MQTT_BROKER_ADDRESS='broker.hivemq.com';$env:MQTT_TOPIC_EXAMPLE_1='test/smth/response'
- run
example.py
- Python ^3.7
- Poetry >= 1.1.13
(Documentation: Python-Poetry)
- install poetry
python -m install poetry # or using e.g. conda - clone this repository
- set up virtual environment and install dependencies
cd <repository_name> # set required python version if not using system-default (see dependencies): python -m poetry env use "absolute/path/to/python.exe" python -m poetry install # includes dev dependencies
- Check if better example can be obtained from https://github.com/eclipse/paho.mqtt.python/blob/master/examples/client_sub-class.py or other files of that repository. """
Code is released under the MIT License. All dependencies are copyright to the respective authors and released under the respective licenses listed in LICENSE_LIBRARIES.