A python lib to run ejabberd XML-RPC commands
Features
- Execute XML-RPC commands
- External authentication
- Register Users
- Delete Users
- Create Rooms
- Subscribe to Rooms
- Send Messages
- and many others features, ... .
When working with python its a common approach to use a virtualenv to encapsulate all dependencies. First create a virtual environment: if you have virtualenv installed run this code
virtualenv ejabberd_python3d_venv
if not, so install with this code:
pip install virtualenv
and then install ejabberd_python3d lib:
pip install ejabberd_python3d
To get the most updated version, you'll need to clone this repository:
git clone http://github.com/Dedaldino3D/ejabberd_python3d.git
Run
python setup.py
After installation is completed, create a client instance:
from ejabberd_python3d.client import EjabberdAPIClient
client = EjabberdAPIClient('localhost','dedaldino','123456')
users = client.registered_users('localhost')
# assuming that you have an user registered (the admin)
print(users) # [dedaldino]
client.register('dedaldino3d','localhost','nopassword')
users = client.registered_users('localhost')
print(users) # ['dedaldino3d']