michael-swan / common_helper_filter

generate nice structured output

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

common_helper_filter

Build Status codecov BCH compliance

Generate nice structured output of data.

time

Converts seconds in nicly formated strings.

Examples:

from common_helper_filter import time_format

print(time_format(122))
>> 2m, 2s

print(time_format(122).format(description='short'))
>> 2m, 2s

print(time_format(122).format(description='long'))
>> 2 minutes, 2 seconds

print(time_format(122).format(description='none'))
>> 2:2

print(time_format(63072000))
>> 2y, 0d, 0h, 0m, 0s

About

generate nice structured output

License:GNU General Public License v3.0


Languages

Language:Python 69.0%Language:Nix 31.0%