isodate
An ISO 8601 date/time/duration parser and formatter
This package has a good security score with no known vulnerabilities.
Community Reviews
Solid ISO 8601 parser with predictable error handling for input validation
The library has zero dependencies beyond Python's standard library, which significantly reduces supply chain risk. This is a major win for security-conscious teams. CVE history is clean, and the codebase is small enough to audit if needed. Error messages are descriptive without exposing internals, making it safe for use in API validation layers.
One caveat: you need to handle timezone-aware vs naive datetime objects carefully, as the library returns what the input specifies. This can lead to comparison errors if you're not explicit about timezone handling in your application logic. The duration parsing is particularly useful for API inputs, but requires validation of the resulting timedelta objects to prevent resource exhaustion attacks with extremely large durations.
Best for: Parsing ISO 8601 timestamps in APIs where input validation strictness and minimal dependencies are priorities
Avoid if: You need lenient parsing of non-standard date formats or built-in business logic validation
Solid ISO 8601 parser with minimal overhead, but watch the duration edge cases
The error handling is predictable with ISO8601Error exceptions that include enough context for logging and debugging. However, duration parsing has some quirks - the library returns custom Duration objects rather than timedelta for complex durations (years/months), which can surprise you when doing arithmetic operations. You'll need to handle both types in your code or normalize immediately.
In terms of operations concerns, there's nothing to configure or tune - it's stateless with no connection pooling or resource management needed. This simplicity is actually a strength for high-throughput services. The library hasn't had breaking changes in years, making upgrades safe. Just be aware that timezone-naive strings default to naive datetime objects, so you need explicit handling for UTC assumptions.
Best for: High-throughput services needing fast, reliable ISO 8601 parsing with minimal dependencies and zero configuration overhead.
Avoid if: You need complex duration arithmetic with calendar-aware operations or want automatic timezone inference without explicit handling.
Solid ISO 8601 parser with simple API, lacks modern type hints
The main friction point is the complete absence of type hints, which feels dated in 2024. You'll need to check documentation or source code to understand what types are returned. Error messages when parsing fails are adequate but not great - you get ISO8601Error exceptions that tell you parsing failed but don't always clearly explain why your input was invalid.
Documentation exists but is minimal. The README covers basic usage patterns which is usually enough, but edge cases require digging into the code. Despite these shortcomings, it's battle-tested and reliable for the core use case of parsing ISO 8601 strings into Python datetime objects.
Best for: Projects needing reliable ISO 8601 parsing and duration support without external dependencies.
Avoid if: You need rich type hint support for strict type checking or require detailed parsing error diagnostics.
Sign in to write a review
Sign In