Color#

class emtools.utils.Color#

Basic helper class to have colored string. Useful for commands and log messages.

Pretty#

class emtools.utils.Pretty#

Helper class for “pretty” string formatting from several input types (e.g. size, dates, timestamps, elapsed, etc.).

static delta(td)#

Remove the milliseconds of the timedelta.

static elapsed(timestamp, now=None)#

Get a datetime object or a int() Epoch timestamp and return a pretty string like ‘an hour ago’, ‘Yesterday’, ‘3 months ago’, ‘just now’, etc

static size(size)#

Human friendly file size.

Timer#

class emtools.utils.Timer(message='Elapsed:')#

Simple Timer base in datetime.now and timedelta.