humanize_time

termtools.terminal.humanize_time(secs, align=False, always_show_all_units=False)[source]

Prints time that is given as seconds in human readable form. Useful only for times >=1sec.

Parameters:
  • float (secs) – number of seconds
  • bool, optional (always_show_all_units) – whether to align outputs so that they all take the same size (not implemented)
  • bool, optional – Whether to always show days, hours, and minutes even when they are zeros. default False
Returns:

str formated string with the humanized form