mara


Namemara JSON
Version 2.1.1 PyPI version JSON
download
home_pagehttps://radiac.net/projects/mara/
SummaryA framework for network services
upload_time2024-05-19 00:39:04
maintainerNone
docs_urlNone
authorRichard Terry
requires_python>=3.10
licenseBSD
keywords socket telnet http websocket
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======================================
Mara - Python network service framework
=======================================

An asynchronous event-based python framework designed for building TCP/IP services - run
multiple socket, telnet, HTTP and websocket servers from a single async process.

.. image:: https://img.shields.io/pypi/v/mara.svg
    :target: https://pypi.org/project/mara/
    :alt: PyPI

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

.. image:: https://github.com/radiac/mara/actions/workflows/ci.yml/badge.svg
    :target: https://github.com/radiac/mara/actions/workflows/ci.yml
    :alt: Tests

.. image:: https://codecov.io/gh/radiac/mara/branch/main/graph/badge.svg?token=BCNM45T6GI
    :target: https://codecov.io/gh/radiac/mara
    :alt: Test coverage


* Project site: https://radiac.net/projects/mara/
* Source code: https://github.com/radiac/mara


Features
========

* Asynchronous event-based framework
* Supports multiple servers - text, telnet, HTTP and websockets included

Requires Python 3.10 or later, see installation.

See the `Documentation <https://python-mara.readthedocs.io/en/latest/>`_
for details of how Mara works.

Note: The last release to support Python 2 and 3.9 was version 0.6.3.


Quickstart
==========

Install Mara with ``pip install mara``, then write your service using
`event handlers <https://python-mara.readthedocs.io/en/latest/events.html>`_.

A minimal Mara service looks something like this::

    from mara import App, events
    from mara.servers.socket import SocketServer

    app = App()
    app.add_server(SocketServer(host="127.0.0.1", port=9000))

    @app.on(events.Receive)
    async def echo(event: events.Receive):
        event.connection.write(event.data)

    app.run()


Save it as ``echo.py`` and run it::

    $ python echo.py
    Server listening: Socket 127.0.0.1:9000


More examples
=============

Take a look at the `examples <https://github.com/radiac/mara/tree/master/examples>`_ to
see how to start writing more complex services:

* Chat over a raw text TCP socket, or one with TLS encryption
* Chat over a telnet server
* Chat over a websocket server
* Two servers, one process: chat between a websocket and a telnet server


Read the `documentation <https://python-mara.readthedocs.io/en/latest/>`_ for details of
how Mara works.




            

Raw data

            {
    "_id": null,
    "home_page": "https://radiac.net/projects/mara/",
    "name": "mara",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "socket telnet http websocket",
    "author": "Richard Terry",
    "author_email": "code@radiac.net",
    "download_url": "https://files.pythonhosted.org/packages/77/08/77465d0dc8dfa718b1dcd5cdfbdfd701c649814f7dbd9b3450a7258b9f11/mara-2.1.1.tar.gz",
    "platform": null,
    "description": "=======================================\nMara - Python network service framework\n=======================================\n\nAn asynchronous event-based python framework designed for building TCP/IP services - run\nmultiple socket, telnet, HTTP and websocket servers from a single async process.\n\n.. image:: https://img.shields.io/pypi/v/mara.svg\n    :target: https://pypi.org/project/mara/\n    :alt: PyPI\n\n.. image:: https://readthedocs.org/projects/python-mara/badge/?version=latest\n    :target: https://python-mara.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://github.com/radiac/mara/actions/workflows/ci.yml/badge.svg\n    :target: https://github.com/radiac/mara/actions/workflows/ci.yml\n    :alt: Tests\n\n.. image:: https://codecov.io/gh/radiac/mara/branch/main/graph/badge.svg?token=BCNM45T6GI\n    :target: https://codecov.io/gh/radiac/mara\n    :alt: Test coverage\n\n\n* Project site: https://radiac.net/projects/mara/\n* Source code: https://github.com/radiac/mara\n\n\nFeatures\n========\n\n* Asynchronous event-based framework\n* Supports multiple servers - text, telnet, HTTP and websockets included\n\nRequires Python 3.10 or later, see installation.\n\nSee the `Documentation <https://python-mara.readthedocs.io/en/latest/>`_\nfor details of how Mara works.\n\nNote: The last release to support Python 2 and 3.9 was version 0.6.3.\n\n\nQuickstart\n==========\n\nInstall Mara with ``pip install mara``, then write your service using\n`event handlers <https://python-mara.readthedocs.io/en/latest/events.html>`_.\n\nA minimal Mara service looks something like this::\n\n    from mara import App, events\n    from mara.servers.socket import SocketServer\n\n    app = App()\n    app.add_server(SocketServer(host=\"127.0.0.1\", port=9000))\n\n    @app.on(events.Receive)\n    async def echo(event: events.Receive):\n        event.connection.write(event.data)\n\n    app.run()\n\n\nSave it as ``echo.py`` and run it::\n\n    $ python echo.py\n    Server listening: Socket 127.0.0.1:9000\n\n\nMore examples\n=============\n\nTake a look at the `examples <https://github.com/radiac/mara/tree/master/examples>`_ to\nsee how to start writing more complex services:\n\n* Chat over a raw text TCP socket, or one with TLS encryption\n* Chat over a telnet server\n* Chat over a websocket server\n* Two servers, one process: chat between a websocket and a telnet server\n\n\nRead the `documentation <https://python-mara.readthedocs.io/en/latest/>`_ for details of\nhow Mara works.\n\n\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A framework for network services",
    "version": "2.1.1",
    "project_urls": {
        "Documentation": "https://python-mara.readthedocs.io/",
        "Homepage": "https://radiac.net/projects/mara/",
        "Source": "https://github.com/radiac/mara",
        "Tracker": "https://github.com/radiac/mara/issues"
    },
    "split_keywords": [
        "socket",
        "telnet",
        "http",
        "websocket"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b0ed9739f9ef4bf70f1b8f28e331b6055e1ec3eba076e70fb398749e5b6d369",
                "md5": "120b7bcacedf2979fecadd1da3a9c14e",
                "sha256": "22172de5ac0adc8651d52471bd976df21bd85f66bc4a4156f1355e8904270d2d"
            },
            "downloads": -1,
            "filename": "mara-2.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "120b7bcacedf2979fecadd1da3a9c14e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 22362,
            "upload_time": "2024-05-19T00:39:02",
            "upload_time_iso_8601": "2024-05-19T00:39:02.467464Z",
            "url": "https://files.pythonhosted.org/packages/5b/0e/d9739f9ef4bf70f1b8f28e331b6055e1ec3eba076e70fb398749e5b6d369/mara-2.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "770877465d0dc8dfa718b1dcd5cdfbdfd701c649814f7dbd9b3450a7258b9f11",
                "md5": "1d1c981da0420473d04ea14518720d3f",
                "sha256": "f5e11827190d1de622719bc86d02dcbfd4a7f6b0e242719d9316944aa6037da4"
            },
            "downloads": -1,
            "filename": "mara-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1d1c981da0420473d04ea14518720d3f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 16770,
            "upload_time": "2024-05-19T00:39:04",
            "upload_time_iso_8601": "2024-05-19T00:39:04.215155Z",
            "url": "https://files.pythonhosted.org/packages/77/08/77465d0dc8dfa718b1dcd5cdfbdfd701c649814f7dbd9b3450a7258b9f11/mara-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-19 00:39:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "radiac",
    "github_project": "mara",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mara"
}
        
Elapsed time: 0.21793s