Package Info

python-pytimeparse


Time expression parser


Development/Languages/Python

A small Python library to parse various kinds of time expressions, inspired by a StackOverflow question.

The single function pytimeparse.timeparse.timeparse defined in the library (also available as pytimeparse.parse) parses time expressions like the following:

  • 32m
  • 2h32m
  • 3d2h32m
  • 1w3d2h32m
  • 1w 3d 2h 32m
  • 1 w 3 d 2 h 32 m
  • ...

It returns the time as a number of seconds (an integer value if possible, otherwise a floating-point number)

A number of seconds can be converted back into a string using the datetime module in the standard library.


License: MIT
URL: https://github.com/wroberts/pytimeparse

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
1.1.8-bp156.3.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-pytimeparse
1.1.8-bp155.2.13 info GA Release 2023-05-22 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-pytimeparse
1.1.8-bp154.1.49 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-pytimeparse
1.1.8-bp153.1.15 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-pytimeparse
  • python3-pytimeparse
1.1.8-bp152.3.16 info GA Release 2020-04-17 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-pytimeparse
  • python3-pytimeparse
1.1.8-bp151.1.1 info GA Release 2019-06-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-pytimeparse
  • python3-pytimeparse