{"id":13490454,"url":"https://github.com/movermeyer/backports.datetime_fromisoformat","last_synced_at":"2025-04-05T14:09:09.683Z","repository":{"id":56555560,"uuid":"139175281","full_name":"movermeyer/backports.datetime_fromisoformat","owner":"movermeyer","description":"A backport of Python 3.11's `datetime.fromisoformat` methods to earlier versions of Python","archived":false,"fork":false,"pushed_at":"2025-03-17T03:50:37.000Z","size":163,"stargazers_count":29,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T13:11:31.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/movermeyer.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-29T17:02:16.000Z","updated_at":"2024-12-31T00:52:02.000Z","dependencies_parsed_at":"2023-12-11T14:37:11.885Z","dependency_job_id":"b1012432-bc86-4663-ae86-ce9dcfe6f344","html_url":"https://github.com/movermeyer/backports.datetime_fromisoformat","commit_stats":{"total_commits":55,"total_committers":3,"mean_commits":"18.333333333333332","dds":"0.34545454545454546","last_synced_commit":"9a92596d1580d028c437ec0fc51cf6af90f6346b"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movermeyer%2Fbackports.datetime_fromisoformat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movermeyer%2Fbackports.datetime_fromisoformat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movermeyer%2Fbackports.datetime_fromisoformat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movermeyer%2Fbackports.datetime_fromisoformat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/movermeyer","download_url":"https://codeload.github.com/movermeyer/backports.datetime_fromisoformat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345854,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T19:00:46.847Z","updated_at":"2025-04-05T14:09:09.662Z","avatar_url":"https://github.com/movermeyer.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"================================\nbackports.datetime_fromisoformat\n================================\n\n.. image:: https://github.com/movermeyer/backports.datetime_fromisoformat/actions/workflows/test.yml/badge.svg\n    :target: https://github.com/movermeyer/backports.datetime_fromisoformat/actions/workflows/test.yml\n\nA backport of Python 3.11's ``datetime.fromisoformat`` methods to earlier versions of Python 3.\nTested against Python 3.6, 3.7, 3.8, 3.9, 3.10 and 3.11\n\nCurrent Status\n--------------\n\nDevelopment of ``backports.datetime_fromisoformat`` is \"complete\". Outside of potential minor bug fixes, do not expect new development here.\n\nVersion 2 changes\n-----------------\n\nIn version 1, ``backports.datetime_fromisoformat`` was a backport of the Python 3.7 version of the ``fromisoformat`` methods.\nThis meant that it was limited in being able to parse only timestamps that were in the format produced by ``datetime.isoformat``.\n\nAs of version 2, ``backports.datetime_fromisoformat`` is a backport of the Python 3.11 version of the ``fromisoformat`` methods, which can parse (almost) the entire ISO 8601 specification.\nThere are no changes required when upgrading from v1 to v2. The parser is simply able to parse a wider portion of the ISO 8601 specification.\n\nHowever, starting in version 2, ``backports.datetime_fromisoformat`` will apply its changes to Python \u003c 3.11, whereas v1 only applied changes to Python \u003c 3.7.\nIf you happened to be using ``backports.datetime_fromisoformat`` v1 on Python 3.7 through Python 3.10 and then upgrade to v2, it will patch the ``fromisoformat`` methods, whereas in v1 it did not.\nThe result is that the ``fromisoformat`` methods will suddenly be able to parse timestamps from a wider portion of the ISO 8601 specification.\n\nQuick Start\n-----------\n\n**Installation:**\n\n.. code:: bash\n\n  pip install \"backports-datetime-fromisoformat; python_version \u003c '3.11'\"\n\n**Usage:**\n\n.. code:: python\n\n  \u003e\u003e\u003e from datetime import date, datetime, time\n  \u003e\u003e\u003e from backports.datetime_fromisoformat import MonkeyPatch\n  \u003e\u003e\u003e MonkeyPatch.patch_fromisoformat()\n\n  \u003e\u003e\u003e datetime.fromisoformat(\"2014-01-09T21:48:00-05:30\")\n  datetime.datetime(2014, 1, 9, 21, 48, tzinfo=-05:30)\n\n  \u003e\u003e\u003e date.fromisoformat(\"2014-01-09\")\n  datetime.date(2014, 1, 9)\n\n  \u003e\u003e\u003e time.fromisoformat(\"21:48:00-05:30\")\n  datetime.time(21, 48, tzinfo=-05:30)\n\nExplanation\n-----------\nIn Python 3.7, `datetime.fromisoformat`_ was added. It is the inverse of `datetime.isoformat`_.\nSimilar methods were added to the ``date`` and ``time`` types as well.\n\nIn Python 3.11, `datetime.fromisoformat`_ was extended to cover (almost) all of the ISO 8601 specification, making it generally useful.\n\nFor those who need to support earlier versions of Python, a backport of these methods was needed.\n\n.. _`datetime.fromisoformat`: https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat\n\n.. _`datetime.isoformat`: https://docs.python.org/3/library/datetime.html#datetime.date.isoformat\n\n``backports.datetime_fromisoformat`` is a C implementation of ``fromisoformat`` based on the upstream cPython 3.11 code.\nFor timezone objects, it uses a custom ``timezone`` C implementation (originally from `Pendulum`_).\n\n.. _`Pendulum`: https://pendulum.eustace.io/\n\nUsage in Python 3.11+\n---------------------\n\nNOTE: in Python 3.11 and later, compatible versions of ``fromisoformat`` methods exist in the stdlib, and installing this package has NO EFFECT.\n\nGoal / Project Scope\n--------------------\n\nThe purpose of this project is to provide a perfect backport of the ``fromisoformat`` methods to earlier versions of Python, while still providing comparable performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovermeyer%2Fbackports.datetime_fromisoformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmovermeyer%2Fbackports.datetime_fromisoformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovermeyer%2Fbackports.datetime_fromisoformat/lists"}