BLOG

“XMPP: The Definitive Guide” Code Examples

Remko Tronçon ·

Although the primary focus of XMPP: The Definitive Guide is explaning the XMPP protocol and all its extensions through text and illustrations, we also included a few Python code examples to help people get started with implementing their own ideas. In fact, we devoted a whole chapter to building an XMPP application, starting out with a simple bot implementation, but gradually extending the application into a full server component. For people who want to try this out for themselves, we’re releasing the source code of all code examples, including a simple echo bot, and different variants of the CheshiR microblogging platform XMPP interface.

All examples are built using the lightweight SleekXMPP Python XMPP library. In fact, SleekXMPP is so lightweight that we included a version in the source bundle, making it even easier to get started implementing your own bots and components.

Do bear in mind that these examples only serve illustrative purposes for the book, so don’t expect very robust code. Although making this code fail-safe is not really our primary goal (since that would involve a lot of code that would only distract the reader), we do welcome bug reports or fixes.

The code examples are available as a source package, or directly from the Git repository (mirrored on GitHub). We will soon put a link to the package on the book’s webpage.