README
######
**NAME**
``OPB`` - object programming bot.
**SYNOPSIS**
::
opb [<cmd>|-c|-d] [key=value] [key==value]
**DESCRIPTION**
``opb`` is a IRC bot, intended to be programmable, with a client program (opb),
command line interface (opbc) and a daemon version (opbd), it provides object
persistence, an event handler and some basic code to load modules that can
provide additional functionality.
``opb`` uses object programming, object oriented programming without the
oriented. Object programming is 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.
``opb`` stores it's data on disk where objects are time versioned and the
last version saved on disk is served to the user layer. Files are JSON dumps
and paths carry the type in the path name what makes reconstruction from
filename easier then reading type from the object.
``opb`` has some functionality, mostly feeding RSS feeds into a irc
channel. It can do some logging of txt and take note of things todo.
**INSTALL**
::
$ sudo pip3 install opb --upgrade --force-reinstall
(*) use remove and reinstall if ``opb`` doesn't work properly
**CONFIGURATION**
configuration is done by calling the ``cfg`` command:
IRC
::
$ opb cfg server=<server> channel=<channel> nick=<nick>
(*) default channel/server is #opb on localhost
SASL
::
$ opb pwd <nickservnick> <nickservpass>
$ opb 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 enable users with the ``cfg`` command::
$ opb cfg users=True
To add a user to the bot use the met command::
$ opb met <userhost>
to delete a user use the del command with a substring of the userhost::
$ opb del <substring>
RSS
::
$ opb rss <url>
**RUNNING**
this part shows how to run ``opb``.
**cli**
without any arguments ``opb`` doesn't respond, add arguments to have
``opb`` execute a command::
$ opb
$
the ``cmd`` command shows you a list of available commands::
$ opb cmd
cfg,cmd,dlt,dpl,flt,fnd,ftc,met,mre,nme,pwd,rem,rss,thr,upt
**console**
use the ``-c`` option to start the bot as a console::
$ opb -c
OPB started at Fri Jan 6 01:49:58 2023
> cmd
cfg,cmd,dlt,dpl,flt,ftc,krn,log,met,mre,nme,pwd,rem,rss,thr,upt
>
running the bot in the background is done by using the ``-d`` option::
$ opb -d
$
**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
**24/7**
::
sudo cp /usr/local/opb/opb.service
/etc/systemd/system``
sudo systemctl enable opb --now
(*) default is #opb on localhost
use ``opbctl <cmd>`` as you would have use ``opb <cmd>``.
**PROGRAMMING**
The ``opb`` 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 opb.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.
great for giving objects peristence by having their state stored in files::
>>> from opb.persist import Object, write
>>> o = Object()
>>> write(o)
opb.objects.Object/89efa5fd7ad9497b96fdcb5f01477320/2022-11-21/17:20:12.221192
**AUTHOR**
Bart Thate - operbot100@gmail.com
**COPYRIGHT**
``opb`` is placed in the Public Domain.
Raw data
{
"_id": null,
"home_page": "http://github.com/operbot/opb",
"name": "opb",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Bart Thate",
"author_email": "operbot100@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/02/a8/e537c18d648a0d10479530eeb472ac892ec50385ccd00eb77478f3bb6d08/opb-33.tar.gz",
"platform": null,
"description": "README\n######\n\n\n**NAME**\n\n\n``OPB`` - object programming bot.\n\n\n**SYNOPSIS**\n\n::\n\n opb [<cmd>|-c|-d] [key=value] [key==value]\n\n\n**DESCRIPTION**\n\n\n``opb`` is a IRC bot, intended to be programmable, with a client program (opb),\ncommand line interface (opbc) and a daemon version (opbd), it provides object\npersistence, an event handler and some basic code to load modules that can\nprovide additional functionality.\n\n``opb`` uses object programming, object oriented programming without the\noriented. Object programming is 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``opb`` stores it's data on disk where objects are time versioned and the\nlast version saved on disk is served to the user layer. Files are JSON dumps\nand paths carry the type in the path name what makes reconstruction from\nfilename easier then reading type from the object.\n\n``opb`` 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**INSTALL**\n\n\n::\n\n $ sudo pip3 install opb --upgrade --force-reinstall\n\n (*) use remove and reinstall if ``opb`` doesn't work properly\n\n\n**CONFIGURATION**\n\n\nconfiguration is done by calling the ``cfg`` command:\n\n\nIRC\n\n::\n\n $ opb cfg server=<server> channel=<channel> nick=<nick>\n\n (*) default channel/server is #opb on localhost\n\n\nSASL\n\n::\n\n $ opb pwd <nickservnick> <nickservpass>\n $ opb cfg password=<outputfrompwd>\n\n\nUSERS\n\nas default the user's userhost is not checked when a user types a command in a\nchannel. To enable userhost checking enable users with the ``cfg`` command::\n\n $ opb cfg users=True\n\n\nTo add a user to the bot use the met command::\n\n $ opb met <userhost>\n\nto delete a user use the del command with a substring of the userhost::\n\n $ opb del <substring>\n\n\nRSS\n\n::\n\n $ opb rss <url>\n\n\n\n**RUNNING**\n\n\nthis part shows how to run ``opb``.\n\n\n**cli**\n\n\nwithout any arguments ``opb`` doesn't respond, add arguments to have\n``opb`` execute a command::\n\n\n $ opb\n $\n\n\nthe ``cmd`` command shows you a list of available commands::\n\n\n $ opb cmd\n cfg,cmd,dlt,dpl,flt,fnd,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 $ opb -c\n OPB started at Fri Jan 6 01:49:58 2023\n > cmd\n cfg,cmd,dlt,dpl,flt,ftc,krn,log,met,mre,nme,pwd,rem,rss,thr,upt\n >\n\nrunning the bot in the background is done by using the ``-d`` option::\n\n $ opb -d\n $\n\n\n**COMMANDS**\n\n\nhere is a short description of the commands::\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**24/7**\n\n::\n\n sudo cp /usr/local/opb/opb.service\n /etc/systemd/system``\n sudo systemctl enable opb --now\n\n (*) default is #opb on localhost\n\nuse ``opbctl <cmd>`` as you would have use ``opb <cmd>``.\n\n\n**PROGRAMMING**\n\n\nThe ``opb`` 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 opb.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\ngreat for giving objects peristence by having their state stored in files::\n\n >>> from opb.persist import Object, write\n >>> o = Object()\n >>> write(o)\n opb.objects.Object/89efa5fd7ad9497b96fdcb5f01477320/2022-11-21/17:20:12.221192\n\n\n**AUTHOR**\n\n\nBart Thate - operbot100@gmail.com\n\n\n**COPYRIGHT**\n\n\n``opb`` is placed in the Public Domain.\n\n\n",
"bugtrack_url": null,
"license": "Public Domain",
"summary": "operator bot",
"version": "33",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b37b67261678980098c734f98695da05db89bd6c97fc0cd28d5c210b209ea465",
"md5": "73bf27eab9b49203f5b312323fa8b785",
"sha256": "71d4cf68120c80685af056c0d5b538ed10b4c7d3a1838744a2de75a7bf4aa20d"
},
"downloads": -1,
"filename": "opb-33-py3-none-any.whl",
"has_sig": false,
"md5_digest": "73bf27eab9b49203f5b312323fa8b785",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 31265,
"upload_time": "2023-04-27T14:49:12",
"upload_time_iso_8601": "2023-04-27T14:49:12.399513Z",
"url": "https://files.pythonhosted.org/packages/b3/7b/67261678980098c734f98695da05db89bd6c97fc0cd28d5c210b209ea465/opb-33-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "02a8e537c18d648a0d10479530eeb472ac892ec50385ccd00eb77478f3bb6d08",
"md5": "e824ed89b40c55c0138a80ca69d1258f",
"sha256": "1780109bc6d1805b55de16ca96af12b6439fcc3e2a7d027a1ba4f5e0d65b28f2"
},
"downloads": -1,
"filename": "opb-33.tar.gz",
"has_sig": false,
"md5_digest": "e824ed89b40c55c0138a80ca69d1258f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 24292,
"upload_time": "2023-04-27T14:49:14",
"upload_time_iso_8601": "2023-04-27T14:49:14.509625Z",
"url": "https://files.pythonhosted.org/packages/02/a8/e537c18d648a0d10479530eeb472ac892ec50385ccd00eb77478f3bb6d08/opb-33.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-27 14:49:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "operbot",
"github_project": "opb",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "opb"
}