HEX
Server: Apache/2.4.41 (FreeBSD) OpenSSL/1.0.2s mod_fcgid/2.3.9
System: FreeBSD salazo 12.0-RELEASE-p1303-ZFS hostBSD 12.0-RELEASE-p1303-ZFS DMR amd64
User: admin (1000)
PHP: 7.4.3
Disabled: NONE
Upload Files
File: /usr/ports/devel/py-pytimeparse/pkg-descr
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

...

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

>>> from pytimeparse import parse
>>> parse('1.2 minutes')
72

WWW: https://github.com/wroberts/pytimeparse