Skip to main content

Slixmpp is an elegant Python library for XMPP (aka Jabber).

Project description

Slixmpp is an MIT licensed XMPP library for Python 3.7+. It is a fork of SleekXMPP.

Slixmpp’s goals is to only rewrite the core of the library (the low level socket handling, the timers, the events dispatching) in order to remove all threads.

Building

Slixmpp uses rust to improve performance on critical modules. Binaries may already be available for your platform in the form of wheels provided on PyPI or packages for your linux distribution. If that is not the case, cargo must be available in your path to build the extension module.

Documentation and Testing

Documentation can be found both inline in the code, and as a Sphinx project in /docs. To generate the Sphinx documentation, follow the commands below. The HTML output will be in docs/_build/html:

cd docs
make html
open _build/html/index.html

To run the test suite for Slixmpp:

python run_tests.py

Integration tests require the following environment variables to be set::

$CI_ACCOUNT1
$CI_ACCOUNT1_PASSWORD
$CI_ACCOUNT2
$CI_ACCOUNT2_PASSWORD
$CI_MUC_SERVER

where the account variables are JIDs of valid, existing accounts, and the passwords are the account passwords. The MUC server must allow room creation from those JIDs.

To run the integration test suite for Slixmpp:

python run_integration_tests.py

The Slixmpp Boilerplate

Projects using Slixmpp tend to follow a basic pattern for setting up client/component connections and configuration. Here is the gist of the boilerplate needed for a Slixmpp based project. See the documentation or examples directory for more detailed archetypes for Slixmpp projects:

import asyncio
import logging

from slixmpp import ClientXMPP
from slixmpp.exceptions import IqError, IqTimeout


class EchoBot(ClientXMPP):

    def __init__(self, jid, password):
        ClientXMPP.__init__(self, jid, password)

        self.add_event_handler("session_start", self.session_start)
        self.add_event_handler("message", self.message)

        # If you wanted more functionality, here's how to register plugins:
        # self.register_plugin('xep_0030') # Service Discovery
        # self.register_plugin('xep_0199') # XMPP Ping

        # Here's how to access plugins once you've registered them:
        # self['xep_0030'].add_feature('echo_demo')

        # If you are working with an OpenFire server, you will
        # need to use a different SSL version:
        # import ssl
        # self.ssl_version = ssl.PROTOCOL_SSLv3

    def session_start(self, event):
        self.send_presence()
        self.get_roster()

        # Most get_*/set_* methods from plugins use Iq stanzas, which
        # can generate IqError and IqTimeout exceptions
        #
        # try:
        #     self.get_roster()
        # except IqError as err:
        #     logging.error('There was an error getting the roster')
        #     logging.error(err.iq['error']['condition'])
        #     self.disconnect()
        # except IqTimeout:
        #     logging.error('Server is taking too long to respond')
        #     self.disconnect()

    def message(self, msg):
        if msg['type'] in ('chat', 'normal'):
            msg.reply("Thanks for sending\n%(body)s" % msg).send()


if __name__ == '__main__':
    # Ideally use optparse or argparse to get JID,
    # password, and log level.

    logging.basicConfig(level=logging.DEBUG,
                        format='%(levelname)-8s %(message)s')

    xmpp = EchoBot('somejid@example.com', 'use_getpass')
    xmpp.connect()
    asyncio.get_event_loop().run_forever()

Slixmpp Credits

Maintainers:
Contributors:

Credits (SleekXMPP)

Main Author: Nathan Fritz

fritzy@netflint.net, @fritzy

Nathan is also the author of XMPPHP and Seesmic-AS3-XMPP, and a former member of the XMPP Council.

Co-Author: Lance Stout

lancestout@gmail.com, @lancestout

