--- id: backports-datetime-fromisoformat version: "2.0.3" 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) license_treatment: permissive maintenance: aging --- # backports-datetime-fromisoformat — Backport of Python 3.11's datetime.fromisoformat License: permissive · Maintenance: aging · Downloads: 2.1M/mo ## 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 above — 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 pip install backports-datetime-fromisoformat uv add backports-datetime-fromisoformat poetry add backports-datetime-fromisoformat ## Installing 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_current - Install friction: medium - Maintenance: aging - Downloads: 2.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags iso 8601 datetime parsing, fromisoformat backport, parse iso timestamps, datetime iso format support, timezone aware datetime parsing, iso 8601 compliance, legacy python datetime, datetime-parsing, iso-8601, backport [View on SkillFed](https://skillfed.io/packages/backports-datetime-fromisoformat) · [View on PyPI](https://pypi.org/project/backports-datetime-fromisoformat/)