artie 0.1

IRC utility robot framework for Python
artie is an IRC robot that is dead simple to extend. Perfect for accessing Internet APIs or scraping webpages.


To install, the latest release pip install artie or easy_install artie.

For the bleeding edge, get the source from GitHub and python install.

Getting started

Make a new config file. The default name is settings.yaml. Follow the example config:

NICK: artie
PORT: 6667
 - '#goobtown'
APPLICATION_PATH: /home/sumeet/artiebot/applications # (Optional)

Start your bot with or < configuration_file >.

Quick example application

To make a new application, just make a .py file in the APPLICATION_PATH. If you don't set the application path, it'll be the applications directory in the same path as your settings file.

from artie.applications import trigger
from artie.helpers import work_then_callback
from time import sleep

# Matched groups from the regular expression below get passed into the
# decorated function.
@trigger(r'^.hello (.*)$')
def hello(irc, argument):
 Responds back to the same channel like so:

 < user > .hello artie
 < artie > Hi, user. You said artie.
 def _respond(text):
 irc.reply('Hi, %s. You said %s.' % (irc.message.nick, text))

 def _do_work(text):
 return text

 work_then_callback(_do_work, _respond, work_args=[argument,])

It's that easy. work_then_callback runs _do_work asynchronously and passes the return value to _respond. You'll want to use work_then_callback like this if you intend to use artie to access the Internet.

artie also makes it easy to do timed events:

from artie.applications import timer

def test(irc):
 Sends a message to every channel the bot is in every 10 seconds.
 for channel in irc.channels:
 irc.msg(channel, 'hi i am artie')

For more examples, check out the sample project.

Reloading applications

If you've made changes to applications or added new ones, send artie a SIGHUP to reload your applications directory.

last updated on:
July 6th, 2010, 17:30 GMT
developed by:
Sumeet Agarwal
license type:
MIT/X Consortium License 
ROOT \ Communications \ Chat


In a hurry? Add it to your Download Basket!

user rating



Add your review!