Python package to format duration
Project description
format_duration
Python module to convert duration to human readable format
Installation
pip install format_duration
Usage
from datetime import timedelta
from format_duration import DurationLimit, format_duration
duration = timedelta(days=1, hours=1, minutes=1, seconds=1) # duration to format
limit = DurationLimit.MINUTE # only print till minutes
is_abbreviated = False # Whether to print in abbreviated form
formatted_duration = format_duration(duration, is_abbreviated, limit) # formatted duration string
print(formatted_duration) # 1 days, 1 hours, 1 minutes
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
format_duration-0.0.3.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for format_duration-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f0571e2aa2fb2a56b9b4abfdde0c0038cb419d490020074e653f6e9d7ed6205 |
|
MD5 | 1600c3139727e82e292dc2eaa05fc325 |
|
BLAKE2b-256 | c3299c6e73884212c2311ee3c6c0ce9d3cbc32dfc46408b13d625ad379b1aa12 |