operbot


Nameoperbot JSON
Version 200 PyPI version JSON
download
home_pagehttp://github.com/operbot/operbot
Summaryoperator bot
upload_time2023-05-22 21:28:06
maintainer
docs_urlNone
authorBart Thate
requires_python
licensePublic Domain
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            README
######


**NAME**


**OPERBOT** - operator bot


**SYNOPSIS**

::

 operbot [-c|-d|-h]
 operbot <cmd> [key=value] [key==value]


**DESCRIPTION**


**OPERBOT** is a bot, intended to be programmable, with a client program to
develop modules on and a systemd version with code included to run a 24/7
presence in a channel.

**OPERBOT** uses object programming, where the methods are seperated
out into functions that use the object as the first argument of that funcion.
This gives base class definitions a clean namespace to inherit from and to load
json data into the object's __dict__. A clean namespace prevents a json loaded
attribute to overwrite any methods.

**OPERBOT** provides object persistence, an event handler and some basic code to
load modules that can provide additional commands.

**OPERBOT** has some functionality, mostly feeding RSS feeds into a irc
channel. It can do some logging of txt and take note of things todo.


**MISSION**


OPERBOT is a contribution back to society, placed in the Public Domain.


**INSTALL**

::

 $ sudo python3 -m pip install operbot --upgrade --force-reinstall


**CONFIGURATION**


configuration is done by calling the ``cfg`` command of ``operbot``


**irc**


::

 $ operbot cfg server=<server> channel=<channel> nick=<nick>

 (*) default channel/server is #operbot on localhost


**sasl**

::

 $ operbot pwd <nickservnick> <nickservpass>
 $ operbot cfg password=<outputfrompwd>


**users**


as default the user's userhost is not checked when a user types a command in a
channel. To enable userhost checking disable users with the ``cfg``
command::

 $ operbot cfg users=True


To add a user to the bot use the met command::

 $ operbot met <userhost>


to delete a user use the dlt command with a substring of the userhost::


 $ operbot dlt <substring>


**rss**

::

 $ operbot rss <url>


**RUNNING**


this part shows how to run ``operbot``.


**cli**


without any arguments ``operbot`` doesn't respond, add arguments to have
``operbot`` execute a command::

 $ operbot
 $


the ``cmd`` command shows you a list of available commands::

 $ operbot cmd
 $ cfg,cmd,dlt,dpl,flt,ftc,met,,mre,nme,pwd,rem,rss,thr,upt


**console**


use the -c option to start the bot as a console::

 $ operbot -c
 OPERBOT started at Fri Jan 6 01:49:58 2023
 > cmd
 cmd,dlt,dpl,flt,ftc,krn,log,met,mre,nme,pwd,rem,rss,thr,upt
 >


running the bot in the background is done with the -d option::


 $ operbot -d


**24/7**

paste the following into /etc/systemd/system/operbot.service::


 [Unit]
 Description=operator bot
 After=multi-user.target

 [Service]
 Type=forking
 KillMode=mixed
 User=operbot
 Group=operbot
 DynamicUser=yes
 StateDirectory=operbot
 LogsDirectory=operbot
 CacheDirectory=operbot
 ExecStart=/usr/local/bin/operbotd
 CapabilityBoundingSet=CAP_NET_RAW

 [Install]
 WantedBy=multi-user.target

and run the following with systemctl::

 > sudo systemctl enable operbot --now


**COMMANDS**


here is a short description of the commands::


 cfg - show the irc configuration, also edits the config
 cmd - show all commands
 dlt - remove a user
 dne - flag todo as done
 dpl - set display items for a rss feed
 flt - show a list of bot registered to the bus
 fnd - allow you to display objects on the datastore, read-only json files on disk 
 ftc - run a rss feed fetching batch
 log - log some text
 met - add a users with there irc userhost
 mre - displays cached output, channel wise.
 nme - set name of a rss feed
 pwd - combine a nickserv name/password into a sasl password
 rem - remove a rss feed by matching is to its url
 rss - add a feed to fetch, fetcher runs every 5 minutes
 thr - show the running threads
 tdo - adds a todo item, no options returns list of todo's
 upt - show uptime


**SYSTEMD**


to run the bot after reboot, install the service file and start the service
by enabling it with ``--now``::


 $ sudo cp /usr/local/operbot/operbot.service /etc/systemd/system
 $ sudo systemctl enable operbot --now

 (*) default channel/server is #operbot on localhost


use ``operbotctl`` instead of the use ``operbot`` program::


 $ sudo operbotctl cfg server=<server> channel=<channel> nick=<nick>
 $ sudo operbotctl pwd <nickservnick> <nickservpass>
 $ sudo operbotctl cfg password=<outputfrompwd>
 $ sudo operbotctl cfg users=True
 $ sudo operbotctl met <userhost>
 $ sudo operbotctl rss <url>


