skillfed

durationpy

Module for converting between datetime.timedelta and Go's Duration strings.

durationpy Permissive license MIT AGING 41 v0.10 released

Install

durationpy on PyPI

pip

pip install durationpy

uv

uv add durationpy

poetry

poetry add durationpy

Package 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 - nanoseconds
  • us - microseconds
  • ms - millisecond
  • s - second
  • m - minute
  • h - hour
  • d - day
  • w - week
  • mm - month
  • y - 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.
go duration string parsertimedelta to string conversionparse duration stringshuman readable time intervalsgolang duration format pythontime duration parsing

Similar packages