backports-datetime-fromisoformat
Backport of Python 3.11's datetime.fromisoformat
What it is and what it does
This package backports the expanded `datetime.fromisoformat` methods from Python 3.11 to earlier versions, allowing you to parse ISO 8601 timestamps with much broader format coverage than the built-in methods provide. The standard library's `fromisoformat` in older Python versions only handles timestamps produced by `isoformat` itself; this backport extends that to parse most of the ISO 8601 specification, including timezone offsets and various timestamp formats.
The implementation is a C port of CPython code, using a custom timezone implementation for timezone-aware objects. It requires explicit monkey-patching via `MonkeyPatch.patch_fromisoformat()` to replace the standard library methods. On Python 3.11 and later, the package has no effect—the native methods already have the full ISO 8601 support.
Use it for:
- Parse ISO 8601 timestamps from APIs or data sources in earlier Python versions without manual string manipulation.
- Handle timezone-aware datetime strings with non-standard offsets in legacy Python environments.
- Upgrade code to use the modern `fromisoformat` API while maintaining compatibility with older Python versions.
- Avoid dependency on third-party datetime libraries when only ISO 8601 parsing is needed.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Backports expanded `datetime.fromisoformat` methods to earlier Python versions, enabling parsing of ISO 8601 timestamps with broader format support than the standard library provides in older releases.
Yes, if you support Python versions earlier than 3.11 and need to parse ISO 8601 timestamps reliably. The package is stable, permissively licensed, and has no runtime dependencies. Install it conditionally so it only activates on older Python versions. Not needed for Python 3.11 and later.
Install
backports-datetime-fromisoformat on PyPI
pip
pip install backports-datetime-fromisoformatuv
uv add backports-datetime-fromisoformatpoetry
poetry add backports-datetime-fromisoformatInstalling backports-datetime-fromisoformat
Before you install
Medium install friction due to platform-specific wheels across macOS, Linux, Windows, and musl variants. Last release was 594 days ago; maintenance status is aging but the repository remains active with a recent commit on 2025-03-31. Development is described as complete, so infrequent updates are expected.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for any project type.
Quickstart
pip install backports-datetime-fromisoformat
from datetime import datetime
from backports.datetime_fromisoformat import MonkeyPatch
MonkeyPatch.patch_fromisoformat()
dt = datetime.fromisoformat("2014-01-09T21:48:00-05:30")
Requires explicit monkey-patching to override the standard library methods. Only affects Python versions earlier than 3.11.
Verify before relying
- Performance characteristics of the C implementation compared to pure-Python alternatives in typical workloads.
- Full compatibility scope with timezone-aware datetime objects beyond the custom timezone implementation mentioned.
Package facts
| License | MIT License Copyright (c) 2018 Michael Overmeyer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>3) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 594 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,139,707/month — #3,259 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_arm64.whl; backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_universal2.whl; backports_datetime_fromisoformat-2.0.3-cp310-cp310-macosx_11_0_x86_64.whl; backports_datetime_fromisoformat-2.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; backports_datetime_fromisoformat-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; backports_datetime_fromisoformat-2.0.3-cp310-cp310-musllinux_1_2_aarch64.whl; backports_datetime_fromisoformat-2.0.3-cp310-cp310-musllinux_1_2_x86_64.whl; backports_datetime_fromisoformat-2.0.3-cp310-cp310-win_amd64.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_arm64.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_universal2.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-macosx_11_0_x86_64.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-musllinux_1_2_aarch64.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-musllinux_1_2_x86_64.whl; backports_datetime_fromisoformat-2.0.3-cp311-cp311-win_amd64.whl; backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_arm64.whl; backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_universal2.whl; backports_datetime_fromisoformat-2.0.3-cp312-cp312-macosx_11_0_x86_64.whl; backports_datetime_fromisoformat-2.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
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
aniso8601Parses ISO 8601 date, time, datetime, duration,…
permissive · top 5,000 on PyPI
iso8601Parses ISO 8601 date strings (e.g.…
permissive · top 5,000 on PyPI
ciso8601Parses ISO 8601 and RFC 3339 date-time strings…
permissive · top 5,000 on PyPI
backports.zoneinfoProvides IANA time zone support for Python…
permissive · top 5,000 on PyPI
isodateParses and formats ISO 8601 date, time,…
permissive · top 1,000 on PyPI
arrowArrow provides a simpler, more intuitive API…
permissive · top 1,000 on PyPI
pyRFC3339Parses and generates RFC 3339-compliant…
permissive · top 5,000 on PyPI
isodurationParses and manipulates ISO 8601 duration…
permissive · top 1,000 on PyPI
metomi-isodatetimeParses and manipulates ISO 8601 date-time…
copyleft · top 15,000 on PyPI
timesTimes converts between universal (UTC) time and…
permissive · top 15,000 on PyPI