https://github.com/alexgustafsson/irc-python
A dependency free, easy-to-use and highly extensible IRC connector for Python 3
https://github.com/alexgustafsson/irc-python
api bot conversational-bot irc library python python-3
Last synced: 10 months ago
JSON representation
A dependency free, easy-to-use and highly extensible IRC connector for Python 3
- Host: GitHub
- URL: https://github.com/alexgustafsson/irc-python
- Owner: AlexGustafsson
- License: unlicense
- Created: 2020-05-31T18:40:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T20:21:50.000Z (over 2 years ago)
- Last Synced: 2025-02-05T07:14:52.296Z (over 1 year ago)
- Topics: api, bot, conversational-bot, irc, library, python, python-3
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Python IRC Connector
### A dependency free, easy-to-use and highly extensible IRC connector for Python 3
***
### Setting up
##### Quickstart
First, simply copy the the `irc` directory into your project. You can then use the connector like so:
```Python
from irc import IRC
# Create an IRC instance
irc = IRC("irc.example.com", 6697, "test-user", "test-user")
# Connect to the server
irc.connect()
# Read the first message
print(next(irc.messages))
# Send a message
irc.send_message("#bot-test", "Hello, world!")
```
### Documentation
##### Features
* Easy to use
* Highly extensible
* Thread safe
* Supports TLS
* Zero dependencies
* Low-level socket API built for speed and efficiency
* Uses typing
* Handles message splitting etc. automatically
* Automatic reconnect
* Heavily analysed using several static analyzers
##### Examples
There are multiple examples available in the `examples` directory. To run one of them, simply execute the following command:
```shell
python3 -m examples.ping --server irc.example.com --user test --nick test
```
Some of the examples feature verbose logging to show what's happening. In production, this library is nowhere near as verbose. As this library is using the built-in logging library, logging can also be completely turned off or modified.
### Contributing
Any contribution is welcome. If you're not able to code it yourself, perhaps someone else is - so post an issue if there's anything on your mind.
###### Development
Clone the repository:
```shell
git clone https://github.com/AlexGustafsson/irc-python
```
Setup a virtual environment and dependencies:
```shell
make setup
```
Write code and commit it.
Follow the conventions enforced:
```shell
make static-analysis
```
Test the project:
```shell
make test
```
### Disclaimer
_Although the project is very capable, it is not built with production in mind. Therefore there might be complications when trying to use the connector for large-scale projects meant for the public. The bot was created to easily connect to IRC and as such it might not promote best practices nor be performant._