In the same vein check out Arrow for a big improvement over Pythons standard time/date libraries. As a bonus it also generates human readable dates (though I don't think it parses them like this lib):
http://crsmithdev.com/arrow/
arrow.parser.ParserError: Could not match input to any of
['YYYY-MM-DD', 'YYYY-MM', 'YYYY'] on '01-06-17'
Here's a list of (US English–centric) test dates that dateparser ((ddp.get_date_data(date)['date_obj']).date()) and delorean (delorean.parse(date, dayfirst=False, yearfirst=False).date) both parse correctly, nearly all of which arrow fails on: 01-06-2017
01-06-17
2017-01-06
01/06/2017
01/06/17
2017/01/06
Jan 6, 2017
Jan 6 2017
2017, Jan 6
2017 Jan 6
2017, January 6
2017 January 6
January 6, 2017
January 6 2017
January 6nd, 2017
January 6rd, 2017
January 6st, 2017
January 6th, 2017
January 6nd 2017
January 6rd 2017
January 6st 2017
January 6th 2017
2017, January 6nd
2017, January 6rd
2017, January 6st
2017, January 6th
2017 January 6nd
2017 January 6rd
2017 January 6st
2017 January 6th
01//06/2017
01//06//2017
01--06-2017
01--06--2017
01/06-2017
01-06/2017
I like Delorean's API better than arrow's (strictly personal preference) but think dateparser's language detection is interesting.[1] http://delorean.readthedocs.org/en/latest/quickstart.html
What's the correct parsing of that date? Is it 2001 or 2017 or 1917 or ... is it June or January ...?
https://github.com/codygman/git-date-haskell
Had to do a small bugfix from bitrot, but this is a nice package that wraps the git date handling code which the author claims[0] was the only sane implementation he could find.
0: http://stackoverflow.com/questions/9831956/parsing-fuzzy-dat...