Module for converting between datetime.timedelta and Go's time.Duration strings.
Python
41
66 commits
updated Aug 26, 2026
Module for converting between
datetime.timedeltaand Go's Duration strings.
$ pip install durationpy
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.
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
107 followers · starred Nov 2024
Module for converting between datetime.timedelta and Go's time.Duration strings.
Python
41
66 commits
updated Aug 26, 2026
Module for converting between
datetime.timedeltaand Go's Duration strings.
$ pip install durationpy
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.
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
107 followers · starred Nov 2024