Parsing ISO date/time strings - where did the parser go?

John Nagle nagle at animats.com
Sat Sep 8 23:51:03 EDT 2012


On 9/8/2012 5:20 PM, John Gleeson wrote:
> 
> On 2012-09-06, at 2:34 PM, John Nagle wrote:
>>  Yes, it should.  There's no shortage of implementations.
>> PyPi has four.  Each has some defect.
>>
>>   PyPi offers:
>>
>>     iso8601 0.1.4         Simple module to parse ISO 8601 dates
>>     iso8601.py 0.1dev     Parse utilities for iso8601 encoding.
>>     iso8601plus 0.1.6     Simple module to parse ISO 8601 dates
>>     zc.iso8601 0.2.0     ISO 8601 utility functions
> 
> 
> Here are three more on PyPI you can try:
> 
> iso-8601 0.2.3           Flexible ISO 8601 parser...
> PySO8601 0.1.7       PySO8601 aims to parse any ISO 8601 date...
> isodate 0.4.8            An ISO 8601 date/time/duration parser and formater
> 
> All three have been updated this year.

   There's another one inside feedparser, and there used to be
one in the xml module.

   Filed issue 15873: "datetime" cannot parse ISO 8601 dates and times
	http://bugs.python.org/issue15873

   This really should be handled in the standard library, instead of
everybody rolling their own, badly.  Especially since in Python 3.x,
there's finally a useful "tzinfo" subclass for fixed time zone
offsets.  That provides a way to directly represent ISO 8601 date/time
strings with offsets as "time zone aware" date time objects.

				John Nagle



More information about the Python-list mailing list