skip to navigation
skip to content

Not Logged In

bearlib 0.9



A simple collection of helper routines that I use in a lot of projects.

I used to just copy the directory into each project…

yes, a build/release person was breaking all the rules - sigh


A dictionary based config class:

c = Config({ 'a': 1, 'b': 2, 'c': {'d': 1}}
print("c.a =", c.a)
print("c.c.d" =", c.c.d)


c.a = 1
c.c.d = 1

It also has three helper methods:

fromEtcd(host='', port=4001, base='/')

fromDict() walks thru the keys of the given dictionary recursively and adds them to the object. Any key found that has a list or dictionary value is handled with instances of Config created as needed.

fromJson() uses json.load() to process the given filename and then calls fromDict() to store the values.

fromEtcd() walks the directory tree at the base location in the etcd server, builds a dictionary and then passes that to fromDict() for storage.


Right now I’m going to use a very simple “plugin” style for event hanlders where any .py file found in a directory is imported as a module.

This will, I think, let me use the event plugins via the command line, but also via WebHooks because I can create a Flask listener for WebHook urls and then call the defined handler for a given event.


from PyPI:

pip install bearlib

from git:

cd /base/of/your/virtualenv
pip install -e git+

to update the from-git install:

cd /base/of/your/virtualenv pip install –upgrade -e git+


From the source directory:

make test
File Type Py Version Uploaded on Size
bearlib-0.9-py2-none-any.whl (md5) Python Wheel 2.7 2015-09-23 9KB
bearlib-0.9.tar.gz (md5) Source 2015-09-23 8KB
  • Downloads (All Versions):
  • 58 downloads in the last day
  • 293 downloads in the last week
  • 1465 downloads in the last month