OBJ is a pure python3 framework that allows storage of JSON object to a filestamped file on the disk. OBJ uses a timestamped, type in filename, JSON stringified, files on filesystem backend and has timed based logging capabilities. OBJ has been placed in the Public Domain and contains no copyright or LICENSE.

S O U R C E

obj imports all modules at once.
obj.base base classes.
obj.clock timers, repeaters.
obj.cmds basic commands.
obj.command list of tokens parsed into a command.
obj.handler event handler.
obj.loader module loader.
obj.shell shell related commands.
obj.store timestamped JSON file backend.
obj.tasks obj threads.
obj.utils utility functions.

E D I T

use the ed command to edit OBJ objects:

> obj ed obj.kernel.cfg shell=False

P R O G R A M M I N G

programming your own commands is easy, your can load modules with the -m option. if you create a mods directory and put your hello.py module in it, you would use:

> obj -m mods

any command you have coded in hello.py would be available, see the show cmds command.

> obj show cmds

a command is a function with one argument, the event that was generated on the bot.

example:

def mycmd(event):
<your code here>

you can use event.reply() to send response back to the user:

def hello(event):
event.reply(“hello %s” % event.nick)

after starting botz with -m mods, you see the hello command added to the bot:

> s cmds

ed,find,hello,log,oper,restore,rm,show,todo

I N S T A L L

you can fetch OBJ from the following:

https://pypi.org/project/obj | http://bitbucket.org/bthate/obj

if you need botz to have access to your local directory use this:

> export PYTHONPATH=”.”

this will add your current directory to the pythonpath so the packages in it can be found by botz.

installation is through pypi:

> sudo pip3 install botz

you can also run the bot from the tarball at pypi and run it directly or install with setup.py:

> python3 setup.py install –user

C O N F I G U R A T I O N

obj includes one program, the obj shell:

> obj [-m mod1,mod2] command

H A V E F U N

bthate@dds.nl | botfather on #dunkbots at irc.freenode.net | xmpp: bart@xmpp.fi