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.4.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastmqtt-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9acaa0abda6701c042749be9762b964368fb96404c22d75fc4a193bf76e8b140
MD5 0a52b0f521b5f00f9b94e72a24f1aaf6
BLAKE2b-256 047a3c68f12a13e6c51b2424d16077fca5b2336e7709213e44b703bde3e92866

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastmqtt-0.1.4-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.2

File hashes

Hashes for fastmqtt-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aef815347115cbe75acc70a7932714e7a29b14f01ed41bbdfcdbf88c4c94dfcf
MD5 ff9ddc7a9b581e9e998109af8ff4797f
BLAKE2b-256 25f1ddba64f4691d4a537fc914200ac58f9de3cfcb08aa4419492240c13a3b7e

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