Skip to main content

No project description provided

Project description

FastMQTT

A performant, flexible, and user-friendly MQTT client library built on top of aiomqtt. FastMQTT simplifies message handling, advanced subscriptions, and convenient request-response patterns within the MQTT protocol.

Key Features

  • Efficient Message Handling: Streamlined asynchronous message processing.
  • Robust Router: Define topic-based message routing with QoS, no_local, retain options.
  • Subscription Management: Effortlessly manage subscriptions, including retained messages.
  • Request-Response Patterns: Convenient ResponseContext for request-response communication over MQTT.
  • Correlation Tracking: Automatic correlation ID generation to match responses with their requests.
  • aiomqtt Foundation: Built upon the reliable aiomqtt library for core MQTT functionality.

Installation

pip install fastmqtt

Basic Usage

import asyncio

from fastmqtt import FastMQTT, Message, MQTTRouter

router = MQTTRouter()


@router.on_message("my/topic")  # Subscribe and handle incoming messages
async def message_handler(message: Message):
    print(f"Message received: {message.payload.text()} on topic {message.topic}")


async def main():
    fastmqtt = FastMQTT("test.mosquitto.org", routers=[router])

    async with fastmqtt:  # Connect and automatically handle subscriptions
        await fastmqtt.publish("my/topic", "Hello from FastMQTT!")
        await asyncio.sleep(5)  # Keep running for a bit


if __name__ == "__main__":
    asyncio.run(main())

Contributions

We welcome contributions to improve FastMQTT! Please open issues for bug reports or feature suggestions, and fork the repository to submit pull requests.

Let me know if you'd like modifications or have specific aspects you want to emphasize in the README!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastmqtt-0.1.5.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

fastmqtt-0.1.5-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file fastmqtt-0.1.5.tar.gz.

File metadata

  • Download URL: fastmqtt-0.1.5.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for fastmqtt-0.1.5.tar.gz
Algorithm Hash digest
SHA256 77c77ef6e3162c66e432ee66babd1bc22b07dcc104f4ae9877e36ee472f14821
MD5 992f00a03e8577e1b014bd4ad7bda441
BLAKE2b-256 cfe0b7c8bf29dddaf12a5d3b163b0b76dfba0662eb52ab095f1fa500e9472822

See more details on using hashes here.

File details

Details for the file fastmqtt-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: fastmqtt-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for fastmqtt-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d3a893823402f96712dc0b37a6ce61b119b3633e70c41dd199ec1f8bb914afd7
MD5 672e0e005e73a0c5a09e660315c95235
BLAKE2b-256 2d3e132fe664f3f37ce5d66a0d868b48c334e4868ffb4826b66bb30d371d8270

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page