durationpy
Module for converting between datetime.timedelta and Go's Duration strings.
Install
durationpy on PyPI
pip
pip install durationpyuv
uv add durationpypoetry
poetry add durationpyPackage facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 453 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: durationpy-0.10-py3-none-any.whl
About durationpy
from the package's own PyPI description — quoted content, verbatim
durationpy
> Module for converting between datetime.timedelta and Go's Duration strings.
Install
$ pip install durationpy
Parse
ns- nanosecondsus- microsecondsms- milliseconds- secondm- minuteh- hourd- dayw- weekmm- monthy- year
# parse
td = durationpy.from_str("4h3m2s1ms")
# format
durationpy.to_str(td)
Note: nanosecond precision is lost because datetime.timedelta uses microsecond resolution.
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
Converts between Python's datetime.timedelta objects and Go-style duration strings (e.g., "4h3m2s"), enabling easy parsing and formatting of human-readable time intervals.
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last commit 453 days old—but the repository remains active and the package has been stable since 2017.
MIT license permits commercial and private use with minimal restrictions; you must retain the license notice in distributions.
Usage
pip install durationpy
import durationpy
td = durationpy.from_str("4h3m2s1ms")
print(durationpy.to_str(td))
Nanosecond precision is lost because datetime.timedelta uses microsecond resolution.
Verdict: A lightweight, stable utility for Go↔Python duration interop with no dependencies and permissive licensing. Aging maintenance (453 days since last commit) is a minor concern for a stable, narrowly-scoped library with no known vulnerabilities.
Needs verification
- Whether Python version support is truly unspecified or if there are practical constraints not documented in the package metadata.
Similar packages
permissive · top 1,000 on PyPI
arrowpermissive · top 1,000 on PyPI
isodurationpermissive · top 1,000 on PyPI
croniterpermissive · top 1,000 on PyPI
pytimeparsepermissive · top 1,000 on PyPI
humanizepermissive · top 1,000 on PyPI
cron-descriptorpermissive · top 1,000 on PyPI
freezegunpermissive · top 1,000 on PyPI
webcolorspermissive · top 1,000 on PyPI
holidayspermissive · top 1,000 on PyPI