Skip to main content

A framework for network services, talkers and MUDs

Project description

An event-based python framework designed for building TCP/IP services, such as echo servers, flash policy servers, chatrooms, talkers and MUDs. Batteries included.

https://travis-ci.org/radiac/mara.svg?branch=master https://coveralls.io/repos/radiac/mara/badge.svg?branch=master&service=github

Features

  • Event-based framework with support for timers

  • Supports raw sockets or telnet with negotiation

  • Supports seamless restarts while maintaining connections and state

  • Common extras included, such as:

    • command manager

    • storage system

    • natural language processing tools

    • accounts, login helpers and rooms

Version 0.6.2. Supports Python 2.7 and 3.2 to 3.5.

See the Documentation for details of how Mara works.

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 Service, events
service = Service()

@service.listen(events.Receive)
def receive(event):
    event.client.write(event.data)

if __name__ == '__main__':
    service.run()

Save it as echo.py and run it:

python echo.py
* Server listening on 127.0.0.1:9000

Override settings in code, or by passing arguments on the command line:

python echo.py --host=10.0.0.11 --port=8000
* Server listening on 10.0.0.11:8000

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mara-0.6.2.tar.gz (101.5 kB view hashes)

Uploaded Source

Built Distribution

mara-0.6.2-py2.py3-none-any.whl (17.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page