Skip to main content

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)

Uploaded Source

Built Distribution

durationstring-1.2.3-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page