hb-config: easy to configure your python project especially Deep Learning experiments
hb-config is utility for easy to configure your python project especially Deep Learning experiments.
Config.TOKEN
Config.TOKEN = "{token}"
using pip
$ pip install hb-config
or clone repository
git clone https://github.com/hb-research/hb-config.git
python setup.py install
project: hb-config
example: true
bot:
in_bot:
test: haha
simple: wow
#
>>> from hbconfig import Config
>>> Config("config3")
>>> Config
Read config file name: config3.yml
{
"project": "hb-config",
"example": true,
"bot": {
"in_bot": {
"test": "haha",
"simple": "wow"
}
}
}
>>> Config.bot.in_bot
{
"test": "haha"
"simple": "wow"
}
>>> Config.project
'hb-config'
>>> Config.bot.in_bot.get("simple")
'wow'
>>> Config.bot.in_bot.get("not_exist_key", "default_value")
'default_value'
>>> Config.bot.in_bot
{
"test": "haha"
"simple": "wow"
}
>>> Config.bot.in_bot = "hello"
>>> Config.bot.in_bot
'hello'
project: hb-config # project name
example: true # is it example?
bot:
in_bot:
test: haha
simple: wow
>>> Config
Read config file name: ./config/config
{
"project": "hb-config",
"example": true,
"bot": {
"in_bot": {
"test": "haha",
"simple": "wow"
}
}
}
>>> Config.description
{'example': 'is it example?', 'project': 'project name'}