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.
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 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.
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 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 for details of how Mara works.
Metadata
Release files for mara 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mara-2.1.1.tar.gz | 16.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mara-2.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.1 kB
Release files / mara-2.1.1.tar.gz
| Download URL | mara-2.1.1.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5e11827190d1de622719bc86d02dcbfd4a7f6b0e242719d9316944aa6037da4
|
|
BLAKE2b-256 checksum How to use checksums |
770877465d0dc8dfa718b1dcd5cdfbdfd701c649814f7dbd9b3450a7258b9f11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / mara-2.1.1-py3-none-any.whl
| Download URL | mara-2.1.1-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22172de5ac0adc8651d52471bd976df21bd85f66bc4a4156f1355e8904270d2d
|
|
BLAKE2b-256 checksum How to use checksums |
5b0ed9739f9ef4bf70f1b8f28e331b6055e1ec3eba076e70fb398749e5b6d369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|