rfc3339-validator is a lightweight, pure Python library designed for strictly validating date-time strings against the RFC 3339 Internet Date/Time Format specification. Currently at version 0.1.4, its last release was in May 2021, indicating a mature, low-cadence project that provides a focused utility for ensuring RFC 3339 compliance in applications requiring precise time formatting, such as web APIs and data serialization.
pip install rfc3339-validatorVerified import paths — ran on the pinned version, not inferred.
The library provides a single, straightforward function, `validate_rfc3339`, which takes a string and returns `True` if it conforms to the RFC 3339 specification, and `False` otherwise. RFC 3339 strictly requires a timezone offset (e.g., '+09:00', '-05:00') or 'Z' for UTC.
Ensure all date-time strings conform precisely to RFC 3339, including the 'T' separator and a mandatory timezone offset (e.g., '+00:00', '-05:00', or 'Z' for UTC).
For applications requiring leap second awareness, additional, specialized logic or libraries would be necessary beyond standard RFC 3339 validation.
Always use timezone-aware `datetime` objects, preferably `timezone.utc` or `datetime.now(timezone.utc)`, and ensure output formatting includes the correct offset or 'Z' when constructing RFC 3339 strings to be validated.
Run `pip install rfc3339-validator` to install the library.
Use the correct function name: `from rfc3339_validator import validate_rfc3339`
Call the correct validation function: `rfc3339_validator.validate_rfc3339(date_string)`
Ensure that the argument passed to `validate_rfc3339` is always a string. Convert non-string inputs to strings before validation, for example: `validate_rfc3339(str(value))`.
No dependency data recorded yet.