Skip to main content

IoTFlow — Python client

Connect any device that runs Python (Raspberry Pi, PC, Mac, Linux SBCs) to the IoTFlow platform. For microcontrollers (Arduino, ESP8266, ESP32) use the Arduino library — both speak the same protocol.

Install

pip install iotflow            # HTTP only (zero dependencies)
pip install "iotflow[mqtt]"    # + real-time MQTT (paho-mqtt)

Straight from GitHub (before/without a PyPI release):

pip install "iotflow[mqtt] @ git+https://github.com/alfredang/iotplatform.git#subdirectory=clients/python"

Or zero-install — HTTP mode uses only the standard library, so you can just drop the file next to your script:

curl -O https://raw.githubusercontent.com/alfredang/iotplatform/main/clients/python/iotflow.py

Report readings (HTTP — out of the box)

from iotflow import IoTFlow

iot = IoTFlow("https://iot.tertiaryinfotech.com", "dev_XXXX", "rpi-weather")
iot.send(temperature=22.5, humidity=60)     # several metrics at once
iot.virtual_write("temperature", 22.5)      # or one at a time

Report readings (MQTT — every 10 s)

The Python equivalent of the Arduino ESP8266_Telemetry_Upload example — see examples/telemetry_upload.py:

import time
from iotflow import IoTFlow

iot = IoTFlow(token="dev_XXXX", device_id="test-device",
              mqtt_host="192.168.3.228", mqtt_port=1883)
iot.connect()                               # MQTT runs in the background

while True:
    iot.mqtt_publish(temperature=28.5, humidity=65, voltage=3.7)
    time.sleep(10)

React to control commands

Poll over HTTP (no extra deps):

@iot.on_command
def handle(pin, value, text):
    if pin == "pump":
        print("pump ->", value)             # drive a GPIO here

iot.run(interval=3)                         # blocks, polls every 3s

Real-time over MQTT:

iot = IoTFlow(token="dev_XXXX", device_id="rpi-room",
              mqtt_host="broker.host", mqtt_port=1883)

@iot.on_command
def handle(pin, value, text): ...

iot.loop_forever()

pin names match your dashboard widgets: report to a metric name (temperature) for Number/Gauge/Line widgets; receive on a control pin (V1, relay, pump) set by Button/Switch/Slider widgets or n8n flows.

Publish to PyPI (maintainers)

cd clients/python
python -m build
twine upload dist/*

Metadata

Release files for iotflow 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iotflow 0.1.0
File Size Uploaded
iotflow-0.1.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iotflow 0.1.0
File Interpreter ABI Platform
iotflow-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / iotflow-0.1.0.tar.gz

Download URL iotflow-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
17bd344c7f9063120921c21ac80480f38145ca247cd38173209ecfc01fd8f225
BLAKE2b-256 checksum
How to use checksums
b02350f96e629cc74a8c72c21f4e28b4e5b9614854905264de81a19823918610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / iotflow-0.1.0-py3-none-any.whl

Download URL iotflow-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51c83357e3fa6e16a9fd0722eb7ead44306a3437d177d5406b09f87f5a62eaba
BLAKE2b-256 checksum
How to use checksums
27d2debc91c7e65b856981b0df371325c758646d4d0ce1a526be46f70e391876
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page