jsonbot


Namejsonbot JSON
Version 100 PyPI version JSON
download
home_pagehttp://github.com/bhate/jsonbot
SummaryThe JSON Every Where Bot
upload_time2022-12-13 14:44:25
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**


``JSONBOT`` - The JSON Everywhere Bot


**SYNOPSIS**


| ``jsonbot [-c] [-i] [-r]``
| ``jsonbot <cmd> [key=value] [key==value]``
|


**DESCRIPTION**


``JSONBOT`` 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. 

``JSONBOT`` 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
that are read-only so thus should provide (disk) persistence. Paths carry the
type in the path name what makes reconstruction from filename easier then
reading type from the object. ``JSONBOT`` uses ~/.jsonbot/mod to read
modules from.


``JSONBOT`` 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**

|
| ``pip3 install jsonbot``
|

**CONFIGURATION**

|
| configuration is done by calling the ``cfg`` command of ``jsonbot``
| 

**irc**


| ``jsonbot cfg server=<server> channel=<channel> nick=<nick>``
|
| (*) default channel/server is #jsonbot on localhost
|

**sasl**


| ``jsonbot pwd <nickservnick> <nickservpass>``
| ``jsonbot cfg password=<outputfrompwd>``
|

**users**


| ``jsonbot cfg users=True``
| ``jsonbot met <userhost>``
|

**rss**


| ``jsonbot rss <url>``
|


**RUNNING**


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

**cli**

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


| ``$ jsonbot``
| ``$``
|

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


| ``$ jsonbot cmd``
| ``cfg,cmd,dlt,dne,dpl,flt,fnd,ftc,log,met,mre,nme,pwd,rem,rss,tdo,thr,ver``
|

**console**

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


| ``$ jsonbot -c``
| ``JSONBOT started at Fri Sep 16 02:11:23 2022``
| ``> cfg``
| ``server=localhost port=6667 channel=#jsonbot nick=jsonbot cc=!``
| ``> thr``
| ``Console.loop(8s) IRC.keep(8s) IRC.loop(8s) IRC.output(8s) thr(8s) Fetcher.run/4m59s``
|

**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
| ``ver`` - show version
|


**PROGRAMMING**


The ``jsb`` 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 jsb 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 jsb import Object, load, save
>>> o = Object()
>>> o.key = "value"
>>> p = save(o)
>>> obj = Object()
>>> load(obj, p)
>>> obj.key
>>> 'value'

great for giving objects peristence by having their state stored in files::

 >>> from jsb import Object, save
 >>> o = Object()
 >>> save(o)
 jsb.object.Object/89efa5fd7ad9497b96fdcb5f01477320/2022-11-21/17:20:12.221192


**SYSTEMD**


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


 $ ``sudo systemctl enable /usr/local/jsonbot/jsonbot.service --now

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

 use ``jsonbotctl`` instead of the use ``jsonbot`` program

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


**AUTHOR**


Bart Thate - bthate@dds.nl


