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

Uploaded Source

Built Distributions

slixmpp-1.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (991.5 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

slixmpp-1.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (988.2 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ ARM64

slixmpp-1.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (992.0 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

slixmpp-1.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (988.3 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

slixmpp-1.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (992.7 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

slixmpp-1.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (989.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

slixmpp-1.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (992.8 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

slixmpp-1.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (989.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

slixmpp-1.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (992.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

slixmpp-1.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (989.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

File details

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

File metadata

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

File hashes

Hashes for slixmpp-1.9.1.tar.gz
Algorithm Hash digest
SHA256 26d05a1700f7ea492a279c9f53707679d322bbe84c87ab97a87810302237916c
MD5 11f573c46b53e583d0f8f147ce6b8726
BLAKE2b-256 cac3bfeeab121935bcf5e982ab67f347cfd2d752cbeaa1c794583849c5a65c7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef204ca375020c6b205d0db216e9448ce10307a828b62703415713d3bba25fde
MD5 25262752a89fe0b6293ad3c52864dc88
BLAKE2b-256 9e858af9a942a5333e02cfc57cdc5c0426a5b0f76a74498c9449dd620def266b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e31d47aa7c189bfc6f0724621817c186434fe1e85b3d82bca8f514be38a2eab6
MD5 c3cad446efa51a5ba91bcea8cc4e6f27
BLAKE2b-256 aad5643c683995b80911d1ef3b669dfa39a03ed3af21e302a591191889548f75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f39b30a81573803353e6c2e050343b7d77be73b614c2171810ad15b199aa27c9
MD5 f72dbac874867233b3d9b9e8cd6f650b
BLAKE2b-256 8ac7583862edcf8171eaafeef534a89db1c81aed0736ff3c2784969bd0812765

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 511dbc9f4e8645035d5fae59fde0d3ebb46c2b180270ffce76a3e52941198ed0
MD5 223d3088711da76730d32a520da59033
BLAKE2b-256 7b30ae5825d6c6f399a86a32fefaeeea75e117546efb54cc3d242e0615ba8fab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d61c39d55a709991012fe53eefce4175032f6ca8912ed71740cfe54a60aeda36
MD5 527c5cf27818084ba88f631c772618e2
BLAKE2b-256 c3737f03ebb80d8392d42e811f1e0a37248a6aaa7fe08a3009d5d6e9173a9a2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 abf22d0daa7e7fef7423e9fff9fe8e58e91ac252408fa1b51b805efd672aa56c
MD5 48c357240a3fcc2958d84883297b29e2
BLAKE2b-256 88170df0f190fd83fc43001f53664f2d6f7b2944e67a3ad4cad074fbae9c401d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8bb4f55d519de2264b377e6500689869b08ac8dad173e063ceb7a6c733cdb7e4
MD5 79da68b91d4a5243c3ea57c1fbb5a79f
BLAKE2b-256 9a4c1379cf8710ffc077dca1f61c2858e5667391e287d48fb277daa882f02b14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 82c3030149a1a3f2c36dff49b90e0bbac35f75f1f6c4a5cbb3bbe5297bc21af6
MD5 e382eb618f6e8ac88772ae20b59c3431
BLAKE2b-256 b0cd6e4a545ed6608605586e00bbf128aa3e2eb23d8c45d6e4ad057741ab12cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2a9fc43ddc9ee1c44c4d63595623ce0fb0a722ed1a32c65b5d58a89188fbcce
MD5 b03a06f9adc9100f498433a65c1d196a
BLAKE2b-256 4197bb7d6543b7b92707a68656d8088a97473933ed591cd20e576e94b2f90dca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp-1.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4241651d7bc15ee6121a19062c09041fecd3108a8f0fb2651963af6b75f52aca
MD5 f36270a4cf08dfc8f0d595a9a4aa838a
BLAKE2b-256 238654cb46eeb7574ec655e76d6e33976f84b59c53db74f28a1bbf8900db195e

See more details on using hashes here.

Supported by

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