Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

-- restructuredtext --

pmxbot

pmxbot is an IRC bot written in python. Originally built for internal use, it’s been sanitized and set free upon the world. You can find out more details on the website, http://bitbucket.org/yougov/pmxbot, and especially the wiki https://bitbucket.org/yougov/pmxbot/wiki/Home

Commands

pmxbot listens to commands prefixed by a ‘!’ If it’s a command it knows it will reply, take an action, etc. It can search the web, quote you, track karma, make decisions, and do just about anything else you could want. It logs text in a sqlite3 database, and eventually we’ll write a web interface to it.

Contains

pmxbot will respond to things you say if it detects words and phrases it’s been told to recognize. For example, mention sql on rails.

Requirements

pmxbot requires python, of course. Probably 2.5+. It also requires a few python packages:

  • python-irclib

  • pyyaml

  • json (standard library for 2.6+) or simplejson

  • feedparser

  • httplib2

  • sqlite3

The web interface requires cherrypy and jinja2.

Optionally nosetests for the test suite.

Testing

We have a basic nose test suite that does some functional tests with an included TCL IRC daemon, and some basic unit tests as well. Just run them from the pmxbot root directory with “nosetests” and it should do it all for you. You’ll need TCL and nosetests to do it though.

Configuration

Configuration is based on very easy YAML files. Check out config.yaml in the source tree for an example.

Usage

Once you’ve setup a config file, you just need to call pmxbot config.yaml and it will join and connect. We recommend running pmxbot under djb’s daemontools to make it automatically restart if it crashes.

Custom Features

Setuptools Entry Points Plugin

To create a setuptools (or distribute or compatible packaging tool) entry point plugin, package your modules using the setuptools tradition and install it alongside pmxbot. Your package should define an entry point in the group pmxbot_handlers by including something similar to the following in the package’s setup.py:

entry_points = {
    'pmxbot_handlers': [
        'plugin_name = mylib.mymodule:initialize_func',
    ],
},

During startup (and after loading the traditional script-based plugins), pmxbot will load mylib.mymodule and call initialize_func from that module (with no parameters). plugin_name can be anything, but should be a name suitable to identify the plugin. It is not necessary that initialize_func do anything at all, but it must be present, and will be called during startup.

Within the script you’ll want to import the decorates you need to use with: from pmxbot.botbase import command, contains, execdelay, execat. You’ll then decorate each function with the appropriate line so pmxbot registers it.

A command (!g) gets the @command decorator:

@command("tinytear", aliases=('tt', 'tear', 'cry'), doc="I cry a tiny tear for you.")
def tinytear(client, event, channel, nick, rest):
      if rest:
              return "/me sheds a single tear for %s" % rest
      else:
              return "/me sits and cries as a single tear slowly trickles down its cheek"

A response (when someone says something) uses the @contains decorator:

@contains("sqlonrails")
def yay_sor(client, event, channel, nick, rest):
      karmaChange(botbase.logger.db, 'sql on rails', 1)
      return "Only 76,417 lines..."

For an example of how to implement a setuptools-based plugin, see the wolframalpha plugin.

Web Interface

pmxbot includes a web server for allowing users to view the logs, read the help, and check karma. You specify the host, port, base path, logo, title, etc with the same YAML config file. Just run like pmxbotweb config.yaml and it will start up. I suggest using a tool like supervisor, daemontools, cherryd or somesuch to keep it running.

Download files

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

Source Distribution

pmxbot-1005b1.zip (2.0 MB view details)

Uploaded Source

File details

Details for the file pmxbot-1005b1.zip.

File metadata

  • Download URL: pmxbot-1005b1.zip
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pmxbot-1005b1.zip
Algorithm Hash digest
SHA256 a5b19d6b9b2c89838c37f085838d8a0607fdcfc4d328e598e4ef1e6da9e93f0e
MD5 a8da2ca4fe8b0d4c4717ca294f41538b
BLAKE2b-256 658ea531dc495ffb8fe25de5d70f5f3723c32c4c1ace928eae020c4beb7f7c2a

See more details on using hashes here.

Release history Release notifications | RSS feed

1122.17.0

2 files

1122.16.0

2 files

1122.15.0

2 files

1122.14.2

2 files

1122.14.1

2 files

1122.14.0

2 files

1122.13.1

2 files

1122.13.0

2 files

1122.12.0

2 files

1122.11.0

2 files

1122.10.3

2 files

1122.10.2

2 files

1122.10.1

2 files

1122.10.0

2 files

1122.9.3

2 files

1122.9.2

2 files

1122.9.0

2 files

1122.8.0

2 files

1122.7.3

2 files

1122.7.2

2 files

1122.7.1

2 files

1122.7

2 files

1122.6

2 files

1122.5

2 files

1122.4

2 files

1122.3

2 files

1122.2

2 files

1122.1

2 files

1122.0

2 files

1121.1

2 files

1121.0

2 files

1120.0

2 files

1119.0.3

2 files

1119.0.2

2 files

1119.0.1

