Skip to main content
## Python Client for MQTT-SN brokers

### Usage examples

```python
from mqttsn.client import Client, Callback

import sys


class MyCallback(Callback):
def message_arrived(self, topic_name, payload, qos, retained, msgid):
print(f'{self} | topic_name: {topic_name} | payload: {payload} | '
f'qos {qos} | retained {retained} | msgid {msgid}',
file=sys.stderr)

return True


if __name__ == '__main__':
aclient = Client("linh", port=1883)
aclient.register_callback(MyCallback())
aclient.connect()

rc, topic1 = aclient.subscribe("topic1")
print("topic id for topic1 is", topic1)

rc, topic2 = aclient.subscribe("topic2")
print("topic id for topic2 is", topic2)

aclient.publish(topic1, "aaaa", qos=0)
aclient.publish(topic2, "bbbb", qos=0)

aclient.unsubscribe("topic1")

aclient.publish(topic2, "cccc", qos=0)
aclient.publish(topic1, "dddd", qos=0)

aclient.disconnect()
```


Metadata

Release files for mqttsn 0.0.4

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

Source distribution (sdist)

Source distribution for mqttsn 0.0.4
File Size Uploaded Provenance Actions
mqttsn-0.0.4.tar.gz 11.7 kB Without provenance Details for mqttsn-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mqttsn 0.0.4
File Interpreter ABI Platform Actions
mqttsn-0.0.4-py3-none-any.whl Python 3 none any Details for mqttsn-0.0.4-py3-none-any.whl

Total release size: 29.6 kB

Release files / mqttsn-0.0.4.tar.gz

Download URL mqttsn-0.0.4.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
12ebc472e997c8a31884fb106860d7081178c989a6579f8b3e48e247adee9243
BLAKE2b-256 checksum
How to use checksums
c50289353c7619ed72f796f29885457a3c6617541bfb416ebf685a630e3be623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / mqttsn-0.0.4-py3-none-any.whl

Download URL mqttsn-0.0.4-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ca2153aee514511e28ee3f663b42eb90e4b424914a8b1a4d1e31d1a4ea1ab5d
BLAKE2b-256 checksum
How to use checksums
0dcb3c18a984a13253e2a6c6f859d92e970bea133baa825a8def77782683fd56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for mqttsn 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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