pyjabber


Namepyjabber JSON
Version 0.1.9.post1 PyPI version JSON
download
home_pagehttps://github.com/DinoThor/PyJabber
SummaryA Python XMPP server
upload_time2024-12-18 08:46:18
maintainerNone
docs_urlNone
authorAarón Raya Lopez, Manel Soler Sanz
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements aiohttp click cryptography loguru pyyaml uvloop
Travis-CI No Travis.
coveralls test coverage
            ========
PyJabber
========

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

.. image:: https://img.shields.io/badge/python-3.8%20to%203.12-orange?logo=python&logoColor=green
        :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://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 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 <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 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 provides access to all the configuration options available in the programmatic version (when launched from a Python script).


.. code-block:: python


        $ pyjabber --help


.. code-block::


        Usage: 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]
          --tls1_3                   Enables TLSv1_3
          --timeout INTEGER          Timeout for connection  [default: 60]
          --database_path TEXT       Path for database file  [default:
                                     */venv/lib/python3.*/site-packages/pyjabber/db/server.db]
          --database_purge           Restore database file to default state (empty)
          -v, --verbose              Show verbose debug level: -v level 1, -vv level
                                     2, -vvv level 3, -vvvv level 4
          --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

.. 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.2 + 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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DinoThor/PyJabber",
    "name": "pyjabber",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Aar\u00f3n Raya Lopez, Manel Soler Sanz",
    "author_email": "aaron.raya.lopez@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a2/b8/eac93bdb17c5a959306dd7dbeeb7378945504c293bb54572840569564577/pyjabber-0.1.9.post1.tar.gz",
    "platform": null,
    "description": "========\nPyJabber\n========\n\n.. image:: https://img.shields.io/pypi/v/pyjabber.svg\n        :target: https://pypi.org/project/pyjabber/\n\n.. image:: https://img.shields.io/badge/python-3.8%20to%203.12-orange?logo=python&logoColor=green\n        :alt: Python 3.8 to 3.12\n\n.. image:: https://img.shields.io/github/actions/workflow/status/dinothor/pyjabber/python-app.yml\n        :target: https://github.com/DinoThor/PyJabber/actions\n        :alt: Build Status\n\n.. image:: https://coveralls.io/repos/github/DinoThor/PyJabber/badge.svg?branch=master\n        :target: https://coveralls.io/github/DinoThor/PyJabber?branch=master\n        :alt: Coverage Status\n\n.. image:: https://readthedocs.org/projects/pyjabber/badge/?version=latest\n        :target: https://pyjabber.readthedocs.io/en/latest/?version=latest\n        :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/dm/pyjabber\n        :target: https://www.pepy.tech/projects/pyjabber\n        :alt: Monthly downloads\n\n.. image:: https://img.shields.io/pepy/dt/pyjabber\n        :target: https://www.pepy.tech/projects/pyjabber\n        :alt: Total downloads\n\n\n\n|\n| PyJabber is a server for Jabber/XMPP entirely written in Python, with minimal reliance on external libraries.\n| It strives to provide a simple, lightweight, and comprehensible codebase, featuring a modular structure that\n        facilitates extension through the implementation of necessary XEPs for specific use cases.\n| 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.\n|\n\n* Free software: MIT license\n* Documentation: https://pyjabber.readthedocs.io.\n\n------------\nInstallation\n------------\n.. code-block::\n\n        pip install pyjabber\n\n-----------\nQuick start\n-----------\n\nPython program\n--------------\n\n\nThe 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.\n\n.. code-block:: python\n\n        from pyjabber import Server\n\n        my_server = Server()\n        asyncio.run(my_server.start())\n\n\n\nThis allows PyJabber to be treated as a regular task and integrated seamlessly into an asynchronous application.\n\n.. code-block:: python\n\n\n        import asyncio\n        from pyjabber.server import Server\n\n        async def counter():\n          while True:\n            await asyncio.sleep(1)\n            print(f\"Hello World\")\n\n        async def launch():\n          my_server = Server()\n          await asyncio.gather(my_server.start(), counter())\n\n        asyncio.run(launch())\n\nCLI\n---\nThe CLI launcher provides access to all the configuration options available in the programmatic version (when launched from a Python script).\n\n\n.. code-block:: python\n\n\n        $ pyjabber --help\n\n\n.. code-block::\n\n\n        Usage: pyjabber [OPTIONS]\n\n        Options:\n          --host TEXT                Host name  [default: localhost]\n          --client_port INTEGER      Server-to-client port  [default: 5222]\n          --server_port INTEGER      Server-to-server port  [default: 5269]\n          --server_out_port INTEGER  Server-to-server port (Out coming connection)\n                                     [default: 5269]\n          --family [ipv4|ipv6]       (ipv4 / ipv6)  [default: ipv4]\n          --tls1_3                   Enables TLSv1_3\n          --timeout INTEGER          Timeout for connection  [default: 60]\n          --database_path TEXT       Path for database file  [default:\n                                     */venv/lib/python3.*/site-packages/pyjabber/db/server.db]\n          --database_purge           Restore database file to default state (empty)\n          -v, --verbose              Show verbose debug level: -v level 1, -vv level\n                                     2, -vvv level 3, -vvvv level 4\n          --log_path TEXT            Path to log dumpfile\n          -D, --debug                Enables debug mode in Asyncio\n          --help                     Show this message and exit.\n\nAnd to launch a default profile\n\n.. code-block::\n\n\n        $ pyjabber\n\n\n.. code-block::\n\n        2024-12-18 09:03:22.880 - INFO: Starting server...\n        2024-12-18 09:03:22.881 - INFO: Client domain => localhost\n        2024-12-18 09:03:22.881 - INFO: Server is listening clients on [('127.0.0.1', 5222), ('158.42.155.44', 5222)]\n        2024-12-18 09:03:22.881 - INFO: Serving admin webpage on http://localhost:9090\n        2024-12-18 09:03:22.881 - INFO: Server is listening servers on [('0.0.0.0', 5269)]\n        2024-12-18 09:03:22.881 - INFO: Server started...\n\nFeatures\n--------\n\n.. list-table::\n   :widths: 25 25 50\n   :header-rows: 1\n\n   * -\n     - Status\n     - Description\n   * - TLS\n     - Implemented\n     - v1.2 + v1.3. Localhost certificate included\n   * - SASL\n     - Implemented\n     - PLAIN, EXTERNAL (s2s)\n   * - Roster\n     - Implemented\n     - CRUD avaliable\n   * - Presence\n     - Implemented (local bound)\n     - Subscribe, Unsubscribed, Initial presence and Unavailable\n\nPlugins\n-------\n.. list-table::\n   :widths: 25 25 50\n   :header-rows: 1\n\n   * -\n     - Status\n     - Description\n   * - `XEP-0004 <https://xmpp.org/extensions/xep-0004.html>`_\n     - IMPLEMENTED\n     - Dataforms\n   * - `XEP-0030 <https://xmpp.org/extensions/xep-0030.html>`_\n     - IMPLEMENTED\n     - Service Discovery\n   * - `XEP-0060 <https://xmpp.org/extensions/xep-0077.html>`_\n     - IMPLEMENTED\n     - Pubsub\n   * - `XEP-0077 <https://xmpp.org/extensions/xep-0077.html>`_\n     - IMPLEMENTED\n     - In Band Registration\n   * - `XEP-0199 <https://xmpp.org/extensions/xep-0199.html>`_\n     - IMPLEMENTED\n     - Ping\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python XMPP server",
    "version": "0.1.9.post1",
    "project_urls": {
        "Homepage": "https://github.com/DinoThor/PyJabber"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "285b30edbdc1b7e01aa6367ee5e22f189aab090aab6650eb0286876f6456fd63",
                "md5": "a5153d1f9dfcf2319b1707ab4ab25c0e",
                "sha256": "d5c8c4c960b39d9bd10b13f509a7bb878d95ee9b53b10cc891543f9aa0b7b207"
            },
            "downloads": -1,
            "filename": "pyjabber-0.1.9.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a5153d1f9dfcf2319b1707ab4ab25c0e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 966006,
            "upload_time": "2024-12-18T08:46:13",
            "upload_time_iso_8601": "2024-12-18T08:46:13.048055Z",
            "url": "https://files.pythonhosted.org/packages/28/5b/30edbdc1b7e01aa6367ee5e22f189aab090aab6650eb0286876f6456fd63/pyjabber-0.1.9.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a2b8eac93bdb17c5a959306dd7dbeeb7378945504c293bb54572840569564577",
                "md5": "38950520fe339e4f4a4534420db86339",
                "sha256": "cd25599aa0ef0c96f42e64beda5f68c0175c81f2c28ba65dd084fa4158215b87"
            },
            "downloads": -1,
            "filename": "pyjabber-0.1.9.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "38950520fe339e4f4a4534420db86339",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1211774,
            "upload_time": "2024-12-18T08:46:18",
            "upload_time_iso_8601": "2024-12-18T08:46:18.488075Z",
            "url": "https://files.pythonhosted.org/packages/a2/b8/eac93bdb17c5a959306dd7dbeeb7378945504c293bb54572840569564577/pyjabber-0.1.9.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-18 08:46:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DinoThor",
    "github_project": "PyJabber",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": [
                [
                    "==",
                    "3.10.4"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.7"
                ]
            ]
        },
        {
            "name": "cryptography",
            "specs": [
                [
                    "==",
                    "43.0.1"
                ]
            ]
        },
        {
            "name": "loguru",
            "specs": [
                [
                    "==",
                    "0.7.2"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "~=",
                    "6.0.2"
                ]
            ]
        },
        {
            "name": "uvloop",
            "specs": [
                [
                    "==",
                    "0.21.0"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "pyjabber"
}
        
Elapsed time: 0.39473s