dc-helpers

DC utility functions and classes


Keywords
utility
License
MIT
Install
pip install dc-helpers==0.6.3

Documentation

dc_helpers

dc_helpers is a set of small useful programs.

Installation

Use pip (or pipenv) to install.

$ pip install dc_helpers

Use

Exaples you can find in source.

Calculating function elapsed time. Result will be written via logging.debug.

from dc_helpers import elapsed

@elapsed
def func():
    pass

First function call in development environment dumps result to pickle file. Sequential function calls will return result from pickle. If you need to rerun function, remove pickle file. Intention of this decorator - speeding up debugging.

from dc_helpers import dev_cache

@dev_cache(development=True)
def func():
    pass

Restart function several times after exceptions. See source.

from dc_helpers import restart

@drestart(retries=4, first_delay=1, max_delay=16, exp=2)
def func():
    pass