Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Python bindings for the MQTT C client

Andy,

yes, in this case we would control both sides of the story.  I believe we can also package the C client library within the Python distribution package, and tell the Python bindings to use the included client library.  That way, when someone installs the Python package, they get the whole deal, no external requirements.  When they upgrade the Python package, both bindings and client library are updated at the same time.

b) There is a possibility of a pure Python client, but this is quicker!

Ian


On 20/03/13 16:29, andypiperuk@xxxxxxxxx wrote:
For reasons why I'm in favour of a pure Python / no C dependency if possible (the ease of implementation of the latter notwithstanding), I follow the "other" MQ Python bindings project - pymqi for WMQ - and I know that new releases of MQ libs cause compatibility issues (see https://bugs.launchpad.net/pymqi/+bug/1060771)

I realise that we'd control both sides of the story in this case, but it does highlight that a standalone Python implementation is nicer.

Having said all of that, if it's easy to contribute something that binds to the C library then I'm also in favour of getting as much code "out there" as possible :-)



On Wed, Mar 20, 2013 at 4:25 PM, andypiperuk@xxxxxxxxx <andypiperuk@xxxxxxxxx> wrote:
Any additional client support is welcome!

Is there any possibility of a pure client though? I know mosquitto moved from a Python->C binding based on libmosquitto to a pure Python client. Certainly more flexible to deploy that way.

Would we also be thinking of submitting the client to PyPi? in which case we might want to think about naming. Maybe just mqtt instead of mqttv3, assuming there isn't such a Python package already? or paho? (just checked, only nyamuk and mosquitto in PyPi at present).

Also, a related question on the C side of things - is the C client now at parity with the Java one e.g. on things like #3902052 https://bugs.eclipse.org/bugs/show_bug.cgi?id=392052

Andy



On Wed, Mar 20, 2013 at 3:59 PM, Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hello all,

I am planning to add Python bindings for the MQTT C client libraries.  Dave Locke asked me how this would compare to a pure Python client.  Adding the Python bindings is a small amount of work compared to writing the C client in the first place, so my feeling is why wouldn't you?  Different approaches may well have different applications.

The bindings up to now have been written primarily to make testing of the C client easy, so they mirror the structure of the C API quite closely.  To make them more "Pythonic", I would refactor them so that now we have:

import mqttv3

client = mqttv3.create(...)

mqttv3.connect(client, ...)

but then we would have:

import mqttv3

client = mqttv3.create(...)

client.connect(...)

Any thoughts welcome.

Ian
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/paho-dev



--
Andy Piper | Farnborough, Hampshire (UK)
blog: http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images: http://www.flickr.com/photos/andypiper



--
Andy Piper | Farnborough, Hampshire (UK)
blog: http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images: http://www.flickr.com/photos/andypiper


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/paho-dev


Back to the top