Skip to main content

amgi-paho-mqtt

amgi-paho-mqtt is an AMGI compatible server to run AMGI applications against MQTT.

Installation

pip install amgi-paho-mqtt==0.49.0

Example

This example uses AsyncFast:

from dataclasses import dataclass

from amgi_paho_mqtt import run
from asyncfast import AsyncFast

app = AsyncFast()


@dataclass
class Order:
    item_ids: list[str]


@app.channel("order-topic")
async def order_topic(order: Order) -> None:
    # Makes an order
    ...


if __name__ == "__main__":
    run(app, "order-topic")

Or the application could be run via the commandline:

asyncfast run amgi-paho-mqtt main:app order-topic

Sending Messages

Messages can be sent from the application via the message.send event. The mqtt binding of the event controls the send:

await send(
    {
        "type": "message.send",
        "address": "order-topic",
        "headers": [(b"trace-id", b"abc123")],
        "payload": b"payload",
        "bindings": {"mqtt": {"qos": 1, "retain": False}},
    }
)

qos sets the MQTT QoS level (defaults to 0), and retain marks the message as retained (defaults to False). With MQTT v5, message headers are sent as user properties, with content-type mapped to the MQTT content type property. MQTT v3.1.1 has no way to represent headers, so they are dropped.

Contact

For questions or suggestions, please contact jack.burridge@mail.com.

License

Copyright 2025 AMGI

Metadata

Release files for amgi-paho-mqtt 0.49.0

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

Built distribution (wheel)

Table of built distributions (wheels) for amgi-paho-mqtt 0.49.0
File Interpreter ABI Platform
amgi_paho_mqtt-0.49.0-py3-none-any.whl Python 3 none any Details

Release files / amgi_paho_mqtt-0.49.0-py3-none-any.whl

Download URL amgi_paho_mqtt-0.49.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7cdc7b23ed07b0e3919ee0b761a463db451ab3180c3daca0ac86b2896b29ab7
BLAKE2b-256 checksum
How to use checksums
909e4b6df7185cb53502d4bd54abb51fb371bf55991d06deaee07ca026e47bd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.49.0 This release

1 release file

0.48.0

1 release file

0.47.0

2 release files

0.46.0

2 release files

0.44.0

2 release files

0.43.0

2 release files

0.42.0

2 release files

0.41.1

2 release files

0.41.0

2 release files

0.39.0

2 release files

0.37.0

2 release files

0.36.0

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.1

2 release files

0.29.0

2 release files

0.28.1

2 release files

0.28.0

2 release files

0.27.2

2 release files

0.27.1

2 release files

0.27.0

2 release files

0.26.1

2 release files

0.26.0

2 release files

0.25.2

2 release files

0.24.0

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

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