ejabberdctl.py provides Python client for Ejabberd XML-RPC Administration API.
pip install ejabberdctl.py
git clone https://gitlab.com/markuz/ejabberdctl.py.git ejabberdctlpy cd ejabberdctlpy python setup.py install
Simple example which displays Ejabberd status (assuming that XML-RPC runs on 127.0.0.1 and port 4560):
from ejabberdctl import ejabberdctl host = 'example.com' username = 'admin' password = 'admin' ejabberdctl = ejabberdctl(host, username, password) print ejabberdctl.status()
The same example with custom setting of XML-RPC server:
from ejabberdctl import ejabberdctl host = 'example.com' username = 'admin' password = 'admin' ejabberdctl = ejabberdctl(host, username, password, protocol='https', server=host, port=4560, admin=True, verbose=True) print ejabberdctl.status()
host is the domain served by Ejabberd (ie. one of your hosts defined in ejabberd.yml).
server is the server IP where Ejabberd runs the XML-RPC module. Typically it is configured to run on 127.0.0.1 (localhost) on port 4560.
python ejabberdctl/tests.py
Number of Ejabberd XML-RPC Administration API commands in ejabberdctl.py
:
egrep "def " ejabberdctl.py|grep -v "def __init__\|def ctl"|wc -l 126
Number of implemented commands:
egrep "def " ejabberdctl.py|grep -v "def __init__\|def ctl\|TODO"|wc -l 72
Number of commands to implement:
egrep "def " ejabberdctl.py|grep -v "def __init__\|def ctl"|grep TODO|wc -l 54
Number of tests in the testing suite:
egrep "def " tests.py|grep -v "def __init__\|def run_all\|TODO"|wc -l 31
Number of tests to implement:
egrep "def " tests.py|grep -v "def __init__\|def run_all"|grep TODO|wc -l 95
If you wish to help out with the project, please see todo.txt for a list of tasks that need doing.