skillfed

aniso8601

A library for parsing ISO 8601 strings.

aniso8601 v10.0.1 9.3M downloads/30d#1,543 on PyPI
Permissive license AGING released

What it is and what it does

aniso8601 is a pure-Python ISO 8601 parser that converts ISO 8601 formatted strings into standard Python datetime objects. It handles dates, times, datetimes with timezone offsets, durations, and repeating intervals, returning them as datetime.date, datetime.time, datetime.datetime, datetime.timedelta, or generator objects respectively. The parser supports both extended format (with hyphens and colons) and basic format (compact), reduced accuracy (e.g., hour or minute precision), decimal fractions on the lowest time element, and UTC offsets represented as fixed-offset tzinfo.

The package has no external runtime dependencies and installs as a pure-Python wheel. It was last released 483 days ago and is classified as aging in maintenance status, though it remains in Production/Stable development status. The documentation notes that for basic ISO 8601 parsing, Python's built-in datetime.datetime.fromisoformat, datetime.date.fromisoformat, and datetime.time.fromisoformat (available in modern Python versions) may be sufficient for simpler use cases.

Use it for:

  • Parse ISO 8601 datetime strings from APIs or data feeds into Python datetime objects with timezone awareness.
  • Convert ISO 8601 duration strings (e.g., 'P1Y2M3DT4H54M6S') into timedelta objects for time arithmetic.
  • Handle ISO 8601 week dates and ordinal dates that are not supported by Python's built-in fromisoformat.
  • Generate repeating intervals from ISO 8601 repeat syntax by obtaining a generator of datetime objects.
  • Determine the resolution (year, month, day, hour, minute, second) of an ISO 8601 string for validation or logging.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses ISO 8601 date, time, datetime, duration, and interval strings into Python datetime objects and timedeltas.

Yes, if you need to parse ISO 8601 formats beyond what Python's built-in datetime.fromisoformat supports (e.g., week dates, ordinal dates, durations, repeating intervals, or custom delimiters). The package has no dependencies, installs easily, and carries no known vulnerabilities. However, if you only need basic ISO 8601 datetime parsing, Python's standard library may be sufficient and more actively maintained. The aging maintenance status means slower issue response, but the stable API and lack of recent vulnerabilities suggest it is reliable for its narrow, well-defined purpose.

Install

aniso8601 on PyPI

pip

pip install aniso8601

uv

uv add aniso8601

poetry

poetry add aniso8601

Installing aniso8601

Before you install

Low install friction with no runtime dependencies. Last release was 483 days ago; maintenance status is aging, so expect slower response to issues but no immediate concern for a stable, mature parser.

License in practice

Permissive license (BSD) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install aniso8601

import aniso8601
dt = aniso8601.parse_datetime('1977-06-10T12:00:00Z')
date = aniso8601.parse_date('1984-04-23')
time = aniso8601.parse_time('11:31:14')
duration = aniso8601.parse_duration('P1Y2M3DT4H54M6S')

Leap seconds (second value 60) are not supported and will raise LeapSecondError.

Verify before relying

  • Whether datetime.datetime.fromisoformat (built-in since Python 3.7) covers your use case better than aniso8601 for basic ISO 8601 parsing.
  • Performance characteristics for very large volumes of parsing operations.
  • Whether custom builder support for alternative datetime representations is actively maintained.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 483 days since the last release
First released
Downloads 9,335,643/month — #1,543 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aniso8601-10.0.1-py2.py3-none-any.whl

Keywords: iso8601, parser

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

ISO 8601 parserparse ISO datetime stringsISO date time parsingISO 8601 duration parserdatetime string parsingISO interval parsingtimezone-aware datetime parsing
datetime-parsingiso-8601

More Python Modules packages