skillfed

isoduration

Operations with ISO 8601 durations

isoduration Permissive license Abandoned 31 v20.11.0 released

Install

isoduration on PyPI

pip

pip install isoduration

uv

uv add isoduration

poetry

poetry add isoduration

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — arrow
Maintenance abandoned — 2,111 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: isoduration-20.11.0-py3-none-any.whl

Keywords: datetime, date, time, duration, duration-parsing, duration-string, iso8601, iso8601-duration

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Operating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

About isoduration

from the package's own PyPI description — quoted content, verbatim

isoduration: Operations with ISO 8601 durations.

PyPI Package (image)

What is this.

ISO 8601 is most commonly known as a way to exchange datetimes in textual format. A lesser known aspect of the standard is the representation of durations. They have a shape similar to this:

P3Y6M4DT12H30M5S

This string represents a duration of 3 years, 6 months, 4 days, 12 hours, 30 minutes, and 5 seconds.

The state of the art of ISO 8601 duration handling in Python is more or less limited to what's offered by isodate. What we are trying to achieve here is to address the shortcomings of isodate (as described in their own Limitations section), and a few of our own annoyances with their interface, such as the lack of uniformity in their handling of types, and the use of regular expressions for parsing.

How to use it.

This package revolves around the Duration type.

Given a ISO duration string we can produce such a type by using the...

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

Parse, format, and perform arithmetic operations on ISO 8601 duration strings (e.g., P3Y6M4DT12H30M5S), with support for years and months that timedelta cannot represent.

Low friction: pure-Python wheel with a single runtime dependency (arrow). However, the package has been abandoned since 2020-11-01 with no updates in over 2111 days, raising concerns about long-term maintenance and compatibility.

Licensed under ISC (permissive), allowing commercial and private use with minimal restrictions—suitable for most projects that can tolerate an unmaintained dependency.

Usage

pip install isoduration==20.11.0
from isoduration import parse_duration, format_duration
duration = parse_duration("P3Y6M4DT12H30M5S")
print(duration.date.years, duration.time.hours)
formatted = format_duration(duration)

Requires Python >=3.7; depends on arrow runtime dependency.

Verdict: isoduration cleanly solves ISO 8601 duration parsing with a design addressing isodate shortcomings, but its abandonment since 2020-11-01 is a significant risk. Use only if you can tolerate no upstream fixes and are confident the current behavior meets your needs indefinitely.

Needs verification

  • Real-world compatibility issues with Python versions released after 2020-11-01.
  • Whether arrow's maintenance and API stability will affect isoduration's usability over time.
  • Whether the single release has known edge cases or parsing gaps not covered in the description.
ISO 8601 duration parsingparse duration stringsISO duration arithmeticduration formatting ISO 8601duration comparison negationdatetime duration operationsiso8601 duration library

Similar packages