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.11+. 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.16.0.tar.gz (798.1 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.16.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.16.0-cp314-cp314-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

slixmpp-1.16.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.16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

slixmpp-1.16.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.16.0-cp313-cp313-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

slixmpp-1.16.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.16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

slixmpp-1.16.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.16.0-cp312-cp312-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

slixmpp-1.16.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.16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

slixmpp-1.16.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.16.0-cp311-cp311-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ ARM64

slixmpp-1.16.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

slixmpp-1.16.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

File details

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

File metadata

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

File hashes

Hashes for slixmpp-1.16.0.tar.gz
Algorithm Hash digest
SHA256 7d0f7c4066ebc9e7cd0bd0f3cfed768fef106f20568cbfe6a232cf5e8be61912
MD5 3daf931d81e86898d3735811c8ec4d6e
BLAKE2b-256 e08390f1e2ad22531fe804c20c9fde9d185b57724513156741f2c1cb15772886

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3b641687c14287b29c9fbd099ea2623a744d57cbf28cb734bb17eecd38686923
MD5 f3f49e60a39eb0c4dc5ad85d08aa31f1
BLAKE2b-256 25d90569e5f3097cceffbf30f328e3a156d0f8658fc3b6fa787654794257feac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0ac273d9b2e97facf62ea38d1754d9984579e97dddb33f771adab641d97922ec
MD5 b4a6d33edf2ad39b063b8dd69ae2fc5f
BLAKE2b-256 e19d79a8c234db6dcfbabd9380c834ce54d201468416fb8e61812630e5c027be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fb1b97981f210f0b11a97650d2bb3270ee39a1a3077d8f3fe0fffb3742aa71e1
MD5 a779cb6b84d89d5ee75b97e81945f4d0
BLAKE2b-256 2f9132c60d6f2ee2fb6c8a14e931d8784d645604795700e7dfa4a05825149e66

See more details on using hashes here.

File details

Details for the file slixmpp-1.16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 a4b1c1319f549adc2eea44cfe327b3d8d532f61a0dbbc86af2d5c3af0bcc55f1
MD5 11e6240db88a280d08e7d4ada212755d
BLAKE2b-256 2e5255347739b010626d98f584f22ff2b765d29ea109424dfd87b6fd1af4b7b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7120b739708aa623698749c45d0798ccbb0749a3c15bf485bf4f3027150f0111
MD5 91a08617533233ebe2070aab402fbdda
BLAKE2b-256 f696cc2d49d3458c855c8a5c818987d837f0ca3cdfc7f46bf0e8a70f140599bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e7b0873168da23ef0fa879e46d1d06116eb2d69d544c78fad41a690b586079fe
MD5 a3b73a4e8c4f53217f060b38381bcb81
BLAKE2b-256 405403f8e43cf9fe8060525ddb6a48fb359d398af6b678cda7eeb401e9e0b1de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 147ac3eee4a4ddfed5e5ec86a3ed977d1d6b3ddb3d69a3cc729bbd7da854469a
MD5 035cec9ef81b49badec18eb73a736786
BLAKE2b-256 c01225a07eb626b254b2f3a112f252014b8b33a44f61033b6e300e64ab66fc40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 d068f44f23a65a30527fc5cacb4e97e5bde5ec101601c201a23b4c020d84b039
MD5 63e362b0002dfd2d84a5c07ec3e68529
BLAKE2b-256 2e0c4c8c4716cc310fb74a1c96dcd5c0270814ee9969a02b349fdd4e28690ecb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 456764c02db6fdc42ba34ed1019115d6187de66c9f5b9546a7f104e366937629
MD5 ffef7cab206f083ff2fa74c42076de8f
BLAKE2b-256 998befc04da051a417bb345741158acda639f6ae503265a01106909a407a2be2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5f3ec366f502b1d4c3209c39cfc6bea2c540970e5d5b5a49e500a5fe284f2163
MD5 bd92ee867a294073c78dc0c9b47cdb87
BLAKE2b-256 bc2f341ca38fdaccf8a6a3bf4d5d49143c27e5ba2d86a49ff8c2729cd04fea03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c3c8dee2b25fdf827afcc179d492ec367ca037cbdaa602fc5eb62026fe51b846
MD5 7932bec68af699145d8975238bbf1ade
BLAKE2b-256 4c4e2e313bb900726e09f86703766863750c78afb6761d459ccbba700f967790

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 4d200ddd4f00a43e1b25d084d2c8833003da47be0b68ff0935b40415a70a08ac
MD5 a8b5a7274827de415c9a02fd9c526faf
BLAKE2b-256 336fd73a5ff60047965615403d00a89caa35547d523f7d0c2cbb8537a8ab2996

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d0d02804477d3c26849a9d258e20c38a7ea4e054c8ecc1248bde074be2c3d647
MD5 cf5ab5668ed9baa612548a2595c228e1
BLAKE2b-256 c1368e95f4f5420731c3235bf3a2f6c111f9905afc857760f4e2edc0119b8f10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 609235e64e9afd944ada525d731bd5bd07afa6fd8d98afa7ff250a061e72b05c
MD5 cbeafa3b9f8c2a63b2a104b067245ffd
BLAKE2b-256 af057b115814a5b92ca7130ca3aa3ccc7ab2d4cf72391ad1ec5a41de59f5e63c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0642e32262abaa4563ff323c3cfc75ddc2f6390a72ed979cc706628244a2c60f
MD5 e17b048d3cd7dbbe87f69d89fa377c4f
BLAKE2b-256 62a72b7145e1fd6123caf1680147fa29942151c67a544d848d281a00ddbbebaf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.16.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 24b9db8d479100a5495b881d3a6cacaae430d5e54bc7361759340b95aed6f7bf
MD5 ec2efb4e872bacc060bbfc247a546be9
BLAKE2b-256 0b3c2ac6941fac2864ebf40541ee5726f7270ef06fc20dda7864a525ca7732a2

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