Skip to main content
https://img.shields.io/pypi/pyversions/xmpppy.svg https://img.shields.io/pypi/v/xmpppy.svg https://img.shields.io/pypi/l/xmpppy.svg https://img.shields.io/pypi/dm/xmpppy.svg https://img.shields.io/pypi/status/xmpppy.svg https://github.com/xmpppy/xmpppy/actions/workflows/tests.yml/badge.svg https://img.shields.io/codecov/c/gh/xmpppy/xmpppy.svg

About:

Python 2/3 implementation of XMPP

Standards:

RFC3920, RFC3921

Documentation:

https://xmpppy.sourceforge.net/

Source Code:

https://github.com/xmpppy/xmpppy

Installation

Using pip, you can install the package with:

pip install --upgrade xmpppy

Usage

As a library

Regularly, the module is used as a library, like:

import xmpp

jabberid = "foobar@xmpp.domain.tld"
password = "secret"
receiver = "bazqux@xmpp.domain.tld"
message  = "hello world"

def main():
    jid = xmpp.protocol.JID(jabberid)
    connection = xmpp.Client(server=jid.getDomain(), debug=True)
    connection.connect()
    connection.auth(user=jid.getNode(), password=password, resource=jid.getResource())
    connection.send(xmpp.protocol.Message(to=receiver, body=message))

if __name__ == "__main__":
    main()

Command line interface

The package also installs a command line program called xmpp-message. Its synopsis is:

xmpp-message --debug \
    --jabberid foobar@xmpp.domain.tld --password secret \
    --receiver bazqux@xmpp.domain.tld --message 'hello world'

You can also put your credentials into an ~/.xsend file, like:

JID=foobar@xmpp.domain.tld
PASSWORD=secret

and then invoke xmpp-message omitting the --jabberid and --password options, like:

xmpp-message --receiver bazqux@xmpp.domain.tld --message 'hello world'

Documentation

The canonical documentation is hosted at https://xmpppy.github.io/ and http://xmpppy.sourceforge.net/.

For learning about how to use this module, please have a look at these spots within the code base.

  • The xmpp-message program, located at xmpp/cli.py, for sending a single XMPP message.

  • The other programs within the doc/examples directory.

  • The docstrings within the library itself.

Development

Sandbox

Acquire sources and bootstrap sandbox:

git clone https://github.com/xmpppy/xmpppy
cd xmpppy
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade --editable='.[test]'

Software tests

Running the software tests requires a local XMPP server and a specific user account.

TCP (ipv4):

localhost:5222

XMPP vhost:

localhost

JID:

testdrive@localhost

Password:

secret

The server needs to support the core XMPP specification, it does not need to federate with other servers, nor provide TLS upgrades or other remote accesses.

Run software tests:

pytest

Run particular test cases:

pytest --no-cov -k compile

Run software tests using Prosody XMPP through the accompanied Compose file:

docker compose --file=tests/compose.yml up
docker compose --file=tests/compose.yml exec prosody prosodyctl register testdrive localhost secret
pytest

Support

If you have any questions about xmpppy usage or you have found a bug or want to share some ideas - you are welcome to join us on the issue tracker or on the xmpppy-devel mailing list.

Other projects

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmpppy-0.7.4.tar.gz (90.8 kB view details)

Uploaded Source

Built Distribution

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

xmpppy-0.7.4-py3-none-any.whl (87.2 kB view details)

Uploaded Python 3

File details

Details for the file xmpppy-0.7.4.tar.gz.

File metadata

  • Download URL: xmpppy-0.7.4.tar.gz
  • Upload date:
  • Size: 90.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for xmpppy-0.7.4.tar.gz
Algorithm Hash digest
SHA256 f54df50a153c104d33456768936e9e8352e6c57cb3bed2cb93a2a0ee3fffd73c
MD5 f8e62faeb4c15962826857b728b32929
BLAKE2b-256 6ea6a53d1ca08c686dd9e1bc18cf0fa3cd67462d43c69087fa55270f6b6d802c

See more details on using hashes here.

File details

Details for the file xmpppy-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: xmpppy-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 87.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for xmpppy-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 69d6ea00a85aad0250f8cafc2e073b4d6320d19a7d00bd728f74fcf1f138b77a
MD5 38ccc13148adad56713e3c6d939949a4
BLAKE2b-256 e83421d3f3f4f6110c2efe8f31f6a9aede8af82f4cd2d59f0645e7976f008e78

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.4 This release

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

1 file

0.7.0

1 file

0.6.5

1 file

0.6.4

1 file

0.6.3

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

0.4.0

0.3.1

0.3

0.2-rc3

0.2-pre2

0.2-rc1

0.1rc4

Supported by

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