This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

An irc micro-framework that smells too much like a web framework.

Relay is a toy project, its goals were for me to try out framework design, learn more about the IRC protocol, and to be a replacement for the available irc python libraries: most of them did not please me.

Installation

I suggest you use a virtualenv

$ pip install relay-framework

Example

This is an example of a bot that sends whatever is send after ‘!echo ‘ in a PRIVMSG:

from relay import Relay, auto_join, auto_pong
from relay.constants import privmsg

bot = Relay("echobot")

@bot.handler(privmsg)
def echo(target, message, sender, *args, **kwargs):
    if not message.startswith("!echo "):
        return
    sender_nick = sender.split('@')[0].split('!')[0] # We just want the nick
    message = message[6:] # We just want whatever is after '!echo '
    if target == bot.client['nick']:
        result = "PRIVMSG {sender_nick} :{sender_nick}: {message}"
    else:
        result = "PRIVMSG {{target}} :{sender_nick}: {message}"
    yield result.format(sender_nick=sender_nick, message=message)

if __name__ == "__main__":
    bot.register(auto_pong)
    bot.register(auto_join(['#tests']))
    bot.config(from_env=True).run()

And to run it:

$ RELAY_HOST=irc.example.net RELAY_NICK=echobot python echobot.py

Changelog

0.1.0:Initial version, client accepts handlers, connects and matches data with those.

Todo

  • Write a decent IRC client implementation
  • Write tests for the Relay class
  • Write documentation
  • Subclass Relay to allow regexp routes
Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
relay-framework-0.2.0.tar.gz (5.3 kB) Copy SHA256 Checksum SHA256 Source Jun 13, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting