A Python XMPP server
Project description
Free software: MIT license
Documentation: https://pyjabber.readthedocs.io.
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 |
|
---|---|---|
IMPLEMENTED |
Dataforms |
|
IMPLEMENTED |
Service Discovery |
|
IMPLEMENTED |
Pubsub |
|
IMPLEMENTED |
In Band Registration |
|
IMPLEMENTED |
Ping |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyjabber-0.2.5.tar.gz
.
File metadata
- Download URL: pyjabber-0.2.5.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab5fd8a02158769691a8e438bf849e2e01c094057b00808e0c710cc596d50d6d |
|
MD5 | 38e607f3167e1e5f7bd6b0ee55771dc2 |
|
BLAKE2b-256 | 3c9b8aaf25992ce01769f9330567bd8390240729a8aecffa58f723d97425a3ef |
File details
Details for the file pyjabber-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: pyjabber-0.2.5-py3-none-any.whl
- Upload date:
- Size: 969.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e74975bc71470980f825e513ca76f3f786b7c125b1af62ac2fec681b7b9216db |
|
MD5 | 28b3597917c796f5ab97500f85d3910d |
|
BLAKE2b-256 | 504694c7066be49790bd5f6b3c501aae09cde25b14c1ecf736a0298b9ddf32e7 |