2 files

1119.0

2 files

1118.3.2

2 files

1118.3.1

2 files

1118.3.0

2 files

1118.2.1

2 files

1118.2.0

2 files

1118.1.0

2 files

1118.0.4

2 files

1118.0.3

2 files

1118.0.2

2 files

1118.0.1

2 files

1118.0

2 files

1117.4.3

2 files

1117.4.2

2 files

1117.4.1

2 files

1117.4

2 files

1117.3.9

2 files

1117.3.8

2 files

1117.3.7

2 files

1117.3.6

2 files

1117.3.5

2 files

1117.3.4

2 files

1117.3.2

2 files

1117.3.1

2 files

1117.3

2 files

1117.2.4

2 files

1117.2.3

2 files

1117.2.2

2 files

1117.2.1

2 files

1117.2

2 files

1117.0.2

2 files

1117.0.1

2 files

1117.0

2 files

1116.0

2 files

1115.5

2 files

1115.4.1

2 files

1115.4

2 files

1115.3.2

2 files

1115.3.1

2 files

1115.3

2 files

1115.2.1

2 files

1115.2

2 files

1115.1

1 file

1115.0

1 file

1114.0

1 file

1113.6

1 file

1113.5

1 file

1113.4

1 file

1113.3

1 file

1113.2

1 file

1113.1

1 file

1113.0

1 file

1112.2.2

1 file

1112.2.1

1 file

1112.2

1 file

1112.1

1 file

1112.0

1 file

1111.1

1 file

1111.0.2

1 file

1111.0.1

1 file

1111.0

1 file

1110.7.1

1 file

1110.7

1 file

1110.6

1 file

1110.5

1 file

1110.4.1

1 file

1110.4

1 file

1110.3.1

1 file

1110.3

1 file

1110.2

1 file

1110.1.1

1 file

1110.1

1 file

1110.0

1 file

1109.3

1 file

1109.2

1 file

1109.0

1 file

1108.4.1

1 file

1108.4

1 file

1108.3.1

1 file

1108.3

1 file

1108.2

1 file

1108.1

1 file

1108.0

1 file

1107.4

1 file

1107.2

1 file

1107.1

1 file

1107.0

1 file

1106.4.1

1 file

1106.4

1 file

1106.3

1 file

1106.2

1 file

1106.1.4

1 file

1106.1.3

1 file

1106.1.2

1 file

1106.1.1

1 file

1106.1

1 file

1106.0

1 file

1105.7

1 file

1105.6

1 file

1105.5

1 file

1105.4.2

1 file

1105.4.1

1 file

1105.4

1 file

1105.3.1

1 file

1105.3

1 file

1105.2.2

1 file

1105.2.1

1 file

1105.1.1

1 file

1105.0.1

1 file

1105.0

1 file

1104.4.3

1 file

1104.4.2

1 file

1104.4.1

1 file

1104.4

1 file

1104.3.1

1 file

1104.3

1 file

1104.2

1 file

1104.1

1 file

1104.0

1 file

1103.7

1 file

1103.6.5

1 file

1103.6.4

1 file

1103.6.3

1 file

1103.6.2

1 file

1103.6.1

1 file

1103.6

1 file

1103.5.1

1 file

1103.4.5

1 file

1103.4.4

1 file

1103.4.3

1 file

1103.4.2

1 file

1103.4.1

1 file

1103.4

1 file

1103.3.2

1 file

1103.3.1

1 file

1103.3

1 file

1103.2

1 file

1103.1.10

1 file

1103.1.9

1 file

1103.1.8

1 file

1103.1.7

1 file

1103.1.6

1 file

1103.1.5

1 file

1103.1.4

1 file

1103.1.3

1 file

1103.1.2

1 file

1103.1.1

1 file

1103.1

1 file

1103.0.4

1 file

1103.0.3

1 file

1103.0.2

1 file

1103.0

1 file

1102.0

1 file

1101.9.2

1 file

1101.9.1

1 file

1101.8.2

1 file

1101.8.1

1 file

1101.8

1 file

1101.7.4

1 file

1101.7.3

1 file

1101.7.1

1 file

1101.7

1 file

1101.6

1 file

1101.5

1 file

1101.4

1 file

1101.3

1 file

1101.2

1 file

1101.1.4

1 file

1101.1.2

1 file

1101.1.1

1 file

1101.1

1 file

1101.0.1

1 file

1101.0

1 file

1100.8.5

1 file

1100.8.1

1 file

1100.6

1 file

1100.5.8

1 file

1100.5.7

1 file

1100.5.6

1 file

1100.5.5

1 file

1100.5.4

1 file

1100.5.3

1 file

1100.5.2

1 file

1100.5.1

1 file

1100.5

1 file

1100.3

1 file

1100.2

1 file

1100.1

1 file

1100.0

1 file

1005

1 file

This release

1005b1 This release

1 file

1004.4

1 file

1004.3

1 file

1004.2

1 file

1004

1 file

1002

1 file

1001

1 file

1000

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page