Contributors:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slixmpp-1.13.0.tar.gz (757.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

slixmpp-1.13.0-cp314-cp314-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

slixmpp-1.13.0-cp314-cp314-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

slixmpp-1.13.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

slixmpp-1.13.0-cp313-cp313-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

slixmpp-1.13.0-cp313-cp313-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

slixmpp-1.13.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

slixmpp-1.13.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

slixmpp-1.13.0-cp312-cp312-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

slixmpp-1.13.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

slixmpp-1.13.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

slixmpp-1.13.0-cp311-cp311-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ ARM64

slixmpp-1.13.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

Details for the file slixmpp-1.13.0.tar.gz.

File metadata

  • Download URL: slixmpp-1.13.0.tar.gz
  • Upload date:
  • Size: 757.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for slixmpp-1.13.0.tar.gz
Algorithm Hash digest
SHA256 f138aae4ad951815495965f580ef6728ead7ca0050d1098db7a39babce884e78
MD5 e2595a1c3a2bb8a941170b11bd9ead9d
BLAKE2b-256 9b92d21bfc14a862540b5d07230538b41d144a9d2e5ea28d309d29a713c97bd5

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 492cd6d15c4fd0fd69ee603eef99d5efdd659b75f5ff4888a22703cafb242237
MD5 fc2dc314804fe59dc473d9a8c1cc79d7
BLAKE2b-256 a7f4327bc8ca844643c2e06f8864d3f89f810a7e919ffc855deac9cb300a2f1b

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp314-cp314-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 43ff6bde35d8d1024412f0b1d6793edfe191ece97e100c38982f368aa1595a22
MD5 d1f63c30513fc63cfa95acd4de0497f5
BLAKE2b-256 68c6ba5eccf211b40dbdb60731b5fc2df3681b3f9713c08ae640a243cc8be98f

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dc2d2b108746f5aec2f332eb8d9a8a263c0ff6818b9ef2913ac975392106af29
MD5 b5799c2704a07fab7f1c48979145a158
BLAKE2b-256 9a0839a63cb6bbe2b791cde1eb8b6b7c977c89d8dd8e613cda80a7225476a840

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3a45607e32701d9e30b02fb253df3f22caa078bb8aa84297a90bda398ba17504
MD5 097db2e72698849b00901a958127d3ca
BLAKE2b-256 fb582077af0e5210d5bde3d00f23679d61fcfe206a8930f28b4708a4cf8314eb

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp313-cp313-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a3ebcbf7261e1e433196b95530ff454f9fc3e37758805d08bec6f4b9076556b2
MD5 536e3893c1b0d00782f1ae06f520adae
BLAKE2b-256 7366a7141efe43394d89c9e6f9a91e25e6ce87aa993233021d6693854ff5e2b0

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 616a442d0aa6e4a9513785177675b8ef7675f29c922b56531c0c0bfc64b5bc87
MD5 cfe04b42542b9c366035fcd60eb52320
BLAKE2b-256 c3d948448b36b7376b2b43ad0c22c1a192e54f26aef6c8b8b0089cdf928803ed

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 de4eee6e2a33c0756cb062ce26ef420e7464324a8e063212a8a7d7d818055d3f
MD5 3b8e0518eaf2555a680737ed852ebc1a
BLAKE2b-256 2444bf1ee4bfcad35633a68ca14a75a046793c75b625b68f913b8736829bba37

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp312-cp312-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a7ba19611a7717478778c0492e2f67b37099cd78866aefa0abd50052f64d0445
MD5 b1ce0f3b4a8672e2befefb3d9c6a728a
BLAKE2b-256 4a36666dbaaab7e75b4953e576ee3453b79b9f47bf37580f933c6621229b3bcd

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2307f6aaa90effb32ebe56a48c696d714e09065a243dbefe5ad7b07d973e4af3
MD5 6fad0157f7b3f9da3ec3c2198aa3094f
BLAKE2b-256 97da82ce42465c7dd7fb9392c6ad4d7c0a69fa0b1095f4105f42ad547e84f005

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6e6c74f905d6578d630138dd0089cb9391746ddd49ea6cbb8fbf030666551af9
MD5 8336f58ac4849e9793e88d6aaa01dc93
BLAKE2b-256 05299ef324b48004ce39329f77d35413b23b8b08df0c410d85a9738bf05fcb65

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp311-cp311-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7aad09428fd192f8fdf2f95229a455df76864abaf748410f6d4c4bf2773f32ca
MD5 4ad0a67b08039e8169e52129369d5d59
BLAKE2b-256 9fa8c5dd0ec112a1bf9ecdc992889ce00fda2b09a20d7cca74cb368d75407e24

See more details on using hashes here.

File details

Details for the file slixmpp-1.13.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.13.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c7d4a69d33c1c784153650369f3b9507cd42e21b982041b5cdde21c352b96879
MD5 c41f7dcbabffbcfaa8f8155fdf443536
BLAKE2b-256 e9eaf4e12547c7e6a7e3434189318cdb5483c7985234b1a2aac978e7978e557c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page