tags:

views:

3141

answers:

6

There seem to be several options for Python XMPP client libraries -- I'm not totally sure what I'm getting myself into (just fiddling around at this point), so I'm looking for some advice on which XMPP library has the most mature/Pythonic client API. (Or, to be more objective about it, an assessment of the relative strengths/weaknesses of the available libraries.) TIA!

+1  A: 

I'm not sure about what exactly it is that you need -- the only one I've used in my modest amount of experimentation with XMPP is this one and it proved quite satisfactory from my limited POV. Looking forwards to other answers explaining how other libraries "get it right" over xmpppy and exactly how!-)

Alex Martelli
I'm not exactly sure -- I'm pretty much fishing for others who have used multiple libraries for XMPP who can point at some advantages of one over another. Unfortunately, I haven't been able to find many comparison pieces (Python-wiki style) from recent history.
cdleary
I use xmpppy (as pacakged in debian as python-xmpp), and haven't found any issues with it... http://packages.debian.org/python-xmpp
Stobor
Debian package has an interesting note: 'This is a set of modules providing functionality for writing XMPP-compliant clients or server components in Python. This library was initially designed as "rework" of jabberpy library but lately become a separate product.' Doesn't indicate why it's now separate.
cdleary
@cdleary: http://markmail.org/message/sfjav5xwc4x3hpd4 says: "... when I start xmpppy project I was already maintainer of jabber.py....Though it was very hard to implement TLS and SASL in it so I initially begun to rewrite jabber.py and then found that the work is not worth it and it will be better to start new project. ... I started xmpppy to solve jabberpy's architecture problems."
Stobor
+3  A: 

Pretty much all the python I write these days is in twisted. wokkel is a pretty good xmpp library atop twisted.

Dustin
+2  A: 

It's been almost 4 years since I've done any Jabber/XMPP work so my viewpoint is probably outdated. On top of that I was doing server side stuff, but the basic mechanisms for routing messages and deciding what to do is pretty much the same.

Anyway, that out of the way, the only Python library (at the time) that I found usable was Twisted. Jabber.py and almost all of its derivatives were ... weak. Very weak.

But looking at the source for xmppy linked by Alex I would say it's mature and usable. There's definitely no trace of any jabber.py origin. Protocol support looks to be complete and it's strong enough to be the basis for several other serious projects.

However, I think I'd personally still use Twisted, just because XPath expressions to fetch message content feels more natural to me, especially after having worked in Jabber stuff in C so long.

Van Gale
+1  A: 

For most of my work I use Twisted Words + wokkel, but for simple stuff, SleekXMPP is pretty easy to work with.

Not a fan Jabber.py or xmpppy.

Kevin Horn
Any reasons why you're not a fan of those last two? (Or why you're a fan of the first one?)
cdleary
jabber.py is **old** - the home page says that the last release was in 2003.xmpppy - I have no specific complaints, but I just never managed to get it to do much more than log in, and maybe send a message. Just feels clunky. Of course that's totally subjective...YMMV.
Kevin Horn
+4  A: 

The recent O'Reilly book "XMPP: The Definitive Guide" uses SleekXMPP as a basis for its examples.

The cool thing about SleekXMPP is the number of extensions it supports: "The goals of the project are ease of implementation, and complete draft XEP (XMPP Extended Protocol) coverage".

Documentation is a downside. It's GPL licensed which some people think of as a downside. Also, it's Python 3k* (which is both good and bad, depending on what state the rest of your code base is in).

*) Branches/0.2 is apparently the the last Python 2.5+ version. The developer of SleekXMPP mentioned on Twitter that he's happy to maintain that version, but not backport new features.


Since writing this, I can also wholeheartedly recommend wokkel.

lemonad
+2  A: 

I have tried both xmpppy and pyxmpp and xmpppy loses in pretty much /every/ aspect, in my book. Mostly: the API is very very clunky. To me, it basically feels like a library from a random language that was ported to Python, while pyxmpp feels more like a language that was really written in Python.

This claim requires some hard examples to back it up but I am afraid that it is a bit too long ago since I have written my last bit of xmpppy. My first program ever was a chatbot (obviously): I started out with xmpppy but quickly moved to pyxmpp. It was a relief.

pyxmpp: http://pyxmpp.jajcus.net/

hraban