Skip to content

alexprengere/fuzzydates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FuzzyDates

Fuzzy datetime reading.

Examples

Import the main function:

>>> from fuzzy_dates import load_date

Examples of fuzzy reading:

>>> load_date('-0600', '[-+]%H%M')
datetime.datetime(1900, 1, 1, 6, 0)
>>> load_date('2010/01:02', '%Y[/:]%M[/:]%d')
datetime.datetime(2010, 1, 2, 0, 1)
>>> load_date('2010/01:02', '%Y[/:]%M/%d')
Traceback (most recent call last):
ValueError: Could not match regexp

Examples of fuzzy reading for timedelta:

>>> load_date('-0600', '[-+]%H%M', delta=True)
datetime.timedelta(0, 21600)

About

Fuzzy interpretation of dates.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages