A pure asyncio MQTT client library for Python with full MQTTv5 support and no callbacks.
aiomqtt is a Python library that provides an asynchronous MQTT client built on top of asyncio. It enables developers to publish and subscribe to MQTT topics using async/await syntax, supporting the full MQTTv5 protocol specification. The library solves the problem of writing clean, callback-free MQTT client code in asynchronous Python applications.
Python developers building asynchronous applications that require MQTT communication, such as IoT systems, real-time messaging platforms, or distributed sensor networks.
Developers choose aiomqtt for its pure asyncio implementation, complete MQTTv5 support, and elimination of callbacks, which results in more readable and maintainable code compared to traditional MQTT clients.
The idiomatic asyncio MQTT client
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Python's async/await syntax instead of callbacks, leading to cleaner code flow, as demonstrated in the subscribe example with async for loops.
Implements the complete MQTTv5 protocol including advanced features like backpressure and user properties, making it ideal for modern IoT applications.
Handles network interruptions by automatically reconnecting to the broker, reducing manual error handling in client code.
Built entirely on asyncio without threading, offering better performance and seamless integration in asynchronous environments, as emphasized in the README.
Fully type-hinted for improved developer experience, aiding in tooling support and code clarity, which is highlighted in the key features.
Version 3 is marked as alpha, indicating potential bugs, breaking changes, and not being ready for production use, as noted in the README's release note.
Being a newer library with a switch to the mqtt5 dependency, it has a smaller community and fewer resources compared to established clients like paho-mqtt.
Relies on the sans-io mqtt5 library, which is less mature and could introduce issues or lack features compared to more popular alternatives.