pytimeparse
Time expression parser
Install
pytimeparse on PyPI
pip
pip install pytimeparseuv
uv add pytimeparsepoetry
poetry add pytimeparsePackage facts
| License | License :: OSI Approved :: MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 3,009 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pytimeparse-1.1.8-py2.py3-none-any.whl
Keywords: time, parsing, parser
About pytimeparse
from the package's own PyPI description — quoted content, verbatim
===================================== pytimeparse: time expression parser =====================================
.. image:: https://travis-ci.org/wroberts/pytimeparse.svg?branch=master :target: https://travis-ci.org/wroberts/pytimeparse :alt: Travis CI build status
.. image:: https://coveralls.io/repos/wroberts/pytimeparse/badge.svg :target: https://coveralls.io/r/wroberts/pytimeparse :alt: Test code coverage
.. image:: https://img.shields.io/pypi/v/pytimeparse.svg :target: https://pypi.python.org/pypi/pytimeparse/ :alt: Latest Version
Copyright (c) 2014 Will Roberts <wildwilhelm@gmail.com>
Licensed under the MIT License (see source file timeparse.py for
details).
A small Python library to parse various kinds of time expressions,
inspired by
this StackOverflow question <http://stackoverflow.com/questions/4628122/how-to-construct-a-timedelta-object-from-a-simple-string>_.
The single function pytimeparse.timeparse.timeparse defined in the
library (also available as pytimeparse.parse) parses time
expressions like the following:
32m2h32m3d2h32m1w3d2h32m1w 3d 2h 32m1 w 3 d 2 h 32 m4:13-...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Parses human-readable time expressions (like '1w3d2h32m', '4:13:02', or '2 days, 5 hours') into seconds, returning an integer or float.
Installs with zero runtime dependencies and low friction. Maintenance is active with recent commits, though the latest release dates to 2018; the repository remains unarchived and actively maintained.
Licensed under MIT (permissive), imposing no restrictions on commercial or proprietary use provided the license notice is retained.
Usage
pip install pytimeparse
from pytimeparse import parse
result = parse('1.2 minutes')
print(result) # 72
Verdict: A lightweight, dependency-free parser for converting time expressions into seconds. MIT-licensed with active maintenance and no known vulnerabilities, making it suitable for straightforward time-parsing tasks in applications that need to accept human-readable duration input.
Needs verification
- Whether the package continues to receive bug fixes or is in maintenance-only mode despite active repository status
- Compatibility with Python versions released after 2018 (classifiers list only up to 3.6)
Similar packages
permissive · top 1,000 on PyPI
isodurationpermissive · top 1,000 on PyPI
humanizepermissive · top 1,000 on PyPI
croniterpermissive · top 1,000 on PyPI
freezegunpermissive · top 1,000 on PyPI
dateparserpermissive · top 1,000 on PyPI
backoffpermissive · top 1,000 on PyPI
argparsepermissive · top 1,000 on PyPI
license-expressionpermissive · top 1,000 on PyPI
durationpypermissive · top 1,000 on PyPI