**PROGRAMMING**


The ``operbot`` package provides an Object class, that mimics a dict while using
attribute access and provides a save/load to/from json files on disk.
Objects can be searched with database functions and uses read-only files
to improve persistence and a type in filename for reconstruction. Methods are
factored out into functions to have a clean namespace to read JSON data into.

basic usage is this::

 >>> from operbot.objects import Object
 >>> o = Object()
 >>> o.key = "value"
 >>> o.key
 'value'

Objects try to mimic a dictionary while trying to be an object with normal
attribute access as well. hidden methods are provided, the methods are
factored out into functions like get, items, keys, register, set, update
and values.

load/save from/to disk::

 >>> from operbot.persist import Object, read, write
 >>> o = Object()
 >>> o.key = "value"
 >>> p = write(o)
 >>> obj = Object()
 >>> read(obj, p)
 >>> obj.key
 'value'


**AUTHOR**


| Bart Thate - operbot100@gmail.com
|

**COPYRIGHT**


``operbot`` is placed in the Public Domain.



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/operbot/operbot",
    "name": "operbot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Bart Thate",
    "author_email": "thatebhj@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/15/ed/90a5f67706ef2c27143fb3a997e31410feaae1bdbb72315a909e3a52a3bc/operbot-200.tar.gz",
    "platform": null,
    "description": "README\n######\n\n\n**NAME**\n\n\n**OPERBOT** - operator bot\n\n\n**SYNOPSIS**\n\n::\n\n operbot [-c|-d|-h]\n operbot <cmd> [key=value] [key==value]\n\n\n**DESCRIPTION**\n\n\n**OPERBOT** is a bot, intended to be programmable, with a client program to\ndevelop modules on and a systemd version with code included to run a 24/7\npresence in a channel.\n\n**OPERBOT** uses object programming, where the methods are seperated\nout into functions that use the object as the first argument of that funcion.\nThis gives base class definitions a clean namespace to inherit from and to load\njson data into the object's __dict__. A clean namespace prevents a json loaded\nattribute to overwrite any methods.\n\n**OPERBOT** provides object persistence, an event handler and some basic code to\nload modules that can provide additional commands.\n\n**OPERBOT** has some functionality, mostly feeding RSS feeds into a irc\nchannel. It can do some logging of txt and take note of things todo.\n\n\n**MISSION**\n\n\nOPERBOT is a contribution back to society, placed in the Public Domain.\n\n\n**INSTALL**\n\n::\n\n $ sudo python3 -m pip install operbot --upgrade --force-reinstall\n\n\n**CONFIGURATION**\n\n\nconfiguration is done by calling the ``cfg`` command of ``operbot``\n\n\n**irc**\n\n\n::\n\n $ operbot cfg server=<server> channel=<channel> nick=<nick>\n\n (*) default channel/server is #operbot on localhost\n\n\n**sasl**\n\n::\n\n $ operbot pwd <nickservnick> <nickservpass>\n $ operbot cfg password=<outputfrompwd>\n\n\n**users**\n\n\nas default the user's userhost is not checked when a user types a command in a\nchannel. To enable userhost checking disable users with the ``cfg``\ncommand::\n\n $ operbot cfg users=True\n\n\nTo add a user to the bot use the met command::\n\n $ operbot met <userhost>\n\n\nto delete a user use the dlt command with a substring of the userhost::\n\n\n $ operbot dlt <substring>\n\n\n**rss**\n\n::\n\n $ operbot rss <url>\n\n\n**RUNNING**\n\n\nthis part shows how to run ``operbot``.\n\n\n**cli**\n\n\nwithout any arguments ``operbot`` doesn't respond, add arguments to have\n``operbot`` execute a command::\n\n $ operbot\n $\n\n\nthe ``cmd`` command shows you a list of available commands::\n\n $ operbot cmd\n $ cfg,cmd,dlt,dpl,flt,ftc,met,,mre,nme,pwd,rem,rss,thr,upt\n\n\n**console**\n\n\nuse the -c option to start the bot as a console::\n\n $ operbot -c\n OPERBOT started at Fri Jan 6 01:49:58 2023\n > cmd\n cmd,dlt,dpl,flt,ftc,krn,log,met,mre,nme,pwd,rem,rss,thr,upt\n >\n\n\nrunning the bot in the background is done with the -d option::\n\n\n $ operbot -d\n\n\n**24/7**\n\npaste the following into /etc/systemd/system/operbot.service::\n\n\n [Unit]\n Description=operator bot\n After=multi-user.target\n\n [Service]\n Type=forking\n KillMode=mixed\n User=operbot\n Group=operbot\n DynamicUser=yes\n StateDirectory=operbot\n LogsDirectory=operbot\n CacheDirectory=operbot\n ExecStart=/usr/local/bin/operbotd\n CapabilityBoundingSet=CAP_NET_RAW\n\n [Install]\n WantedBy=multi-user.target\n\nand run the following with systemctl::\n\n > sudo systemctl enable operbot --now\n\n\n**COMMANDS**\n\n\nhere is a short description of the commands::\n\n\n cfg - show the irc configuration, also edits the config\n cmd - show all commands\n dlt - remove a user\n dne - flag todo as done\n dpl - set display items for a rss feed\n flt - show a list of bot registered to the bus\n fnd - allow you to display objects on the datastore, read-only json files on disk \n ftc - run a rss feed fetching batch\n log - log some text\n met - add a users with there irc userhost\n mre - displays cached output, channel wise.\n nme - set name of a rss feed\n pwd - combine a nickserv name/password into a sasl password\n rem - remove a rss feed by matching is to its url\n rss - add a feed to fetch, fetcher runs every 5 minutes\n thr - show the running threads\n tdo - adds a todo item, no options returns list of todo's\n upt - show uptime\n\n\n**SYSTEMD**\n\n\nto run the bot after reboot, install the service file and start the service\nby enabling it with ``--now``::\n\n\n $ sudo cp /usr/local/operbot/operbot.service /etc/systemd/system\n $ sudo systemctl enable operbot --now\n\n (*) default channel/server is #operbot on localhost\n\n\nuse ``operbotctl`` instead of the use ``operbot`` program::\n\n\n $ sudo operbotctl cfg server=<server> channel=<channel> nick=<nick>\n $ sudo operbotctl pwd <nickservnick> <nickservpass>\n $ sudo operbotctl cfg password=<outputfrompwd>\n $ sudo operbotctl cfg users=True\n $ sudo operbotctl met <userhost>\n $ sudo operbotctl rss <url>\n\n\n**PROGRAMMING**\n\n\nThe ``operbot`` package provides an Object class, that mimics a dict while using\nattribute access and provides a save/load to/from json files on disk.\nObjects can be searched with database functions and uses read-only files\nto improve persistence and a type in filename for reconstruction. Methods are\nfactored out into functions to have a clean namespace to read JSON data into.\n\nbasic usage is this::\n\n >>> from operbot.objects import Object\n >>> o = Object()\n >>> o.key = \"value\"\n >>> o.key\n 'value'\n\nObjects try to mimic a dictionary while trying to be an object with normal\nattribute access as well. hidden methods are provided, the methods are\nfactored out into functions like get, items, keys, register, set, update\nand values.\n\nload/save from/to disk::\n\n >>> from operbot.persist import Object, read, write\n >>> o = Object()\n >>> o.key = \"value\"\n >>> p = write(o)\n >>> obj = Object()\n >>> read(obj, p)\n >>> obj.key\n 'value'\n\n\n**AUTHOR**\n\n\n| Bart Thate - operbot100@gmail.com\n|\n\n**COPYRIGHT**\n\n\n``operbot`` is placed in the Public Domain.\n\n\n",
    "bugtrack_url": null,
    "license": "Public Domain",
    "summary": "operator bot",
    "version": "200",
    "project_urls": {
        "Homepage": "http://github.com/operbot/operbot"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1925fb4f6a3f76e6dd11263125826131125360c621320764cbb44f97e167693b",
                "md5": "b5acd90e97c4cb65f9fe6d4ac18e7e65",
                "sha256": "ba0314de8deb9226e5af71c2f5821242a2e7a7ed9c62baed91d609f7a44599c9"
            },
            "downloads": -1,
            "filename": "operbot-200-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b5acd90e97c4cb65f9fe6d4ac18e7e65",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 31805,
            "upload_time": "2023-05-22T21:28:04",
            "upload_time_iso_8601": "2023-05-22T21:28:04.215310Z",
            "url": "https://files.pythonhosted.org/packages/19/25/fb4f6a3f76e6dd11263125826131125360c621320764cbb44f97e167693b/operbot-200-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "15ed90a5f67706ef2c27143fb3a997e31410feaae1bdbb72315a909e3a52a3bc",
                "md5": "5ad02313ccd7e5995bb426b0eb99b555",
                "sha256": "9b05110f5e43a5f0164ab6d1219c672210da57c2a5db3b33c66f1a373956c69b"
            },
            "downloads": -1,
            "filename": "operbot-200.tar.gz",
            "has_sig": false,
            "md5_digest": "5ad02313ccd7e5995bb426b0eb99b555",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26154,
            "upload_time": "2023-05-22T21:28:06",
            "upload_time_iso_8601": "2023-05-22T21:28:06.992961Z",
            "url": "https://files.pythonhosted.org/packages/15/ed/90a5f67706ef2c27143fb3a997e31410feaae1bdbb72315a909e3a52a3bc/operbot-200.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-22 21:28:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "operbot",
    "github_project": "operbot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "operbot"
}
        
Elapsed time: 0.15750s