skillfed

pytimeparse

Time expression parser

pytimeparse Permissive license License :: OSI Approved :: MIT License Active 299 v1.1.8 released

Install

pytimeparse on PyPI

pip

pip install pytimeparse

uv

uv add pytimeparse

poetry

poetry add pytimeparse

Package 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Text Processing

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 &lt;http://stackoverflow.com/questions/4628122/how-to-construct-a-timedelta-object-from-a-simple-string&gt;_.

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
  • 4: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)
parse time expressionsconvert time string to secondshuman readable duration parsertime expression parsingparse uptime formattimedelta from string

Similar packages