mqttium 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. mqttium-0.1.0a1/.gitignore +21 -0
  2. mqttium-0.1.0a1/CHANGELOG.md +32 -0
  3. mqttium-0.1.0a1/CODE_OF_CONDUCT.md +6 -0
  4. mqttium-0.1.0a1/CONTRIBUTING.md +23 -0
  5. mqttium-0.1.0a1/LICENSE +202 -0
  6. mqttium-0.1.0a1/NOTICE +8 -0
  7. mqttium-0.1.0a1/PKG-INFO +156 -0
  8. mqttium-0.1.0a1/PROVENANCE.md +47 -0
  9. mqttium-0.1.0a1/README.md +111 -0
  10. mqttium-0.1.0a1/SECURITY.md +16 -0
  11. mqttium-0.1.0a1/benchmarks/application_stress.py +265 -0
  12. mqttium-0.1.0a1/benchmarks/compare_libs.py +312 -0
  13. mqttium-0.1.0a1/benchmarks/micro_baseline.py +49 -0
  14. mqttium-0.1.0a1/benchmarks/perf_sprint.py +323 -0
  15. mqttium-0.1.0a1/benchmarks/publish_many_ab.py +364 -0
  16. mqttium-0.1.0a1/benchmarks/realworld.py +371 -0
  17. mqttium-0.1.0a1/docs/BENCHMARKING.md +23 -0
  18. mqttium-0.1.0a1/docs/COMPAT.md +95 -0
  19. mqttium-0.1.0a1/docs/DESIGN.md +238 -0
  20. mqttium-0.1.0a1/docs/FUZZING.md +72 -0
  21. mqttium-0.1.0a1/docs/IMPLEMENTATION-GUIDE.md +269 -0
  22. mqttium-0.1.0a1/docs/LOGGING.md +89 -0
  23. mqttium-0.1.0a1/docs/MIGRATION.md +85 -0
  24. mqttium-0.1.0a1/docs/ROADMAP.md +36 -0
  25. mqttium-0.1.0a1/examples/pubsub.py +33 -0
  26. mqttium-0.1.0a1/pyproject.toml +108 -0
  27. mqttium-0.1.0a1/src/mqttium/__init__.py +18 -0
  28. mqttium-0.1.0a1/src/mqttium/api/__init__.py +19 -0
  29. mqttium-0.1.0a1/src/mqttium/api/async_client.py +1246 -0
  30. mqttium-0.1.0a1/src/mqttium/api/models.py +178 -0
  31. mqttium-0.1.0a1/src/mqttium/codec/__init__.py +15 -0
  32. mqttium-0.1.0a1/src/mqttium/codec/buffer.py +134 -0
  33. mqttium-0.1.0a1/src/mqttium/codec/primitives.py +113 -0
  34. mqttium-0.1.0a1/src/mqttium/codec/properties.py +348 -0
  35. mqttium-0.1.0a1/src/mqttium/codec/vbi.py +94 -0
  36. mqttium-0.1.0a1/src/mqttium/compat/README.md +7 -0
  37. mqttium-0.1.0a1/src/mqttium/compat/__init__.py +20 -0
  38. mqttium-0.1.0a1/src/mqttium/compat/paho.py +459 -0
  39. mqttium-0.1.0a1/src/mqttium/dispatch/__init__.py +5 -0
  40. mqttium-0.1.0a1/src/mqttium/dispatch/matcher.py +65 -0
  41. mqttium-0.1.0a1/src/mqttium/enums.py +72 -0
  42. mqttium-0.1.0a1/src/mqttium/errors.py +59 -0
  43. mqttium-0.1.0a1/src/mqttium/helpers/__init__.py +5 -0
  44. mqttium-0.1.0a1/src/mqttium/helpers/_common.py +32 -0
  45. mqttium-0.1.0a1/src/mqttium/helpers/publish.py +89 -0
  46. mqttium-0.1.0a1/src/mqttium/helpers/subscribe.py +98 -0
  47. mqttium-0.1.0a1/src/mqttium/packets/__init__.py +710 -0
  48. mqttium-0.1.0a1/src/mqttium/persistence/__init__.py +6 -0
  49. mqttium-0.1.0a1/src/mqttium/persistence/memory.py +83 -0
  50. mqttium-0.1.0a1/src/mqttium/persistence/sqlite.py +341 -0
  51. mqttium-0.1.0a1/src/mqttium/protocol/__init__.py +57 -0
  52. mqttium-0.1.0a1/src/mqttium/protocol/engine.py +1261 -0
  53. mqttium-0.1.0a1/src/mqttium/protocol/flow_control.py +54 -0
  54. mqttium-0.1.0a1/src/mqttium/protocol/negotiated.py +65 -0
  55. mqttium-0.1.0a1/src/mqttium/protocol/packet_ids.py +73 -0
  56. mqttium-0.1.0a1/src/mqttium/protocol/reconnect.py +88 -0
  57. mqttium-0.1.0a1/src/mqttium/protocol/validate.py +60 -0
  58. mqttium-0.1.0a1/src/mqttium/py.typed +0 -0
  59. mqttium-0.1.0a1/src/mqttium/topics.py +85 -0
  60. mqttium-0.1.0a1/src/mqttium/transport/__init__.py +17 -0
  61. mqttium-0.1.0a1/src/mqttium/transport/_stream.py +63 -0
  62. mqttium-0.1.0a1/src/mqttium/transport/tcp.py +29 -0
  63. mqttium-0.1.0a1/src/mqttium/transport/unix.py +16 -0
  64. mqttium-0.1.0a1/src/mqttium/transport/websocket.py +363 -0
  65. mqttium-0.1.0a1/src/mqttium/transport/writes.py +17 -0
  66. mqttium-0.1.0a1/src/mqttium/types.py +70 -0
  67. mqttium-0.1.0a1/tests/__init__.py +0 -0
  68. mqttium-0.1.0a1/tests/fuzz/fuzz.py +535 -0
  69. mqttium-0.1.0a1/tests/fuzz/test_hypothesis_fuzz.py +288 -0
  70. mqttium-0.1.0a1/tests/integration/test_mosquitto.py +48 -0
  71. mqttium-0.1.0a1/tests/support.py +61 -0
  72. mqttium-0.1.0a1/tests/unit/test_async_client.py +140 -0
  73. mqttium-0.1.0a1/tests/unit/test_async_lifecycle.py +128 -0
  74. mqttium-0.1.0a1/tests/unit/test_audit_full.py +294 -0
  75. mqttium-0.1.0a1/tests/unit/test_audit_regressions.py +133 -0
  76. mqttium-0.1.0a1/tests/unit/test_auth.py +141 -0
  77. mqttium-0.1.0a1/tests/unit/test_auth_contracts.py +106 -0
  78. mqttium-0.1.0a1/tests/unit/test_codec.py +105 -0
  79. mqttium-0.1.0a1/tests/unit/test_compat_callback_publish.py +114 -0
  80. mqttium-0.1.0a1/tests/unit/test_compat_confinement.py +84 -0
  81. mqttium-0.1.0a1/tests/unit/test_compat_lib_subset.py +180 -0
  82. mqttium-0.1.0a1/tests/unit/test_compat_paho.py +155 -0
  83. mqttium-0.1.0a1/tests/unit/test_config_contracts.py +94 -0
  84. mqttium-0.1.0a1/tests/unit/test_delivery_backpressure.py +108 -0
  85. mqttium-0.1.0a1/tests/unit/test_effect_atomicity.py +126 -0
  86. mqttium-0.1.0a1/tests/unit/test_engine_hardening_batch2.py +175 -0
  87. mqttium-0.1.0a1/tests/unit/test_fatal_disconnect.py +91 -0
  88. mqttium-0.1.0a1/tests/unit/test_fuzz_codec.py +53 -0
  89. mqttium-0.1.0a1/tests/unit/test_fuzz_contracts.py +64 -0
  90. mqttium-0.1.0a1/tests/unit/test_fuzz_smoke.py +25 -0
  91. mqttium-0.1.0a1/tests/unit/test_hardening.py +121 -0
  92. mqttium-0.1.0a1/tests/unit/test_helpers.py +84 -0
  93. mqttium-0.1.0a1/tests/unit/test_inbound_recovery.py +134 -0
  94. mqttium-0.1.0a1/tests/unit/test_keepalive.py +78 -0
  95. mqttium-0.1.0a1/tests/unit/test_manual_ack.py +99 -0
  96. mqttium-0.1.0a1/tests/unit/test_matcher.py +45 -0
  97. mqttium-0.1.0a1/tests/unit/test_message_delivery.py +95 -0
  98. mqttium-0.1.0a1/tests/unit/test_negotiation.py +121 -0
  99. mqttium-0.1.0a1/tests/unit/test_nonreplayable_failures.py +100 -0
  100. mqttium-0.1.0a1/tests/unit/test_packet_strictness.py +111 -0
  101. mqttium-0.1.0a1/tests/unit/test_performance_contracts.py +39 -0
  102. mqttium-0.1.0a1/tests/unit/test_properties.py +122 -0
  103. mqttium-0.1.0a1/tests/unit/test_publish_many.py +195 -0
  104. mqttium-0.1.0a1/tests/unit/test_qos2_matrix.py +119 -0
  105. mqttium-0.1.0a1/tests/unit/test_qos_engine.py +207 -0
  106. mqttium-0.1.0a1/tests/unit/test_reconnect_receipts.py +86 -0
  107. mqttium-0.1.0a1/tests/unit/test_reconnect_stale_effects.py +121 -0
  108. mqttium-0.1.0a1/tests/unit/test_segmented_payload.py +34 -0
  109. mqttium-0.1.0a1/tests/unit/test_session_semantics.py +104 -0
  110. mqttium-0.1.0a1/tests/unit/test_sqlite_store.py +169 -0
  111. mqttium-0.1.0a1/tests/unit/test_tls.py +157 -0
  112. mqttium-0.1.0a1/tests/unit/test_topics.py +65 -0
  113. mqttium-0.1.0a1/tests/unit/test_unix_transport.py +44 -0
  114. mqttium-0.1.0a1/tests/unit/test_utf8_symmetry.py +59 -0
  115. mqttium-0.1.0a1/tests/unit/test_websocket.py +226 -0
