Skip to main content

Python IRCP Library

Project description

Build Status Snippets Stats

Quick Start

import zirc, ssl

class Bot(zirc.Client):
    def __init__(self):
        self.connection = zirc.Socket(wrapper=ssl.wrap_socket)
        self.config = zirc.IRCConfig(host="irc.freenode.net",
            port=6697,
            nickname="zirctest",
            ident="bot",
            realname="test bot",
            channels=["##chat"],
            caps=zirc.Caps(zirc.Sasl(username="username", password="password")))

        self.connect(self.config)
        self.start()

    def on_privmsg(self, event, irc):
        irc.reply(event, "It works!")
        #Or alternatively:
        #irc.privmsg(event.target, "It works!")

Bot()

This library implements the IRC protocol, it’s an event-driven IRC Protocol framework.

Installation

PyPi

sudo pip install zirc
sudo pip3 install zirc

Github

sudo pip install git+https://github.com/itslukej/zirc.git
sudo pip3 install git+https://github.com/itslukej/zirc.git

Github will contain the latest bug fixes and improvements but sometimes also “bad quality” code.

Features

  • Automatic PING/PONG between the server

  • IRC Message parsing

  • A simple set up and connection method

  • Easy installation

  • Easy CTCP Set-up

IPv6

To use IPv6 with zirc.Socket, you can use the family socket.AF_INET6:

import socket

self.connection = zirc.Socket(family=socket.AF_INET6)

Proxy

Initialize zirc.Socket with argument socket_class:

self.connection = zirc.Socket(socket_class=zirc.Proxy(host="localhost", port=1080, protocol=zirc.SOCKS5))

Examples

You can find examples for zIRC by me and other users on CodeBottle

Ideas

  • Multiple connection support

TODO

  • More documentation

Contributing

Talk to us on #zirc at Freenode

Please discuss code changes that significantly affect client use of the library before merging to the master branch. Change the version in setup.py ahead if the change should be uploaded to PyPi.

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

zirc-1.2.10.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

zirc-1.2.10-py2.py3-none-any.whl (17.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file zirc-1.2.10.tar.gz.

File metadata

  • Download URL: zirc-1.2.10.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for zirc-1.2.10.tar.gz
Algorithm Hash digest
SHA256 6f93d0d74c3c487f7d6261cf6abde079d7b4db275f896731caf92fd99b1bbf7d
MD5 a982e1f9cd21aa1d92602b228a34eeac
BLAKE2b-256 bb8d5141b74378d9bc9eb1215a9b8b41cd4b5762fca310ad38c665af8aa96fff

See more details on using hashes here.

File details

Details for the file zirc-1.2.10-py2.py3-none-any.whl.

File metadata

  • Download URL: zirc-1.2.10-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for zirc-1.2.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b2c006a3db10457f588348059aca579ed6c4805d87890811bcc2f9d7a6e48eb2
MD5 a5c387b8f25b85980ff68dd54fde1656
BLAKE2b-256 3620c105f2880e103198e8932827ae5a70d07fd17a00e2242678fbe257fdc0ba

See more details on using hashes here.

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