Registry / serialization / isodate

isodate

JSON →
library0.7.2pypypi✓ verified 10d ago

An ISO 8601 date/time/duration parser and formatter. Current version: 0.7.2, released on October 8, 2024. Maintained with a release cadence of approximately one year between major versions.

pip install isodate
INSTALL
IMPORT
SIG · ISODATE
I
isodate
serializationpythonv0.7.2
Install
1.6s avg
Import
12ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.012s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse_datetime
from isodate import parse_datetime
Ensure correct import path to access parsing functions.

Parse an ISO 8601 date-time string into a Python datetime object.

from isodate import parse_datetime # Parse an ISO 8601 date-time string iso_string = '2024-10-08T14:30:00' parsed_datetime = parse_datetime(iso_string) print(parsed_datetime)
Debug
Known issues
breakingFractional seconds are truncated to microseconds (always round down).
fix
Ensure input strings have fractional seconds within microsecond precision.
affects: 0.7.2
breakingPython versions prior to 3.7 are no longer supported.
fix
Upgrade to Python 3.7 or later.
affects: 0.7.2
Errors
Common errors & fixes
ImportError: No module named 'isodate'
The 'isodate' library is not installed in your Python environment.
fix
pip install isodate
isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: 'YOUR_STRING_HERE'
The input string provided to an 'isodate' parsing function (e.g., parse_datetime, parse_date, parse_duration) does not strictly adhere to a recognized ISO 8601 format.
fix
Ensure the date/time/duration string is in a valid ISO 8601 format, such as 'YYYY-MM-DDTHH:MM:SSZ' for datetime or 'P1Y2M3DT4H5M6S' for duration. Refer to the 'isodate' documentation for supported formats.
AttributeError: module 'isodate' has no attribute 'ISO8601Error'
The 'ISO8601Error' exception is not directly available under the top-level 'isodate' module; it is located within the 'isodate.isoerror' submodule.
fix
Import 'ISO8601Error' from 'isodate.isoerror' like this: from isodate.isoerror import ISO8601Error
Upgrade
Version history
0.7.2latest on PyPI · released Oct 8, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
Resources
isodate — pip install isodate · libregistry