Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MQTT
  3. gmqtt

gmqtt

MITPythonv0.7.0

A Python async MQTT client with full MQTT v5.0 protocol support and automatic reconnection.

GitHubGitHub
448 stars55 forks0 contributors

What is gmqtt?

gmqtt is a Python asynchronous MQTT client library that implements the MQTT v5.0 protocol. It enables developers to build efficient, non-blocking IoT and messaging applications by providing a robust interface for connecting to MQTT brokers, publishing messages, and handling subscriptions with full protocol support.

Target Audience

Python developers building IoT systems, real-time messaging applications, or any project requiring asynchronous MQTT communication with support for modern protocol features.

Value Proposition

Developers choose gmqtt for its native asyncio integration, comprehensive MQTT v5.0 support, and automatic reconnection capabilities, making it a reliable and performant choice for scalable messaging solutions.

Overview

Python MQTT v5.0 async client

Use Cases

Best For

  • Building IoT applications that require asynchronous MQTT communication
  • Implementing MQTT v5.0 features like custom properties and session management
  • Developing high-performance messaging systems with automatic reconnection
  • Creating Python-based MQTT clients for real-time data streaming
  • Integrating with MQTT brokers in async Python frameworks
  • Handling large-scale subscriptions and publications with non-blocking I/O

Not Ideal For

  • Synchronous Python applications that do not use or want to adopt asyncio
  • Projects requiring only basic MQTT v3.1 functionality without async overhead
  • Developers needing a GUI-based MQTT client for quick testing and debugging
  • Teams looking for a library with extensive synchronous API support or legacy integration

Pros & Cons

Pros

Full MQTT v5.0 Support

Implements the entire MQTT 5.0 protocol with automatic downgrade to 3.1, as mentioned in the README, ensuring compatibility with modern brokers and legacy systems.

Asynchronous Performance

Built on asyncio for non-blocking operations and compatible with uvloop for enhanced event loop performance, making it ideal for high-concurrency applications as highlighted in the examples.

Automatic Reconnection

Configurable reconnect logic with unlimited retries by default, providing robust handling of network interruptions, detailed in the Reconnects section of the README.

Flexible Callback System

Supports both synchronous and asynchronous on_message callbacks with PUBACK code returns, allowing custom message processing logic, as shown in the callback examples.

Cons

Broker Compatibility Risks

The automatic downgrade to MQTT 3.1 relies on broker responses; if a broker fails to parse 5.0 packets correctly, connectivity issues may arise, as cautioned in the README.

Async-Only Design Limitation

Primarily designed for asyncio, making it less suitable for synchronous Python projects without additional setup or refactoring, which can increase complexity.

Configuration Verbosity

Setting up MQTT 5.0 properties like session expiry or user properties involves verbose code, as seen in the examples, potentially overcomplicating simple use cases.

Frequently Asked Questions

Quick Stats

Stars448
Forks55
Contributors0
Open Issues25
Last commit29 days ago
CreatedSince 2018

Tags

#iot#asyncio#python-library#mqtt#mqtt-v5#async#mqtt-client#async-io#messaging#python#network-protocols#python-asyncio

Built With

a
asyncio
u
uvloop
P
Python

Included in

MQTT2.3k
Auto-fetched 39 minutes ago

Related Projects

aiomqttaiomqtt

The idiomatic asyncio MQTT client

Stars565
Forks90
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub