pyiso8601
A simple ISO 8601 date parsing library for Python.
I originally took a regex I was using and wrapped in a library I published on PyPI, mostly for my own convenience. I had gotten sick of copying and pasting the same regex around 😄
Since this was 20 years ago there were next to no packages on PyPI in comparison to now, so it was pretty common to accidentally grab a fairly general name for libraries. So I accidentally wound up publishing a heavily used library, I suspect mostly because of the name (though the functionality is useful too!).
PyPI: https://pypi.org/project/iso8601/
GitHub: https://github.com/micktwomey/pyiso8601
Usage is pretty simple:
>>> import iso8601
>>> iso8601.parse_date("2007-01-25T12:00:00Z")
datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.Utc>)
>>>Example of pyiso8601 usage
It tries to do the sensible thing with most forms of ISO 8601 alike date strings.
All posts tagged with #pyiso8601

