shakedzy / toolbox

A bunch of tools in Python I find useful

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

toolbox

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.

Available tools

Dynaconf-based singleton settings class

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

Logger with color support

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

Time-it decorator

Usage:

from decorators import time_it

@time_it
def function_to_eval():
    pass

By default, running duration is printed to debug log.

About

A bunch of tools in Python I find useful

License:MIT License


Languages

Language:Python 100.0%