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.14.0.tar.gz (784.6 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.14.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.14.0-cp314-cp314-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

slixmpp-1.14.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.14.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.14.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.14.0-cp313-cp313-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

slixmpp-1.14.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.14.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.14.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.14.0-cp312-cp312-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

slixmpp-1.14.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.14.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.14.0-cp311-cp311-musllinux_1_2_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ ARM64

slixmpp-1.14.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.14.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.14.0.tar.gz.

File metadata

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

File hashes

Hashes for slixmpp-1.14.0.tar.gz
Algorithm Hash digest
SHA256 1ca225a40c56934e322baa5e205445e1fa3f2c44913892d67a2fe8f8686c1502
MD5 ebf47c73db477f9fcd47ba79be169039
BLAKE2b-256 8d9f3e4f1a3c803eac6fbb1f06b886f5dd0e63876cdcefee3c9efab5b21794a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8cefb340cfb13fdc5b7092ff234fe39b9a4d9221939e0edcfc57b3b3b96e794d
MD5 3a05acf036786d45b289e80de255aeb2
BLAKE2b-256 3ef187f07832b7c0912f54b963ebb7b81ec3aadcc7181241d6fcc5e7d3c84172

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 022ab26f5f0572fda1ba3c8a63b33a1d762fd51eaad24eab46230b1b5fc92073
MD5 991cce40ffbb3adebf0cae34e4c417d7
BLAKE2b-256 c679cde07171b1b1e71473b4c011dc3c8dbf8c88780e7f329e6b021239f9f6b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 952a2eb76cd9ee35605a6d59121bfc705de57b9956c62b20ebe753a259a78186
MD5 48ae1d82d9f4cc0a7a20ff760bde86bb
BLAKE2b-256 d0edcb1523918ab032ce153a7363d32e254d6700e3cdccb0b92c276614bc6f3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 14425dab2a52fc4ed9524d7b823eefcad45a80a3cc0b06863174bd6ff5f18fa8
MD5 1640081cf8d8b3573ff5f3a9df8b851b
BLAKE2b-256 9711ec3f0b6a7560e0435611c5f5c902ff8cb856f6e8049ca632e68bbe3059c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0d09840ddf214fb1335df5987fb886e692904ade8d33ff41165defb7ef4eb35e
MD5 8a4741037cc952d8ae5def245dbbace3
BLAKE2b-256 3291b41c884554b2e3ec1ec76982fa48b2ed6f1a5a87b7e7724070bed35c198a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 11ceb6dc95fdf8b5316c6138016157a6658f94ba88d3f314f38ef7598ce4dd83
MD5 7ffab3370f0a4bf947dcf39591fe34de
BLAKE2b-256 c5184f255b382df036a3107251e8de41396e93b0b048c643cdf1b2030d40f0e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 eee6b3ab1ccbdb81da99b5a52634436b4f5830fd5a4d6513cdc9e24d669f056f
MD5 6f621c624cbae381dc889ea6e5d56b50
BLAKE2b-256 dc47d3606a3afb971fccdce281d426ce992f02c566cba7f81fb600bd7cf6d5e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 e5a853a9caf1d144b7f2c4e4fd2df666ae1dcb69af679ae5ad21bfe073e48678
MD5 a6fafd7ee927134905dd7bdf17e0ba11
BLAKE2b-256 7f622f1fefc8f7dce964e2e7039cf4960dcb19e87c53019a59b1eab9fc08944d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8aa83c263465b9b3ae7bc140bb4afa96e9afb91116e7da96a2a2eeec9e4e9eba
MD5 8d7195ed3ec5a0a12e564d0886bcdf23
BLAKE2b-256 9a24cdd569fbf826694cfcfcbfb341f60053db5262013f0ff480455ac489d19d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7cb9855e118a7af7a89827a8f99e09edbbb8c3e858d0c67c0856d684de9b8069
MD5 65381433b63a227e62241bc0a5097954
BLAKE2b-256 c315df5ffc12b998e0fcfe261049612f2b9c366a525232d08332e6c9c6f7f3cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bcb5706fe009836a7b274834af0ee3c4176e654a86900aa2d90c7c1afa926200
MD5 703e6e8f478ed3324b9bd8039b96f834
BLAKE2b-256 6770cfe102e5f392a9fd14724792f40007e49f542b3453210bde996c7579946d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6175adfc974e09e5f21b155d9d7036a25eeec243fb1692590605c042dd2b3647
MD5 52829a92cee623b8515c85b71a652638
BLAKE2b-256 092212db837d2c30cdfdc5fa45249282d7fa560998af4cec83ee2f6132a10de3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 bbded8476e04c9bfe4ad229ffa9ee7379d67da66f3ad37595df3a1026594b9fe
MD5 19c28e79a842279c8767d46b5371fe45
BLAKE2b-256 5b91f60bb8f98e74407a0faba753e165bfbada1e7f46b9ed3b82b3a8bf4836c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4570a6cfca0549e6e0bb8774fae93d702eeaa2d2bf5a24aa69eeb9db40126c53
MD5 a98559d0e958e719dab04a7821c156d4
BLAKE2b-256 3fbe486d648cb956239e4b9d937b909d2a4a4fea298a15d2062cdff3a2d6dfcb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.14.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 48d8d7e86ca5d750db56e1b1e46ce0aef44c305e003d7673bca5a17d1b61caf5
MD5 7d06dae7d85bd37d20ee393eac461db1
BLAKE2b-256 7604ded86645a190552962c30b109baa593b8665c97c82f2317b5a1cfca2cc87

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