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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

slixmpp_multiplatform-1.10.0-cp312-cp312-win_amd64.whl (831.5 kB view details)

Uploaded CPython 3.12Windows x86-64

slixmpp_multiplatform-1.10.0-cp312-cp312-manylinux_2_34_x86_64.whl (989.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

slixmpp_multiplatform-1.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (990.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.10.0-cp312-cp312-macosx_11_0_arm64.whl (941.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

slixmpp_multiplatform-1.10.0-cp312-cp312-macosx_10_12_x86_64.whl (947.0 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

slixmpp_multiplatform-1.10.0-cp311-cp311-win_amd64.whl (831.7 kB view details)

Uploaded CPython 3.11Windows x86-64

slixmpp_multiplatform-1.10.0-cp311-cp311-manylinux_2_34_x86_64.whl (990.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

slixmpp_multiplatform-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (990.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.10.0-cp311-cp311-macosx_11_0_arm64.whl (945.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

slixmpp_multiplatform-1.10.0-cp311-cp311-macosx_10_12_x86_64.whl (951.8 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

slixmpp_multiplatform-1.10.0-cp310-cp310-win_amd64.whl (831.7 kB view details)

Uploaded CPython 3.10Windows x86-64

slixmpp_multiplatform-1.10.0-cp310-cp310-manylinux_2_34_x86_64.whl (990.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

slixmpp_multiplatform-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (990.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.10.0-cp310-cp310-macosx_11_0_arm64.whl (945.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

slixmpp_multiplatform-1.10.0-cp310-cp310-macosx_10_12_x86_64.whl (951.4 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

slixmpp_multiplatform-1.10.0-cp39-cp39-win_amd64.whl (831.8 kB view details)

Uploaded CPython 3.9Windows x86-64

slixmpp_multiplatform-1.10.0-cp39-cp39-manylinux_2_34_x86_64.whl (991.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

slixmpp_multiplatform-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (991.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.10.0-cp39-cp39-macosx_11_0_arm64.whl (945.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

slixmpp_multiplatform-1.10.0-cp39-cp39-macosx_10_12_x86_64.whl (951.7 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

File details

Details for the file slixmpp_multiplatform-1.10.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0a99662c5540eb041f8e9422fb7aace93b34264619ff42a832ad2b4debbc58cc
MD5 a63b74f61e4a23c83e1316c34b14d058
BLAKE2b-256 5d816f3f88696a2896ff7f9631af514e8283bf5d4b7fd7d3eddf88059d8d0469

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5244c4e48b483d9994260109410bdd1c688be6ebf43c971dd80f7d5c8e9a1fe9
MD5 9ec427245ee19091dda4b3510b764103
BLAKE2b-256 c249fb21c73e4b57b1b854d04b57e9077d4b5b57ae5e2489073e5c893876102e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b6015e64abd59c4e63f3abafcb53d482b94b7b2d9c2089232dc338a9f29b4f2
MD5 b691b990d083716ba8d9d2d677c9bd1f
BLAKE2b-256 c20d97df99d22fe9cf00bea84942df32046f48fa07d18a89352b50d056052c13

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0f2173efae6e0b4401cd3799a82e8eb4c7c96a5c8c8ae5ccefefc0f766bf7a31
MD5 880f842735a330835071005d1b211044
BLAKE2b-256 0e255e0692a729bdb224b8d086853ba35074b19dd83197383e72dd1631bac761

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 30641724f7d081d6f560d663750ba6926779b4df5d99ddd977578de88d4835e9
MD5 88aa92c12bfdc5ce3be93a904c4e6335
BLAKE2b-256 5f233c9c9769fc4ede398e16d69cc73b42d4b963482192f7e287f2640f3a25d3

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d9e64b177cee19231b85fd4874d2f4477ff2851b5216635ef185dc3a6889b7f4
MD5 0b01fc95cf0946e21239528a167eb448
BLAKE2b-256 f2144ab3843afffd033170d3926be8b2f06dec25f95dc7f3c088ebf4d07fe79d

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 193199a41d84bf34f7d9bc9a61e8f31f5f30e0cba124aada30f6cf239c8a4059
MD5 5a8e1964075a132af8e996de55b27fb3
BLAKE2b-256 4a77b38cdc2b16860ad4cc07ac6a48cb5b3bb033ee0ed7d542cc11e666eb1761

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 738af00bda318dee48406729ad313c7e3ecb7038c6fbd127802e637f824f9c1b
MD5 8815f6c161e5bc4c04f3e273af6ff465
BLAKE2b-256 905481cfd05c19420a9ba76ff0be7c3180f766bdfc7fb7225c309963cd47d7cb

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43012d751e928a7ddf75ed5358aa0854da7c8540ff890f20959f3a38649ad88e
MD5 fc06454ccd8eeb495e9358af8eed32a6
BLAKE2b-256 2d0709a23869c7cfa62e60df3f85992afca74732bdc63fe7e25cfa04c458a8a6

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ea2e28b73204619b0949ca0debeee2558351cfacf4c115673feafc6be88bb6e5
MD5 8aee7584289f5efee1286cafc393735e
BLAKE2b-256 db7f5635e172be427b949e1280c9679917fcbd96776e8347a55cde9bcbde24fd

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ebfe018d312afadb4347d22183a48314f0d259d8c23a75a750193a721172f1e
MD5 778cc8a45b27e6ae5edc813d86f7ac37
BLAKE2b-256 5b38524f9a701e6ba380508846e635dbd8fb9a2faa94738eee2a70a1735ed3ce

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 449ed3255cb64543061b81947aec92cb4e5a5601155f8cd024295941247f0b34
MD5 5380c786720cbfa3ad45ca4df940f421
BLAKE2b-256 bfaf73c4c5786dfd3cb19c7130513b3fd9bd21880be9e47869411fd6d38ac367

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a67a98a395a38881bda6322de064cbb98b012e3ade7b52b37da09e3af0ecd7d
MD5 d4df9baf5c0561a0fb4981a8fc410a6d
BLAKE2b-256 2329fd6e07adafe64b3df6f9f250563ce63761af9888886e157e3f08ad7e4fb6

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05a867c3a04b25e714d42032be3bae8d49a2b17f19d29b128a48b98b67a03f55
MD5 7ca092ea6c3bb8ebc68cc08ede0c45a1
BLAKE2b-256 8c6d5924d33820b3556a58a4e90d6dc0d634c943875ef4fd334b0202dd27cadd

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 96b6812acd678c967dea7f9659c5b670c1000486f53cb972f552d48959db989d
MD5 dda337cafa385e17589b269f8b2acee0
BLAKE2b-256 d45a4d1b3100148b8bb5e390a8ef7b5cfd619375bce766c3faff656864c3a95c

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a4341fc9351c81841018efef2df7abe4e174309773d802e50224afb3925fa24b
MD5 df3262eac7dd2d577af916d0701542c6
BLAKE2b-256 813f32df373e5ddd637c852b360d54ff0fc509a474231948b623c141567f7d9e

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6a6883d627ba2253626f62e3ae8263cd4e1cfe418a62f39c5faa95bf669c9e44
MD5 d332afea751f328392a3b81f2c48a82f
BLAKE2b-256 57a00de8775f91fbfb9701c841bb0b249672c95c868bd239947e025e87a1bcfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f74c39f83dc5f35658024858c48c367a02840c73c88100f03abfb62822387a37
MD5 1a525ecf7910761fac0705507de1dfb0
BLAKE2b-256 c7de11a52ebfdbf3923a8d520a09a083b7b2615af430af4bf58b7367f8224620

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ccf6dcc79713938143845ab0fcb17c9132179eaada9fa268b6f6c969bac95436
MD5 9550a1eebc4f129d3a361c496f221564
BLAKE2b-256 02a3390006d48bc7ee84575c85e82273d11b6e1a10cc0d71dc212db3b3512470

See more details on using hashes here.

File details

Details for the file slixmpp_multiplatform-1.10.0-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.10.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 47b8bc25cbe0712a62e50073587b36d3fe8a4a2ac8332af1a94787507c8fdafb
MD5 a42c8c212291624049f7c3e99d850249
BLAKE2b-256 d0c7ca2232a9a06fdd70bf74dd2f49c8b87c8e7889a21b03c464398e777b6017

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