Skip to main content
Logo https://img.shields.io/pypi/v/pyjabber.svg Python 3.8 to 3.12 Build Status Coverage Status Code lines counter Documentation Status Monthly downloads Total downloads

PyJabber is a server for Jabber/XMPP entirely written in Python, with minimal reliance on external libraries.
It strives to provide a simple, lightweight, and comprehensible codebase, featuring a modular structure that facilitates extension through the implementation of necessary XEPs for specific use cases.
While initially designed to fulfill the requirements of the multi-agent system SPADE, it can be easily customized to suit any other purpose.

Installation

pip install pyjabber

Quick start

Python program

The process of starting the server returns a coroutine, leaving it to the user to set up the required environment. The simplest approach is to use the asyncio.run function.

from pyjabber import Server

my_server = Server()
asyncio.run(my_server.start())

This allows PyJabber to be treated as a regular task and integrated seamlessly into an asynchronous application.

import asyncio
from pyjabber.server import Server

async def counter():
  while True:
    await asyncio.sleep(1)
    print(f"Hello World")

async def launch():
  my_server = Server()
  await asyncio.gather(my_server.start(), counter())

asyncio.run(launch())

CLI

The CLI launcher provides access to all the configuration options available in the programmatic version (when launched from a Python script).

$ pyjabber --help
Usage: python -m pyjabber [OPTIONS]

 Options:
   --host TEXT                Host name  [default: localhost]
   --client_port INTEGER      Server-to-client port  [default: 5222]
   --server_port INTEGER      Server-to-server port  [default: 5269]
   --server_out_port INTEGER  Server-to-server port (Out coming connection)
                              [default: 5269]
   --family [ipv4|ipv6]       (ipv4 / ipv6)  [default: ipv4]
   --timeout INTEGER          Timeout for connection  [default: 60]
   --database_path TEXT       Path for database file  [default: */pyjabber.db]
   --database_purge           Restore database file to default state (empty)
   --database_in_memory       Database in memory. The data will be erased after
                              server shutdown
   --message_persistence      Keep the unsent messages in memory waiting for
                              the receiver client to connect
   -v, --verbose              Show verbose debug level: -v INFO -vv DEBUG, -vvv
                              level TRACE,
   --log_path TEXT            Path to log dumpfile
   -D, --debug                Enables debug mode in Asyncio
   --help                     Show this message and exit.

And to launch a default profile

$ pyjabber
2024-12-18 09:03:22.880 - INFO: Starting server...
2024-12-18 09:03:22.881 - INFO: Client domain => localhost
2024-12-18 09:03:22.881 - INFO: Server is listening clients on [('127.0.0.1', 5222), ('158.42.155.44', 5222)]
2024-12-18 09:03:22.881 - INFO: Serving admin webpage on http://localhost:9090
2024-12-18 09:03:22.881 - INFO: Server is listening servers on [('0.0.0.0', 5269)]
2024-12-18 09:03:22.881 - INFO: Server started...

Features

Status

Description

TLS

Implemented

v1.3. Localhost certificate included

SASL

Implemented

PLAIN, EXTERNAL (s2s)

Roster

Implemented

CRUD avaliable

Presence

Implemented (local bound)

Subscribe, Unsubscribed, Initial presence and Unavailable

Plugins

Status

Description

XEP-0004

IMPLEMENTED

Dataforms

XEP-0030

IMPLEMENTED

Service Discovery

XEP-0060

IMPLEMENTED

Pubsub

XEP-0077

IMPLEMENTED

In Band Registration

XEP-0199

IMPLEMENTED

Ping

Download files

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

Source Distribution

pyjabber-0.2.8.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

pyjabber-0.2.8-py3-none-any.whl (983.6 kB view details)

Uploaded Python 3

File details

Details for the file pyjabber-0.2.8.tar.gz.

File metadata

  • Download URL: pyjabber-0.2.8.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.0 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.67.1 importlib-metadata/4.12.0 keyring/24.3.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.12.3

File hashes

Hashes for pyjabber-0.2.8.tar.gz
Algorithm Hash digest
SHA256 38f1d499a84db587eaaea5191cbca19b84a147e860802f81e29e91c66bab10d8
MD5 440d34bef0735775483243a9338d7e97
BLAKE2b-256 7d54f0ea11f2508678e41405c194f97411a7155b6e3095505d1b988c7588f9ae

See more details on using hashes here.

File details

Details for the file pyjabber-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: pyjabber-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 983.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.0 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.67.1 importlib-metadata/4.12.0 keyring/24.3.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.12.3

File hashes

Hashes for pyjabber-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ee6fb5c7e323826d9bdcf86ea7c845d5357e9e6f7d5bd5192b3f4ef1cb1b045a
MD5 33be5d006e93de3dd39afbfafb142cb8
BLAKE2b-256 92920d173311c151a63c51e4ceff101e0157992603644c26863fda5a985a9efa

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