Skip to content

geonyoro/durationstring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

durationstring

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages