aniso8601
A library for parsing ISO 8601 strings.
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 aniso8601uv
uv add aniso8601poetry
poetry add aniso8601Installing 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
backports-datetime-fromisoformatBackports expanded `datetime.fromisoformat`…
permissive · top 5,000 on PyPI
DateTimeRangeDateTimeRange creates and manipulates time…
permissive · top 15,000 on PyPI
iso8601Parses ISO 8601 date strings (e.g.…
permissive · top 5,000 on PyPI
metomi-isodatetimeParses and manipulates ISO 8601 date-time…
copyleft · top 15,000 on PyPI
ciso8601Parses ISO 8601 and RFC 3339 date-time strings…
permissive · top 5,000 on PyPI
isodateParses and formats ISO 8601 date, time,…
permissive · top 1,000 on PyPI
isodurationParses and manipulates ISO 8601 duration…
permissive · top 1,000 on PyPI
ntplibQuery NTP servers to retrieve network time…
permissive · top 5,000 on PyPI
arrowArrow provides a simpler, more intuitive API…
permissive · top 1,000 on PyPI
udatetimeudatetime provides fast RFC3339-compliant…
permissive · top 15,000 on PyPI