_images/haarmaken.jpg

MADS

MADS is a python3 framework to use if you want to program IRC or XMPP bots:

CLI, IRC and XMPP bots.
REST server to serve objects of a bot.
RSS fetcher are provided as well.
custom written eventhandler.
launch threads.
sync objects to disk and back.
still no unittests.

EXAMPLE

#!/usr/bin/env python3
#
#

""" Die medicijnen zijn gif en het toedienen ervan is stafbaar !! """

import sys
sys.path.insert(0, os.getcwd())

from mads.trace import get_exception
from mads.shell import reset

from mids import kernel

import logging

def main():
    kernel.boot("MADS", __version__, __txt__)
    kernel.wait()

if __name__ == "__main__":
    try:
        main()
    except (KeyboardInterrupt, SystemExit):
        pass
    except:
        logging.error(get_exception())
    kernel.shutdown()
    reset()
    os._exit(0)

MADS

mads Framework to program bots, JSON file backend, MIT license.
mads.aliases alias to commands.
mads.bots bot classes.
mads.cli bot classes.
mads.clock timer, repeater and other clock based classes.
mads.echo stdout echo bot.
mads.engine a engine is select.epoll event loop, easily interrup_table
mads.errors MADS Exceptions.
mads.event event handling classes.
mads.file file related functions.
mads.getters functions that can be used on objects.
mads.handler schedule events.
mads.irc IRC bot class.
mads.join string concat functions, join strings together.
mads.json functions used to dump json.
mads.kernel module loading.
mads.launcher a launcher launches threads (or Tasks in this case).
mads.log log module to set standard format of logging.
mads.misc misc. helper functions.
mads.name name related functions, strip objectect names to be easily representable.
mads.object JSON file backed objectect with dotted access.
mads.raw raw output using print.
mads.register Sequence of Object.
mads.resolve plugin containing resolver functions.
mads.rest rest interface.
mads.result bot to use in tests.
mads.rss rss module.
mads.runner threaded loop to run tasks on.
mads.selector functions used in code to select what objects to use.
mads.shell function concerning the command line options of the bot.
mads.signature signature related functions.
mads.storage JSON file storage.
mads.task adapted thread to add extra functionality to threads.
mads.templates default config objects containing default values for various services and plugins.
mads.test bot to use in tests.
mads.time plugin with time related functions.
mads.trace functions concering stack trace.
mads.udp relay txt through a udp port listener.
mads.url functions that fetch data from url
mads.users class to access user records.
mads.xmpp XMPP bot class.

MODS

mods Framework to program bots.
mods.edit plugin to change config values.
mods.entry commands to enter data.
mods.karma karma plugin.
mods.mbox read email from an mbox directory or file.
mods.output commands that output data.
mods.silent disable announce per bot.
mods.storage commands to manipulate objects in the backend storage.
mods.system system related commands.
mods.test plugin containing test commands and classes.
mods.timer timer command to schedule a text to be printed on a given time. stopwatch to measure elapsed time.
mods.users user related commands.

MIDS

mids local define variables.
mids.cli command line interface.
mids.irc code run at irc startup.
mids.rest start the REST server, providing access to stored objects through a httpd server.
mids.rss runtime code to intialize RSS.
mids.timer timer command to schedule a text to be printed on a given time. stopwatch to measure elapsed time.
mids.udp start the udp server, allowing for echoing through udp.
mids.xmpp XMPP bot startup script.

INSTALL

To run MADS you need a shell with python3 installed.
Set export PYTHONPATH=”.” if the directory cannot be found by the python interpreter.
Set export PYTHONIOENCODING=”utf-8” if your shell has problems with handling utf-8 strings.
For the XMPP server use a ~/.sleekpass file with the password in it

CONTACT

_images/bart.jpg
MADS is sourcecode released under a MIT compatible license.

botfather on #dunkbots irc.freenode.net