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.12.0-cp312-cp312-win_amd64.whl (825.7 kB view details)

Uploaded CPython 3.12Windows x86-64

slixmpp_multiplatform-1.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (991.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.12.0-cp312-cp312-macosx_11_0_arm64.whl (940.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

slixmpp_multiplatform-1.12.0-cp312-cp312-macosx_10_12_x86_64.whl (947.2 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

slixmpp_multiplatform-1.12.0-cp311-cp311-win_amd64.whl (825.8 kB view details)

Uploaded CPython 3.11Windows x86-64

slixmpp_multiplatform-1.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (991.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.12.0-cp311-cp311-macosx_11_0_arm64.whl (943.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

slixmpp_multiplatform-1.12.0-cp311-cp311-macosx_10_12_x86_64.whl (950.7 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

slixmpp_multiplatform-1.12.0-cp310-cp310-win_amd64.whl (825.9 kB view details)

Uploaded CPython 3.10Windows x86-64

slixmpp_multiplatform-1.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (991.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.12.0-cp310-cp310-macosx_11_0_arm64.whl (943.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

slixmpp_multiplatform-1.12.0-cp310-cp310-macosx_10_12_x86_64.whl (950.9 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

slixmpp_multiplatform-1.12.0-cp39-cp39-win_amd64.whl (827.2 kB view details)

Uploaded CPython 3.9Windows x86-64

slixmpp_multiplatform-1.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (992.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

slixmpp_multiplatform-1.12.0-cp39-cp39-macosx_11_0_arm64.whl (945.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

slixmpp_multiplatform-1.12.0-cp39-cp39-macosx_10_12_x86_64.whl (952.9 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7ce34db623f751a4addf55be0cca023447fbeb3725c2d64b3dc8729e4fd9c34d
MD5 6ee71b6cb94653a279a3e79c5f44e43f
BLAKE2b-256 306a06b9d533f2735490a8e2df1704a560dabc0f531e9ca3eaede33714532701

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 037991123a6c12d807e141398d0fb17757fa49aeb1ff6340b31814a6d6ad4eda
MD5 2f81058012c1b8e164ebf9ab8895b360
BLAKE2b-256 88877e91feafac9e1b4fd5efe8d8616b59091f227a9e24a751df1551c3d72833

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 190d42f05a98171025c341c8c6f999137c21eb32a8131b8024ad73d90624ada6
MD5 7367e38f758bc1fea16c231e53379f7f
BLAKE2b-256 82f43e50832bf01c262b837be9e0cd35714b113990f8671b728adc65d137759f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 06fc5ef61723c333eb0cbbd86016d014b10f4ea1cebc095a1941a5f076e9a8f7
MD5 34fa59e9786d083ea9d4de357fcb4146
BLAKE2b-256 c31281e918066a4e6e2afe3cc9f9512f6be6121325955f5d3355e2d7cbe70f61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8c81c758db55a02eb16a472d59f0d83b261d41f8e179e288b5a9face76382bfa
MD5 85d60bfe98827756b2c6fd3847eec412
BLAKE2b-256 66f30f82078809cc9aca672a0ab8d2c08d4eeebd0312ec7ae3f91dd20ad8e339

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee0fa5e1f0b128444e7070ebcb08d8ea04e0b5ab6eecbd311f6b3b33bd1a8802
MD5 fe0c3fee3289bd99b41436c7911417d0
BLAKE2b-256 9e866a38599802d74b5cd885448dcee1147605ce65711b32c4a90642b03e64b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c4046540015313c728930301f2afd33a01b495356900f0002f9fe1c62353e87
MD5 6417cd2184b44549e4a809868c815c90
BLAKE2b-256 f33482e1847c151bdc172358980109b4d34130032cecefe00b21ec1bf38e23fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4478d7189d96d4096cd927262bc3a2ac78b92884fbc5a4517d8430170176849e
MD5 48c726ca65cfa1afe58458f624c6a986
BLAKE2b-256 fee4c16f1f5242d96ac6a72cc2beb78513085be3b59498dfe914536d5e5f34a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1d81cb043bd23f9311a9fd6df02ee32f92ae2e9528ad88ecbfbdd022daa594f8
MD5 f39fa0de9175d13d06dbafed78487ddb
BLAKE2b-256 d32d36544c3c167e533fb3856b5ba1d298023db21b79a11b6093fc3ae7c1159f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4459c3ce2c6527d30528808e09027be68054f6c3a68c76f8034caf564ccaae35
MD5 f83a20d5d6e062663070f36d7d224bc4
BLAKE2b-256 42ee2bebee5a425a31fc5a2da0600bd2ce42735cefd0055c92fe22a07c6d4c28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 17107cc556d4e39088d71aee12f1231deb0bf0314ca15cdfbf523ba29b5deeea
MD5 eead3b767dde097a0f2ee044a85827af
BLAKE2b-256 4694406ab6ab38fcf53f93cb0ac4c538a297df38bcb538d62bdad811db2e9483

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 146cef6b9e809bd83f072a87865c3be53dccfadde70c3126266a1c7d05b25078
MD5 eccd1e340a44d3ef99c4309f0e8e6dec
BLAKE2b-256 9cebc14ecfaf55bb8003061f6669db726ca7b788435e1e1302191cce0d32c332

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b499a96c0d78a685eb1d29096631931d3af9960bebb961c76bcf8e37be5de12f
MD5 c1bbcb8faa5f56048043c83fd7c97230
BLAKE2b-256 d85f6db394523631bef7339242f6f0d0d84e8bce83cf35343174631f59a95eb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ced2e1eb6a4c6d59c650e767c54168529dcc05553fc5ba09206b500a988045cc
MD5 5966f53ab9ede1f5308e7e0aa435778d
BLAKE2b-256 53dc96ac0ff3f9683bc2d5db7108f56ce8768282e746bc9882d4304cc1fec211

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 509e75efb40e26bdcdf659bc8024bee9c3f7e6a6f46a0a966e493786a49a82d3
MD5 ca90d7d008329d34e14ad0fcedb34d8f
BLAKE2b-256 2e26ab5d01db8227635732854d8b108e66c0438bb314354f1ac50cd8c32ba275

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slixmpp_multiplatform-1.12.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0b994e5f63f11aac714488d64cd24d1108a19971b93cfe020dd776cb0aff8772
MD5 5036cdd24f35fe21bbb4d3136b30af2e
BLAKE2b-256 bc29a068119cb3674c8fd750f0f5784508bbbc87ae30e122cafd2cbb021c02ed

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