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.10.0.tar.gz (705.7 kB view details)

Uploaded Source

Built Distributions

slixmpp-1.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (929.2 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

slixmpp-1.10.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (925.3 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ ARM64

slixmpp-1.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (929.7 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

slixmpp-1.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (925.6 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

slixmpp-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (929.7 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

slixmpp-1.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (925.5 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

slixmpp-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (929.7 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

slixmpp-1.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (925.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

slixmpp-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (929.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

slixmpp-1.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (926.1 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: slixmpp-1.10.0.tar.gz
  • Upload date:
  • Size: 705.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.6

File hashes

Hashes for slixmpp-1.10.0.tar.gz
Algorithm Hash digest
SHA256 46bc5d01507cb4285c8255ce5c717c0b5f68e54dfc1f1712883998d6d722578a
MD5 bc5eec295cd452ce2ee106104e3fe916
BLAKE2b-256 c6790ceacbcdc5f84248a36c98e11c126494c4c262902bba69eb9bd536771f76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2eb7fd7239df14636c01bb22034f78349d1a408080d4a1398862ef20ef6c9986
MD5 ae5befa8555b0c3595e234947fb289b6
BLAKE2b-256 79ed35fd9ca70c8e8545a7a06fd45571cc6ef41af5080506e57296b24ec00787

See more details on using hashes here.

File details

Details for the file slixmpp-1.10.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6187313f255fd36a2a23e2f9fcbef4afeb9dacbac11ab666557d189d0913158b
MD5 c1b0a00c9a5e0ed6790d7720297d0e08
BLAKE2b-256 73f41eda543f5520e98a63df2a56e2600e652ba437b5e6cd16b0c4b62ec52413

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38c8babf6771f8ac03380efa566e09469b4d967fb38934ea0649e1481ae5af23
MD5 372c8cae9c434ce3e4ffae26f2e39ae1
BLAKE2b-256 e6bbb4ed1601c1a51efb439e38767d1e71bdff6d234d5a9dcdfd57361c8f8d4d

See more details on using hashes here.

File details

Details for the file slixmpp-1.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2e11e308bb9bdb28f6753184d29c5cf03d7056e32bebebe6aff8d25532f15f8e
MD5 3a2a5a04f46b1b7d40fc1f272856c4c2
BLAKE2b-256 292493f36273dce1beaebfb19bcef11b9423e9164951c5a9e3fac7df72d7cecc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa9e5c4a48637588f5e9e9bd2cc6d28107a5262211968c46d159ec6f6b71c39e
MD5 0b79abb4f33f0a7bd193a16939f9683e
BLAKE2b-256 0631fe90303e8facd62eb9cc5c4656a2c4ad1fc6227075465d17a8f670c60821

See more details on using hashes here.

File details

Details for the file slixmpp-1.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 27a46a2dee7c4531f176b648e70c624b3c5e07401c7b19b3bb3dc5fb7a21bce2
MD5 a6f7ac089dcfca424513dc410953e788
BLAKE2b-256 f8a2f2d170330477b50a71ed8720c048a2de775ebd99f5afd072695e4db42279

See more details on using hashes here.

File details

Details for the file slixmpp-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea977af4d6a941cf5e3805a6819e7fac2726dc628fd2560355f636fab810e914
MD5 b3017355ad95228776a5df9a108cd62a
BLAKE2b-256 4887088ea8a7742948d41b550f17bedafd79d880c5ca17a08f2941e65869524a

See more details on using hashes here.

File details

Details for the file slixmpp-1.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a3022285380c72cc5c2460094192fac178dcb862bf43da126e2fcc82c5a465f7
MD5 5edf153660a7886f4b1ea48b7232733f
BLAKE2b-256 4655abfcb9691f9ee833f7bf5ca53e81598101dedcb43471f63062167c6157c4

See more details on using hashes here.

File details

Details for the file slixmpp-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3add52d43fca5e2da32ce0de8b8b1cc253014aad74756873def2ba1e32450a0d
MD5 083565a7fec3b61cbf7cc386c619a453
BLAKE2b-256 5731380c58b40e339d6f21c96e95520224c35daf20d991c6e5775570f5d5c42e

See more details on using hashes here.

File details

Details for the file slixmpp-1.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 055e20ed83590b2e3c118c7b50e7744e7aec87ab09cc94b97499986cd8a9dd44
MD5 898526756e54552a237bd3164a968871
BLAKE2b-256 ef596c1a87129e17a84f025b01647e49d7366c2a3c4fe92ca6f2bde60eafb4c4

See more details on using hashes here.

Supported by

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