wiki:Notes/PythonOpenfire

Python And Openfire

Info about Python and the Openfire XMPP server.

See - JavaOpenfire

SleekXMPP

https://github.com/fritzy/SleekXMPP

SleekXMPP is an MIT licensed XMPP library for Python 2.6/3.1+, and is featured in examples in XMPP: The Definitive Guide by Kevin Smith, Remko Tronçon, and Peter Saint-Andre.

SleekXMPP's design goals and philosphy are:

Low number of dependencies - requires dnspython, pyasn1, pyasn1_modules

Every XEP as a plugin - XEP support is done through easy to create plugins

... SleekXMPP should allow things to "just work" using sensible defaults and appropriate abstractions.

https://pypi.python.org/pypi/sleekxmpp

xmpppy

http://xmpppy.sourceforge.net/

xmpppy is a Python library that is targeted to provide easy scripting with Jabber. Similar projects are Twisted Words and jabber.py.

This library was not designed from scratch. It inherits some code from jabberpy and have very similar API in many places. Though it is separate project since it have almost completely different architecture and primarily aims to work with jabberd2 - the new Open Source Jabber Server.

http://sourceforge.net/projects/xmpppy/files/ - last release early 2009

http://blogs.cisco.com/getyourbuildon/xmpp-a-power-tool-in-your-tool-box

XMPP: A Power Tool in Your Tool Box ...

There are more advantages in using XMPP on NX-OS, as Python can be enhanced with the xmpppy library (http://xmpppy.sourceforge.net) and I can quickly write a script that will send the infamous “Hello world” message to the console of the switch.

import xmpp

cmd="send session console Hello World \n"
jid="admin@dcnm-ova.cisco.com"
pwd="cisco123"
to="leaf0@dcnm-ova.cisco.com"

jid=xmpp.protocol.JID(jid)

cl=xmpp.Client(jid.getDomain(), debug=[])
cl.connect()
cl.auth(jid.getNode(),pwd)
cl.sendInitPresence()

message=xmpp.Message(to, cmd)
message.setAttr('type', 'chat')

cl.send(message)

Python Openfire Module

https://pypi.python.org/pypi/python-openfire

A python client for openfire’s api

https://github.com/plazix/python-openfire

Very thin, no release in 2 years.

Also See

Search !PyPi for 'openfire'

Search wiki for 'openfire'

Last modified 2 years ago Last modified on 04/16/2015 02:04:06 PM