As part of the ongoing work on mosquitto 0.16, the libmosquitto C client library has been ported to Python. It provides complete MQTTv3.1 support and will eventually remove the need for the current Python wrapper around the C library and will allow it to be used more easily and in more situations.

The interface is largely the same as the existing Python wrapper. The differences are that it uses the current development interface which differs slightly from that in 0.15 (see the Python documentation), not all of the new interface is implemented – there is no threading support and finally some datatypes may be more Python like (e.g. lists in on_subscribe() callback rather than an integer).

The conversion from ~4000 lines C to ~1000 lines Python took just two evenings and is now ready for testing. It is available in the 0.16 branch in the bitbucket repository, or as a single file at

Please give it a try and report any bugs you find using any of the methods on the Support page.

Please note that the new Python module does not currently support Python 3.