A bunch of utilities in Python I find made for myself and found to be generally useful across different projects.
This is not a standalone package, use each file as you wish.
This Dynaconf-based singleton settings class can be read (and write to) using the same Dynaconf syntax and approach:
Settings file:
[server]
port = 8888
Initialize:
from settings import init_settings
init_settings("path/to/config_files")
Usage:
from settings import Settings
port = Settings().server.port
Usage:
from color_logger import get_logger
logger = get_logger()
logger.error("This is an error!", color="red")
Supported colors: red, green, yellow, blue, magenta, cyan
Usage:
from decorators import time_it
@time_it
def function_to_eval():
pass
By default, running duration is printed to debug log.