Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install magicdate

How to install magicdate

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install magicdate
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1.3 Available View build log
Windows (64-bit)
0.1.3 Available View build log
Mac OS X (10.5+)
0.1.3 Available View build log
Linux (32-bit)
0.1.3 Available View build log
Linux (64-bit)
0.1.3 Available View build log
 
License
MIT
Depended by
Imports
Lastest release
version 0.1.3 on Jan 5th, 2011

Convert from fuzzy dates like "yesterday", "2 weeks and 1 day ago", "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.

Inspired by Simon Willison's dateparse.js.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.