skip to navigation
skip to content

PySO8601 0.2.0

PySO8601 aims to parse any ISO 8601 date, including Week dates, Ordinal dates, intervals and durations.

Package Documentation

PySO8601 aims to be a better Python module to parse ISO 8601 dates. It is inspired by the iso8601 currently available in the pypi repository, however this module is designed to accept any valid ISO8601 formatted string:

Truncated representations (YYYYMM, YYMMDD, hhmmss, etc) are also accepted.


import PySO8601
spam = PySO8601.parse('2011-01-01T14:32')
print spam # prints: 2011-01-01 14:32:00
eggs = PySO8601.parse('2010W052') # Week 5, day 2
print eggs # prints: 2010-02-01 00:00:00

For full examples on usage please review the specs in the source.


Python 3:
PySO8601 is now compatible with Python 2.6, 2.7, and >= 3.3.
parse_duration, when only provided a duration string, will assume 365 days in a year and 30 days in a month, due to the difficult nature of working with calendars. However, passing a start or end timestamp will provide the correct calculation based on that date.
File Type Py Version Uploaded on Size
PySO8601-0.2.0.tar.gz (md5) Source 2015-12-08 7KB