Get readable time in seconds.
Project description
A small module to assist in getting readable time in seconds that can be easily passed to time.sleep(seconds).
Converters
s - seconds
m - minutes
h - hours
d - days
Failing to provide a converter will default to seconds.
Examples
import duration_string
import time
time.sleep(duration_string.get("2m"))
duration_string.is_valid("2f") # raises ValueError
Tests
These are run using docstrings.
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
durationstring-1.2.3.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for durationstring-1.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3468da15f73dc4111cb72741f9629a50148f1ac921755cbf0e0588bb7c165ff9 |
|
MD5 | 1eee2b88e9381fcabddf1553e1575df6 |
|
BLAKE2b-256 | 404024807ec56a6d9cf5c191dfdba250d15af1ac533b223d6ed0c54fc60bc548 |