pytimeparse2
Time expression parser.
Decision gist · record as of 2026-08-14
Yes. pytimeparse2 solves a specific, well-defined problem with zero dependencies, permissive licensing, and no security issues. It is stable and dormant rather than actively maintained, but that is appropriate for a mature parsing utility. Install it if you need to accept time expressions from users or configuration; skip it if you only work with numeric seconds or strict time formats.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is dormant (last commit 2023-09-29, 1191 days ago), but the package is marked Production/Stable and carries no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) — you may use, modify, and distribute freely with minimal restrictions; include the license text.
last release 2023-05-11 (1191 days) · last repo commit 2023-09-29 · 19 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,452,027 downloads/mo, #2,618 on PyPI
Alternatives
Verify before relying
pip install pytimeparse2
from pytimeparse2 import parse
result = parse('2h32m')
print(result) # seconds as integer or float- Whether dateutil is automatically installed or optional; the description mentions conditional relativedelta support but does not clarify the dependency status.
- Performance characteristics and parsing speed for large batches of expressions.
- Exact behavior and edge cases for month/year calculations (the description notes assumptions but does not detail all corner cases).
What it is and what it does
pytimeparse2 is a lightweight parser that converts time expressions written in natural language into numeric seconds or Python timedelta objects. It handles a wide variety of formats: shorthand notation (32m, 2h32m, 3d2h32m), colon-separated time (4:13:02), English prose (5 hours, 34 minutes, 56 seconds), and uptime-style output (2 days, 4:13:02). The library also supports months and years using fixed assumptions (30 days per month, 365 days per year).
The package has no runtime dependencies and installs as a pure Python wheel, making it simple to add to any project. It is marked Production/Stable and supports Python 3.6 through 3.11. Maintenance is dormant (last update in 2023), but the codebase carries no known vulnerabilities and the API is straightforward: call parse() with a time string and optionally request a timedelta object instead of raw seconds.
Use it for
- Parse user-supplied timeout or delay values in configuration files or CLI arguments.
- Convert uptime or system log timestamps into standardized seconds for calculations.
- Accept human-friendly duration input in web forms or APIs and normalize to timedelta.
- Build retry logic or rate-limiting that reads duration strings from environment variables.
- Parse scheduling expressions that use natural time notation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pytimeparse2 solves a specific, well-defined problem with zero dependencies, permissive licensing, and no security issues. It is stable and dormant rather than actively maintained, but that is appropriate for a mature parsing utility. Install it if you need to accept time expressions from users or configuration; skip it if you only work with numeric seconds or strict time formats.
Install
pytimeparse2 on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant (last commit 2023-09-29, 1191 days ago), but the package is marked Production/Stable and carries no known vulnerabilities.
License in practice
MIT license (permissive) — you may use, modify, and distribute freely with minimal restrictions; include the license text.
Quickstart
pip install pytimeparse2
from pytimeparse2 import parse
result = parse('2h32m')
print(result) # seconds as integer or float
Verify before relying
- Whether dateutil is automatically installed or optional; the description mentions conditional relativedelta support but does not clarify the dependency status.
- Performance characteristics and parsing speed for large batches of expressions.
- Exact behavior and edge cases for month/year calculations (the description notes assumptions but does not detail all corner cases).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,191 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,452,027 / month, #2,618 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text ProcessingTopic :: Utilities |
Evidence: pytimeparse2-1.7.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “convert time string to seconds”
- pytimeparse2Parses human-readable time expressions (like '2h32m', '1.2 minutes',…
- pytimeparseParses human-readable time expressions (like '2h32m', '1.2 minutes',…
- humanreadableParses human-readable time and bitrate strings (e.g. '120 sec', '1…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also pytimeparse · delta · humanreadable · ago · durationpy · timeago · metomi-isodatetime · isodate · isoduration · human-readable