A small module to assist in getting readable time in seconds that can be easily passed to time.sleep(seconds).
- s - seconds
- m - minutes
- h - hours
- d - days
Failing to provide a converter will default to seconds.
import duration_string
import time
time.sleep(duration_string.get("2m"))
duration_string.is_valid("2f") # raises ValueError
These are run using docstrings.