@@ -0,0 +1,21 @@
1
+ # Python bytecode and caches
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .hypothesis/
8
+
9
+ # Virtual environments and packaging
10
+ .venv/
11
+ *.egg-info/
12
+ build/
13
+ dist/
14
+
15
+ # Test and analysis output
16
+ .coverage
17
+ .coverage.*
18
+ coverage.xml
19
+ htmlcov/
20
+ tests/fuzz/artifacts/
21
+ benchmarks/results/
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ All notable changes to MQTTium are documented here.
4
+
5
+ The format follows Keep a Changelog and versions follow Semantic Versioning.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0a1] - 2026-08-03
10
+
11
+ ### Added
12
+
13
+ - Initial async-native MQTT 3.1.1 and MQTT 5 client spin-out.
14
+ - QoS 0/1/2, reconnect, session replay and multiple transports.
15
+ - In-memory and SQLite inflight persistence.
16
+ - Aggregate `publish_many()` pipeline with bounded memory.
17
+ - Additive Paho VERSION2 compatibility façade.
18
+ - Standalone Python 3.11–3.14 CI, fuzzing and Mosquitto integration tests.
19
+ - Wheel, source-distribution and isolated-install release validation.
20
+ - PEP 561 inline typing marker.
21
+ - PyPI Trusted Publishing workflow using GitHub OIDC.
22
+
23
+ ### Changed
24
+
25
+ - Replaced the original Paho-shaped topic matcher with an independent
26
+ flat-filter implementation before publication.
27
+ - Adopted PEP 639 license metadata and explicit Apache-2.0 package files.
28
+
29
+ ### Removed
30
+
31
+ - Pre-spin-out comparative analysis and generated coverage data from the
32
+ published source tree.
@@ -0,0 +1,6 @@
1
+ # Code of conduct
2
+
3
+ Be respectful, constructive and technically honest. Harassment, personal
4
+ attacks, discriminatory behavior and knowingly misleading security or
5
+ performance claims are not accepted. Maintainers may remove contributions or
6
+ restrict participation when necessary to keep the project safe and productive.
@@ -0,0 +1,23 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome while MQTTium is being prepared for its first public
4
+ package release.
5
+
6
+ ## Development
7
+
8
+ ```bash
9
+ python -m pip install -e ".[dev]"
10
+ ruff format --check src tests benchmarks
11
+ ruff check src tests benchmarks
12
+ mypy src/mqttium
13
+ python -m pytest -q tests/unit
14
+ ```
15
+
16
+ Integration tests require a local Mosquitto broker on the port configured by
17
+ the test suite.
18
+
19
+ ## Pull requests
20
+
21
+ Keep changes focused, add tests for observable behavior, and document any API,
22
+ protocol-state or persistence invariant that changes. Performance changes must
23
+ include a comparable benchmark and may not weaken correctness checks.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
mqttium-0.1.0a1/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ MQTTium
2
+ Copyright 2026 Yoch Melka
3
+
4
+ Initial development occurred as the mqttnext subtree of
5
+ https://github.com/yoch/paho.mqtt.python.
6
+
7
+ See PROVENANCE.md for the exact source commit, pull requests, validation record,
8
+ and licensing note used for this spin-out.
@@ -0,0 +1,156 @@
1
+ Metadata-Version: 2.4
2
+ Name: mqttium
3
+ Version: 0.1.0a1
4
+ Summary: Reliable async-native MQTT client for Python
5
+ Project-URL: Homepage, https://github.com/yoch/mqttium
6
+ Project-URL: Repository, https://github.com/yoch/mqttium
7
+ Project-URL: Issues, https://github.com/yoch/mqttium/issues
8
+ Project-URL: Changelog, https://github.com/yoch/mqttium/blob/main/CHANGELOG.md
9
+ Author-email: Yoch Melka <795960+yoch@users.noreply.github.com>
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ License-File: NOTICE
13
+ Keywords: asyncio,iot,messaging,mqtt
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Framework :: AsyncIO
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Communications
24
+ Classifier: Topic :: Internet
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Classifier: Typing :: Typed
27
+ Requires-Python: >=3.11
28
+ Provides-Extra: dev
29
+ Requires-Dist: mypy>=1.17; extra == 'dev'
30
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
31
+ Requires-Dist: pytest-cov>=6; extra == 'dev'
32
+ Requires-Dist: pytest>=8; extra == 'dev'
33
+ Requires-Dist: ruff>=0.16; extra == 'dev'
34
+ Provides-Extra: fuzz
35
+ Requires-Dist: hypothesis>=6.100; extra == 'fuzz'
36
+ Requires-Dist: pytest>=8; extra == 'fuzz'
37
+ Provides-Extra: release
38
+ Requires-Dist: build>=1.2; extra == 'release'
39
+ Requires-Dist: check-wheel-contents>=0.6; extra == 'release'
40
+ Requires-Dist: twine>=6; extra == 'release'
41
+ Requires-Dist: validate-pyproject[all]>=0.24; extra == 'release'
42
+ Provides-Extra: security
43
+ Requires-Dist: bandit>=1.8; extra == 'security'
44
+ Description-Content-Type: text/markdown
45
+
46
+ # MQTTium
47
+
48
+ **MQTTium is a reliable, async-native MQTT client for modern Python.**
49
+
50
+ It combines a synchronous protocol engine with an `asyncio` API, bounded
51
+ backpressure, durable inflight persistence, explicit delivery receipts, and
52
+ complete MQTT QoS state machines.
53
+
54
+ > **Status:** alpha (`0.1.0a1`). The implementation is extensively tested, but
55
+ > the public API may still change before the first stable release.
56
+
57
+ ## Features
58
+
59
+ - MQTT 3.1.1 and MQTT 5;
60
+ - QoS 0, 1 and 2 with one authoritative protocol state machine;
61
+ - TCP, TLS, WebSocket and Unix transports;
62
+ - reconnect and session replay;
63
+ - bounded callback and async-iterator delivery;
64
+ - manual acknowledgement;
65
+ - in-memory and SQLite inflight persistence;
66
+ - aggregate `publish_many()` with bounded memory and measured throughput gains;
67
+ - an additive Paho VERSION2 compatibility façade, isolated from the native API;
68
+ - inline type information for type checkers.
69
+
70
+ Python **3.11–3.14** is supported. MQTTium is licensed under **Apache-2.0**.
71
+
72
+ ## Installation
73
+
74
+ ```bash
75
+ python -m pip install mqttium
76
+ ```
77
+
78
+ To work on the unreleased development version:
79
+
80
+ ```bash
81
+ git clone https://github.com/yoch/mqttium.git
82
+ cd mqttium
83
+ python -m pip install -e ".[dev,fuzz,release]"
84
+ ```
85
+
86
+ ## Quick start
87
+
88
+ ```python
89
+ import asyncio
90
+
91
+ from mqttium.api import AsyncClient
92
+
93
+
94
+ async def main() -> None:
95
+ client = AsyncClient("demo-client")
96
+ await client.connect("127.0.0.1", 1883)
97
+ await client.subscribe("demo/#")
98
+
99
+ receipt = await client.publish("demo/hello", b"world", qos=1)
100
+ await receipt.wait()
101
+
102
+ await client.disconnect()
103
+
104
+
105
+ asyncio.run(main())
106
+ ```
107
+
108
+ ## Batched publishing
109
+
110
+ `publish_many()` consumes iterables in bounded chunks and returns one aggregate
111
+ receipt rather than creating one task or event per message:
112
+
113
+ ```python
114
+ from mqttium.api import PublishMessage
115
+
116
+ batch = await client.publish_many(
117
+ PublishMessage("telemetry/device-1", payload, qos=1)
118
+ for payload in payloads
119
+ )
120
+ await batch.wait()
121
+ ```
122
+
123
+ The retained paired A/B benchmark measured publisher-throughput geomean
124
+ improvements of **36.9% for QoS 0**, **15.9% for QoS 1**, and **7.0% for QoS 2**
125
+ against equivalent individual publishing pipelines on the validated source
126
+ tree. Benchmark methodology and limitations are documented in
127
+ [`docs/BENCHMARKING.md`](docs/BENCHMARKING.md).
128
+
129
+ ## Validation
130
+
131
+ The release gates include:
132
+
133
+ - more than 240 unit tests;
134
+ - Mosquitto integration tests on Python 3.11, 3.12, 3.13 and 3.14;
135
+ - deterministic and Hypothesis-based fuzzing;
136
+ - Ruff formatting and linting;
137
+ - mypy validation and a PEP 561 `py.typed` marker;
138
+ - an 80% coverage gate;
139
+ - wheel, source-distribution and isolated-install validation;
140
+ - delivery, persistence, TCP, TLS and WAN-profile benchmarks.
141
+
142
+ ## Documentation
143
+
144
+ - [`docs/DESIGN.md`](docs/DESIGN.md) — architecture and invariants
145
+ - [`docs/IMPLEMENTATION-GUIDE.md`](docs/IMPLEMENTATION-GUIDE.md) — protocol contracts
146
+ - [`docs/COMPAT.md`](docs/COMPAT.md) — Paho compatibility surface
147
+ - [`docs/MIGRATION.md`](docs/MIGRATION.md) — migration guidance
148
+ - [`docs/BENCHMARKING.md`](docs/BENCHMARKING.md) — benchmark validity contract
149
+ - [`docs/FUZZING.md`](docs/FUZZING.md) — fuzzing strategy
150
+ - [`docs/ROADMAP.md`](docs/ROADMAP.md) — remaining stable-release work
151
+ - [`PROVENANCE.md`](PROVENANCE.md) — source history and licensing review
152
+
153
+ ## Contributing and security
154
+
155
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md). Report vulnerabilities through the
156
+ private process described in [`SECURITY.md`](SECURITY.md).
@@ -0,0 +1,47 @@
1
+ # Provenance
2
+
3
+ MQTTium was initially developed as the independent `mqttnext/` subtree in
4
+ [`yoch/paho.mqtt.python`](https://github.com/yoch/paho.mqtt.python).
5
+
6
+ ## Spin-out source
7
+
8
+ - source commit: `bcdff1a22889c90ec635f658aee13fb318038af0`;
9
+ - production-hardening line: pull request #6;
10
+ - measured core optimizations: pull request #8;
11
+ - aggregate `publish_many()` implementation: pull request #9.
12
+
13
+ The dedicated repository was created by extracting only the `mqttnext/`
14
+ subtree from that exact commit, moving it to the repository root, renaming the
15
+ Python distribution and import package to `mqttium`, and rebuilding the GitHub
16
+ workflows for a standalone repository. No `mqttnext` compatibility alias is
17
+ retained.
18
+
19
+ ## Validation inherited from the source tree
20
+
21
+ The exact production code was validated with 245 unit tests, Mosquitto
22
+ integration on Python 3.11/3.12/3.13, Ruff, mypy, deterministic fuzzing,
23
+ Hypothesis fuzzing, and an 80% coverage gate.
24
+
25
+ The final retained `publish_many()` benchmark decision was based on a paired
26
+ A/B run whose artifact digest was:
27
+
28
+ `sha256:3357e8f1928860ac1f42f74810fefea68adb29d04af50450cddbdc6fa43abefe`
29
+
30
+ ## Licensing review
31
+
32
+ The initial file-level review was completed before the first package release:
33
+
34
+ - MQTTium's protocol, transport, persistence and public API implementations are
35
+ original code distributed under Apache-2.0;
36
+ - the Paho compatibility package implements documented public behaviour and
37
+ does not vendor Paho source files;
38
+ - tests and documentation reference Paho and gmqtt for behavioural comparison
39
+ and migration guidance only;
40
+ - the original trie matcher, whose structure followed Paho's matcher closely,
41
+ was replaced with an independent flat-filter implementation before release;
42
+ - no generated coverage databases, benchmark results or upstream license files
43
+ are included as package source.
44
+
45
+ References to Eclipse Paho and gmqtt are nominative interoperability and
46
+ provenance references. Their names and licenses do not apply to MQTTium's
47
+ independent implementation.
@@ -0,0 +1,111 @@
1
+ # MQTTium
2
+
3
+ **MQTTium is a reliable, async-native MQTT client for modern Python.**
4
+
5
+ It combines a synchronous protocol engine with an `asyncio` API, bounded
6
+ backpressure, durable inflight persistence, explicit delivery receipts, and
7
+ complete MQTT QoS state machines.
8
+
9
+ > **Status:** alpha (`0.1.0a1`). The implementation is extensively tested, but
10
+ > the public API may still change before the first stable release.
11
+
12
+ ## Features
13
+
14
+ - MQTT 3.1.1 and MQTT 5;
15
+ - QoS 0, 1 and 2 with one authoritative protocol state machine;
16
+ - TCP, TLS, WebSocket and Unix transports;
17
+ - reconnect and session replay;
18
+ - bounded callback and async-iterator delivery;
19
+ - manual acknowledgement;
20
+ - in-memory and SQLite inflight persistence;
21
+ - aggregate `publish_many()` with bounded memory and measured throughput gains;
22
+ - an additive Paho VERSION2 compatibility façade, isolated from the native API;
23
+ - inline type information for type checkers.
24
+
25
+ Python **3.11–3.14** is supported. MQTTium is licensed under **Apache-2.0**.
26
+
27
+ ## Installation
28
+
29
+ ```bash
30
+ python -m pip install mqttium
31
+ ```
32
+
33
+ To work on the unreleased development version:
34
+
35
+ ```bash
36
+ git clone https://github.com/yoch/mqttium.git
37
+ cd mqttium
38
+ python -m pip install -e ".[dev,fuzz,release]"
39
+ ```
40
+
41
+ ## Quick start
42
+
43
+ ```python
44
+ import asyncio
45
+
46
+ from mqttium.api import AsyncClient
47
+
48
+
49
+ async def main() -> None:
50
+ client = AsyncClient("demo-client")
51
+ await client.connect("127.0.0.1", 1883)
52
+ await client.subscribe("demo/#")
53
+
54
+ receipt = await client.publish("demo/hello", b"world", qos=1)
55
+ await receipt.wait()
56
+
57
+ await client.disconnect()
58
+
59
+
60
+ asyncio.run(main())
61
+ ```
62
+
63
+ ## Batched publishing
64
+
65
+ `publish_many()` consumes iterables in bounded chunks and returns one aggregate
66
+ receipt rather than creating one task or event per message:
67
+
68
+ ```python
69
+ from mqttium.api import PublishMessage
70
+
71
+ batch = await client.publish_many(
72
+ PublishMessage("telemetry/device-1", payload, qos=1)
73
+ for payload in payloads
74
+ )
75
+ await batch.wait()
76
+ ```
77
+
78
+ The retained paired A/B benchmark measured publisher-throughput geomean
79
+ improvements of **36.9% for QoS 0**, **15.9% for QoS 1**, and **7.0% for QoS 2**
80
+ against equivalent individual publishing pipelines on the validated source
81
+ tree. Benchmark methodology and limitations are documented in
82
+ [`docs/BENCHMARKING.md`](docs/BENCHMARKING.md).
83
+
84
+ ## Validation
85
+
86
+ The release gates include:
87
+
88
+ - more than 240 unit tests;
89
+ - Mosquitto integration tests on Python 3.11, 3.12, 3.13 and 3.14;
90
+ - deterministic and Hypothesis-based fuzzing;
91
+ - Ruff formatting and linting;
92
+ - mypy validation and a PEP 561 `py.typed` marker;
93
+ - an 80% coverage gate;
94
+ - wheel, source-distribution and isolated-install validation;
95
+ - delivery, persistence, TCP, TLS and WAN-profile benchmarks.
96
+
97
+ ## Documentation
98
+
99
+ - [`docs/DESIGN.md`](docs/DESIGN.md) — architecture and invariants
100
+ - [`docs/IMPLEMENTATION-GUIDE.md`](docs/IMPLEMENTATION-GUIDE.md) — protocol contracts
101
+ - [`docs/COMPAT.md`](docs/COMPAT.md) — Paho compatibility surface
102
+ - [`docs/MIGRATION.md`](docs/MIGRATION.md) — migration guidance
103
+ - [`docs/BENCHMARKING.md`](docs/BENCHMARKING.md) — benchmark validity contract
104
+ - [`docs/FUZZING.md`](docs/FUZZING.md) — fuzzing strategy
105
+ - [`docs/ROADMAP.md`](docs/ROADMAP.md) — remaining stable-release work
106
+ - [`PROVENANCE.md`](PROVENANCE.md) — source history and licensing review
107
+
108
+ ## Contributing and security
109
+
110
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md). Report vulnerabilities through the
111
+ private process described in [`SECURITY.md`](SECURITY.md).
@@ -0,0 +1,16 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ Until MQTTium reaches a stable release, security fixes are applied to the latest
6
+ published `0.x` release and the `main` development branch.
7
+
8
+ ## Reporting a vulnerability
9
+
10
+ Do not disclose suspected vulnerabilities in a public issue. Use GitHub's
11
+ private vulnerability reporting flow:
12
+
13
+ https://github.com/yoch/mqttium/security/advisories/new
14
+
15
+ Include affected versions, reproduction steps, expected impact, and any known
16
+ mitigation. You should receive an initial acknowledgement within seven days.