Convert fuzzy date to a datetime object.
Project description
Convert from fuzzy dates like “yesterday”, “next wed”, “Jan 4”, etc., to a datetime object.
This is useful for processing command line arguments:
>>> from optparse import OptionParser >>> import magicdate >>> parser = OptionParser(option_class=magicdate.MagicDateOption) >>> parser.add_option('-s', '--start', dest='start', type='magicdate', default=None) >>> parser.add_option('-e', '--end', dest='end', type='magicdate', default='today')
Now you can pass options like “today”, “1996-01-01”, etc., to your program.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
magicdate-0.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
magicdate-0.1-py2.4.egg
(4.8 kB
view hashes)