{ "info": { "author": "Bart Thate", "author_email": "bthate@dds.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities" ], "description": "BL is a python3 framework to use if you want to program CLI, IRC or XMPP bots.\n\nfeatures\n========\n\nBL provides the following features:\n\n::\n\n object class\t \tsave/load to/from a json file.\n rest server \t\tserve saved object\u2019s over http.\n rss fetcher \t\techo rss feeds to irc channels.\n udp server \t\tudp to bot to irc channel.\n watcher server \trun tail -f and have output send to IRC channel.\n email scanning \tscan mbox format to searchable bl objects.\n json backend \t\tobjects are stored as json string in files on the fs.\n db\t\t\titeration over stored objects.\n timestamp\t\ttime based filenames gives logging capabilities\n future\t\t\tfuture sensors should provide entry to the logger.\n\ninstall\n=======\n\nClone the source:\n\n:: \n\n bart@okdan:~$ hg clone https://bitbucket.org/thatebart/bl\n\n You might need to do one of the following if the bot doesn't work:\n\n bart@okdan:~/bl$ export PYTHONPATH=\".\"\n bart@okdan:~/bl$ export PYTHONIOENCODING=\"utf-8\"\n\nAnother option is to download with pip3 and install globally:\n\n::\n\n bart@okdan:~$ pip3 install bl --upgrade\n\nirc\n===\n\nUse -n , -s , -c options to make the bot join the network:\n\n::\n\n bart@okdan:~$ bot -i irc -n bl -s irc.freenode.net -c \\#bl\n\nYou can use the -w option to write config values to ~/.bot/config/irc\n\nxmpp\n====\n\nFor the xmpp bot use the -i xmpp and --room arguments:\n\n::\n\n bart@okdan:~$ bot -i xmpp --room=test@conference.localhost\n\nusers\n=====\n\nOne needs to add a users origin to be able to give the bot commands. One can add a user with the meet command:\n\n::\n\n bart@okdan:~$ bot meet user@server\n user user@server created\n\nTo give the user a permission you can use the perm command:\n\n::\n\n bart@okdan:~$ bot perm user@server ps\n ok user@server\n\nThe u command show the json dump of a user object:\n\n::\n\n bart@okdan:~$ bot u user@server \n {\n \"_container\": {\n \"default\": \"\",\n \"path\": \"/home/bart/.bot/user/2017-10-12/21:05:52.095737\",\n \"prefix\": \"object\",\n \"saved\": \"Thu Oct 12 21:07:03 2017\",\n \"signature\": \"c113c4125f8c2a88d5b312e283792ae019c61a52\"\n },\n \"_type\": \"\",\n \"origin\": \"user@server\",\n \"perms\": [\n \"USER\",\n \"PS\"\n ],\n \"user\": \"user@server\"\n }\n\nThe default shell user is root@shell and gives access to all the commands that are available.\n\ncommands\n========\n\nThe following commands are available:\n\n::\n\n alias key, value alias. \n announce announce text on all channels in fleet. \n begin begin stopwatch. \n cfg edit config files. \n cmnds show list of commands. \n deleted show deleted records. \n delperm delete permissions of an user. \n dump dump objects matching the given criteria. \n edit edit and save objects. \n end stop stopwatch. \n exit stop the bot. \n fetcher fetch all rss feeds. \n find present a list of objects based on prompt input. \n first show the first record matching the given criteria. \n fix fix a object by loading and saving it. \n idle see how long a channel/nick has been idle. \n last show last objectect matching the criteria. \n license display BL license. \n load force a plugin reload. \n log log some text. \n loglevel set loglevel. \n loud disable silent mode of a bot. \n ls show subdirs in working directory. \n man show descriptions of the available commands. \n mbox convert emails to bl objects. \n meet create an user record. \n nick change bot nick on IRC. \n perm add/change permissions of an user. \n permissions show permissions granted to a user. \n perms show permission of user. \n pid show pid of the BL bot. \n ps show running threads. \n reboot reboot the bot, allowing statefull reboot (keeping connections alive). \n reload reload a plugin. \n restore set deleted=False in selected records. \n rm set deleted flag on objects. \n rss add a rss url. \n save make a kernel dump. \n shop add a shopitem to the shopping list. \n show show dumps of basic objects. \n silent put a bot into silent mode. \n start start a plugin. \n stop stop a plugin. \n synchronize synchronize rss feeds (fetch but don't show). \n test echo origin. \n timer timer command to schedule a text to be printed on a given time. stopwatch to measure elapsed time. \n today show last week's logged objects. \n todo log a todo item. \n tomorrow show todo items for tomorrow. \n u show user selected by userhost. \n uptime show uptime. \n version show version. \n w show user data. \n watch add a file to watch (monitor and relay to channel). \n week show last week's logged objects. \n whoami show origin. \n yesterday show last week's logged objects. \n\nmodules\n=======\n\nThe following modules are available:\n\n::\n\n bl\t\t\tbl package.\n bl.bot\t\tbot base class.\n bl.cli\t\tcommand line interfacce bot, gives a shell prompt to issue bot commands.\n bl.clock\t\ttimer, repeater and other clock based classes.\n bl.cmnds\t\tbl basic commands.\n bl.compose\t\tconstruct a object into it\u2019s type.\n bl.decorator\t\tmethod decorators\n bl.db\t\tJSON file db.\n bl.engine\t\tselect.epoll event loop, easily interrup_table esp. versus a blocking event loop.\n bl.error\t\tbl exceptions.\n bl.event\t\tevent handling classes.\n bl.fleet\t\tfleet is a list of bots.\n bl.handler\t\tschedule events.\n bl.irc\t\tIRC bot class.\n bl.launcher\t\ta launcher launches threads (or tasks in this case).\n bl.log\t\tlog module to set standard format of logging.\n bl.object\t\tJSON file backed object with dotted access.\n bl.raw\t\traw output using print.\n bl.rss\t\trss module.\n bl.selector\t\tfunctions used in code to select what objects to use.\n bl.task\t\tadapted thread to add extra functionality to threads.\n bl.trace\t\tfunctions concering stack trace.\n bl.users\t\tclass to access user records.\n bl.xmpp\t\tXMPP bot class.\n bl.register\t\tobject with list for multiple values.\n bl.rest\t\trest interface.\n bl.runner\t\tthreaded loop to run tasks on.\n bl.space\t\tcentral module to store objects in.\n bl.static\t\tstatic definitions.\n bl.template\t\tcfg objects containing default values for various services and plugins.\n bl.test\t\tplugin containing test commands and classes.\n bl.udp\t\trelay txt through a udp port listener.\n bl.utils\t\tlib local helper functions.\n bl.url\t\tfunctions that fetch data from url.\n bl.watcher\t\twatch files.\n bl.worker\t\tworker thread that handles submitted jobs through Worker.put(func, args, kwargs).\n\nprogramming\n===========\n\nBL makes it possible to program your own module enabling your own commands.\n\ncode example:\n\n::\n\n def hi(event):\n event.reply(\"hi %s\" % event.origin)\n\n\nuser programmed modules are read from a botmods directory in your current\nworking directory, you can put your .py files over there.\n\nlicense\n=======\n\nBL has a MIT license.\n\n::\n\n # -*- coding: utf-8 -*-\n #\n # BL Framework to program bots\n #\n # LICENSE\n #\n # Copyright 2017,2018 B.H.J Thate\n # \n # Permission is hereby granted, free of charge, to any person obtaining a copy \n # of this software and associated documentation files (the \"Software\"), to deal\n # in the Software without restriction, including without limitation the rights \n # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell \n # copies of the Software, and to permit persons to whom the Software is \n # furnished to do so, subject to the following conditions:\n # \n # The above copyright notice and this permission notice don't have to be included.\n # \n # THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \n # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \n # THE SOFTWARE.\n #\n # Bart Thate\n # Heerhugowaard\n # The Netherlands\n\ncontact\n=======\n\n| Bart Thate\n| botfather on #dunkbot irc.freenode.net\n| bthate@dds.nl, thatebart@gmail.com\n| hg clone ssh://bart_thate@hg.osdn.net//hgroot/bl/bl\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/bthate/bl", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "blib", "package_url": "https://pypi.org/project/blib/", "platform": "", "project_url": "https://pypi.org/project/blib/", "project_urls": { "Homepage": "https://bitbucket.org/bthate/bl" }, "release_url": "https://pypi.org/project/blib/3/", "requires_dist": null, "requires_python": "", "summary": "Framework to program bots !!", "version": "3" }, "last_serial": 3425246, "releases": { "1": [ { "comment_text": "", "digests": { "md5": "d9e3c0d0b09879a9873eedbf6b17ba4d", "sha256": "123f8dbcb746455c1c1eb6944fb7d77caf862b314342a22cdc3810d9f9f719c9" }, "downloads": -1, "filename": "blib-1.tar.gz", "has_sig": false, "md5_digest": "d9e3c0d0b09879a9873eedbf6b17ba4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58451, "upload_time": "2017-12-15T23:49:11", "url": "https://files.pythonhosted.org/packages/a6/77/ff5514b8bcd2e98082b2fb239d2547f05dc1245216d115ea7993763450c4/blib-1.tar.gz" } ], "2": [ { "comment_text": "", "digests": { "md5": "ea07f662e7ff05a0a536383c554aed22", "sha256": "a01d215c3b37d3443e2eb109a93bf0446b88d29a9b6dddabd4f5b63cdc51f3b3" }, "downloads": -1, "filename": "blib-2.tar.gz", "has_sig": false, "md5_digest": "ea07f662e7ff05a0a536383c554aed22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58031, "upload_time": "2017-12-16T15:28:52", "url": "https://files.pythonhosted.org/packages/03/8f/f208a7c0cb084b9e15fe64d7843da5d0e389fa2d4d0216a8190031656ea4/blib-2.tar.gz" } ], "3": [ { "comment_text": "", "digests": { "md5": "fe0fae0c16b38c63377a4afb74a7dd8d", "sha256": "a1e7f6fdf8139f52c4ce90589074d42868bf1bf7ac7287b11f0a12a502dcbdfb" }, "downloads": -1, "filename": "blib-3.tar.gz", "has_sig": false, "md5_digest": "fe0fae0c16b38c63377a4afb74a7dd8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55564, "upload_time": "2017-12-18T15:50:19", "url": "https://files.pythonhosted.org/packages/73/08/f722d971f75cb94b55fdd967f576d61cf0024160dd20877eeb9a218a0cb8/blib-3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe0fae0c16b38c63377a4afb74a7dd8d", "sha256": "a1e7f6fdf8139f52c4ce90589074d42868bf1bf7ac7287b11f0a12a502dcbdfb" }, "downloads": -1, "filename": "blib-3.tar.gz", "has_sig": false, "md5_digest": "fe0fae0c16b38c63377a4afb74a7dd8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 55564, "upload_time": "2017-12-18T15:50:19", "url": "https://files.pythonhosted.org/packages/73/08/f722d971f75cb94b55fdd967f576d61cf0024160dd20877eeb9a218a0cb8/blib-3.tar.gz" } ] }