Skip to content

radiac/mara

Repository files navigation

Mara - Python network service framework

An asynchronous event-based python framework designed for building TCP/IP services, such as telnet, HTTP and websocket servers.

PyPI

Documentation Status

Tests

Test coverage

Features

  • Asynchronous event-based framework
  • Supports multiple servers

Requires Python 3.10 or later, see installation.

See the Documentation for details of how Mara works.

Note: Version 2.0.z is in development, and the API is subject to change without notice. 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.

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.listen(events.Receive)
async def echo(event: events.Receive):
    event.client.write(event.data)

app.run()

Save it as echo.py and run it:

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

Take a look at the examples to see how to start writing more complex services, or read the documentation for details of how Mara works.

About

A python framework for network services, talkers and MUDs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages