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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file durationstring-1.2.3.tar.gz.

File metadata

  • Download URL: durationstring-1.2.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for durationstring-1.2.3.tar.gz
Algorithm Hash digest
SHA256 cb8446f9b486edb7c81213baafc069e7bd44c42b9cca1338c906470ba4d5aa65
MD5 57718fb2bbbba1779b2ca3212abbe204
BLAKE2b-256 997c32d704eef3d8e53f0b4283ea1c32ad9484aafa018daa8d6ab0e5da19d8fd

See more details on using hashes here.

File details

Details for the file durationstring-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: durationstring-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for durationstring-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3468da15f73dc4111cb72741f9629a50148f1ac921755cbf0e0588bb7c165ff9
MD5 1eee2b88e9381fcabddf1553e1575df6
BLAKE2b-256 404024807ec56a6d9cf5c191dfdba250d15af1ac533b223d6ed0c54fc60bc548

See more details on using hashes here.

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