Metadata-Version: 2.4
Name: pyjabber
Version: 0.4.2
Summary: A lightweight, modular and asyncio XMPP/Jabber server written in Python.
Author-email: Aaron Raya Lopez <aaron.raya.lopez@gmail.com>
Maintainer-email: Aaron Raya Lopez <aaron.raya.lopez@gmail.com>
License: MIT
Project-URL: Documentation, https://pyjabber.readthedocs.io/
Project-URL: Homepage, https://github.com/DinoThor/PyJabber
Project-URL: Bug Tracker, https://github.com/DinoThor/PyJabber/issues
Keywords: xmpp,jabber,server,asyncio,python,chat,messaging
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Internet :: XMPP
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: aiofiles>=25.1.0
Requires-Dist: aiohttp>=3.13.3
Requires-Dist: aiosqlite>=0.22.1
Requires-Dist: alembic>=1.16.5
Requires-Dist: bcrypt>=5.0.0
Requires-Dist: click>=8.1.8
Requires-Dist: cryptography>=46.0.4
Requires-Dist: loguru>=0.7.3
Requires-Dist: nanoid>=2.0.0
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: sqlalchemy>=2.0.46
Requires-Dist: uvloop>=0.21.0; sys_platform != "win32"
Requires-Dist: winloop>=0.5.0; sys_platform == "win32"
Provides-Extra: test
Requires-Dist: pytest>=8.3.2; extra == "test"
Requires-Dist: pytest-asyncio>=0.23.8; extra == "test"
Requires-Dist: pytest-cov>=5.0.0; extra == "test"
Requires-Dist: slixmpp>=1.8.6; extra == "test"
Provides-Extra: dev
Requires-Dist: black>=24.4.2; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: tox>=4.16.0; extra == "dev"
Requires-Dist: build>=1.2.1; extra == "dev"
Requires-Dist: twine>=5.1.1; extra == "dev"
Requires-Dist: wheel>=0.43.0; extra == "dev"
Requires-Dist: bump2version>=1.0.1; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.1.2; extra == "docs"
Requires-Dist: furo>=2024.8.6; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=2.0.1; extra == "docs"
Requires-Dist: sphinx-wagtail-theme>=6.3.0; extra == "docs"
Dynamic: license-file

===================================
PyJabber: The Python XMPP Server
===================================

.. image:: https://img.shields.io/pypi/v/pyjabber.svg
        :target: https://pypi.org/project/pyjabber/

.. image:: https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue
        :alt: Python 3.8 to 3.12

.. image:: https://img.shields.io/github/actions/workflow/status/dinothor/pyjabber/python-app.yml
        :target: https://github.com/DinoThor/PyJabber/actions
        :alt: Build Status

.. image:: https://coveralls.io/repos/github/DinoThor/PyJabber/badge.svg?branch=master
        :target: https://coveralls.io/github/DinoThor/PyJabber?branch=master
        :alt: Coverage Status

.. image:: https://tokei.rs/b1/github/dinothor/pyjabber
        :alt: Code lines counter

.. image:: https://readthedocs.org/projects/pyjabber/badge/?version=latest
        :target: https://pyjabber.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status

.. image:: https://img.shields.io/pypi/dm/pyjabber
        :target: https://www.pepy.tech/projects/pyjabber
        :alt: Monthly downloads

.. image:: https://img.shields.io/pepy/dt/pyjabber
        :target: https://www.pepy.tech/projects/pyjabber
        :alt: Total downloads



|
| **PyJabber** is an asyncio 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.
| While initially designed to fulfill the requirements of the multi-agent system `SPADE <https://github.com/javipalanca/spade>`_, it can be easily customized to suit any other purpose.
|

* Free software: MIT license
* Documentation: https://pyjabber.readthedocs.io.

------------
Installation
------------
.. code-block::

        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.

.. code-block:: python

    from pyjabber.server 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.

.. code-block:: python

    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 is the fastest way to start using the server.

.. code-block::


        $ pyjabber


.. code-block::

        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
--------

.. list-table::
   :widths: 25 25 50
   :header-rows: 1

   * -
     - 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
-------
.. list-table::
   :widths: 25 25 50
   :header-rows: 1

   * -
     - Status
     - Description
   * - `XEP-0004 <https://xmpp.org/extensions/xep-0004.html>`_
     - IMPLEMENTED
     - Dataforms
   * - `XEP-0030 <https://xmpp.org/extensions/xep-0030.html>`_
     - IMPLEMENTED
     - Service Discovery
   * - `XEP-0060 <https://xmpp.org/extensions/xep-0077.html>`_
     - IMPLEMENTED
     - Pubsub
   * - `XEP-0077 <https://xmpp.org/extensions/xep-0077.html>`_
     - IMPLEMENTED
     - In Band Registration
   * - `XEP-0199 <https://xmpp.org/extensions/xep-0199.html>`_
     - IMPLEMENTED
     - Ping