**COPYRIGHT**


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



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/bhate/jsonbot",
    "name": "jsonbot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Bart Thate",
    "author_email": "bthate@dds.nl",
    "download_url": "https://files.pythonhosted.org/packages/b0/aa/9d7f53da4591372f05ee453ee4e15fb26ca44e2e85dee64ed4dc2fff9920/jsonbot-100.tar.gz",
    "platform": null,
    "description": "README\n######\n\n\n**NAME**\n\n\n``JSONBOT`` - The JSON Everywhere Bot\n\n\n**SYNOPSIS**\n\n\n| ``jsonbot [-c] [-i] [-r]``\n| ``jsonbot <cmd> [key=value] [key==value]``\n|\n\n\n**DESCRIPTION**\n\n\n``JSONBOT`` 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``JSONBOT`` 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\nthat are read-only so thus should provide (disk) persistence. Paths carry the\ntype in the path name what makes reconstruction from filename easier then\nreading type from the object. ``JSONBOT`` uses ~/.jsonbot/mod to read\nmodules from.\n\n\n``JSONBOT`` 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\n**INSTALL**\n\n|\n| ``pip3 install jsonbot``\n|\n\n**CONFIGURATION**\n\n|\n| configuration is done by calling the ``cfg`` command of ``jsonbot``\n| \n\n**irc**\n\n\n| ``jsonbot cfg server=<server> channel=<channel> nick=<nick>``\n|\n| (*) default channel/server is #jsonbot on localhost\n|\n\n**sasl**\n\n\n| ``jsonbot pwd <nickservnick> <nickservpass>``\n| ``jsonbot cfg password=<outputfrompwd>``\n|\n\n**users**\n\n\n| ``jsonbot cfg users=True``\n| ``jsonbot met <userhost>``\n|\n\n**rss**\n\n\n| ``jsonbot rss <url>``\n|\n\n\n**RUNNING**\n\n\nthis part shows how to run ``jsonbot``.\n\n**cli**\n\nwithout any arguments ``jsonbot`` doesn't respond, add arguments to have\n``jsonbot`` execute a command:\n\n\n| ``$ jsonbot``\n| ``$``\n|\n\nthe ``cmd`` command shows you a list of available commands:\n\n\n| ``$ jsonbot cmd``\n| ``cfg,cmd,dlt,dne,dpl,flt,fnd,ftc,log,met,mre,nme,pwd,rem,rss,tdo,thr,ver``\n|\n\n**console**\n\nuse the -c option to start the bot as a console.\n\n\n| ``$ jsonbot -c``\n| ``JSONBOT started at Fri Sep 16 02:11:23 2022``\n| ``> cfg``\n| ``server=localhost port=6667 channel=#jsonbot nick=jsonbot cc=!``\n| ``> thr``\n| ``Console.loop(8s) IRC.keep(8s) IRC.loop(8s) IRC.output(8s) thr(8s) Fetcher.run/4m59s``\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| ``ver`` - show version\n|\n\n\n**PROGRAMMING**\n\n\nThe ``jsb`` 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 jsb 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 jsb import Object, load, save\n>>> o = Object()\n>>> o.key = \"value\"\n>>> p = save(o)\n>>> obj = Object()\n>>> load(obj, p)\n>>> obj.key\n>>> 'value'\n\ngreat for giving objects peristence by having their state stored in files::\n\n >>> from jsb import Object, save\n >>> o = Object()\n >>> save(o)\n jsb.object.Object/89efa5fd7ad9497b96fdcb5f01477320/2022-11-21/17:20:12.221192\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 systemctl enable /usr/local/jsonbot/jsonbot.service --now\n\n (*) default channel/server is #jsonbot on localhost\n\n use ``jsonbotctl`` instead of the use ``jsonbot`` program\n\n $ ``sudo jsonbotctl cfg server=<server> channel=<channel> nick=<nick>``\n $ ``sudo jsonbotctl pwd <nickservnick> <nickservpass>``\n $ ``sudo jsonbotctl cfg password=<outputfrompwd>``\n $ ``sudo jsonbotctl cfg users=True``\n $ ``sudo jsonbotctl met <userhost>``\n $ ``sudo jsonbotctl rss <url>``\n\n\n**AUTHOR**\n\n\nBart Thate - bthate@dds.nl\n\n\n**COPYRIGHT**\n\n\n``JSONBOT`` is placed in the Public Domain.\n\n\n",
    "bugtrack_url": null,
    "license": "Public Domain",
    "summary": "The JSON Every Where Bot",
    "version": "100",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "ea7f71a43781f181b5b08c573a71f57c",
                "sha256": "6e59979c4434ab44de11c59998c7b216be4c36135fbb433d62fb1ec6c72b5ad0"
            },
            "downloads": -1,
            "filename": "jsonbot-100-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ea7f71a43781f181b5b08c573a71f57c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 29220,
            "upload_time": "2022-12-13T14:44:23",
            "upload_time_iso_8601": "2022-12-13T14:44:23.005958Z",
            "url": "https://files.pythonhosted.org/packages/e6/26/ad5263275448b033075320fd4324f00588aa838bdf53051b5b01916a80e3/jsonbot-100-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "7a7e30a2fa335e03fe4b2a6decaf0eb3",
                "sha256": "e31f56a267476d4c13beb7102fa306ea1b7479edab34a9d488451b1aa9cfdf1b"
            },
            "downloads": -1,
            "filename": "jsonbot-100.tar.gz",
            "has_sig": false,
            "md5_digest": "7a7e30a2fa335e03fe4b2a6decaf0eb3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38234,
            "upload_time": "2022-12-13T14:44:25",
            "upload_time_iso_8601": "2022-12-13T14:44:25.741008Z",
            "url": "https://files.pythonhosted.org/packages/b0/aa/9d7f53da4591372f05ee453ee4e15fb26ca44e2e85dee64ed4dc2fff9920/jsonbot-100.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-13 14:44:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "bhate",
    "github_project": "jsonbot",
    "lcname": "jsonbot"
}
        
Elapsed time: 0.02153s