Skip to main content

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magicdate-0.1-py2.4.egg (4.8 kB view details)

Uploaded Egg

File details

Details for the file magicdate-0.1.tar.gz.

File metadata

  • Download URL: magicdate-0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for magicdate-0.1.tar.gz
Algorithm Hash digest
SHA256 f8b17106ec18aa1eec631264415ecda90abc4d99db948af07179f79913ab5cff
MD5 fc25b2efbf98646717986ad40297eae6
BLAKE2b-256 29bd4f8e1a918072018f2b3cab28e8b7b6780d556a0b9de6e80e84986e1b07e7

See more details on using hashes here.

File details

Details for the file magicdate-0.1-py2.4.egg.

File metadata

  • Download URL: magicdate-0.1-py2.4.egg
  • Upload date:
  • Size: 4.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for magicdate-0.1-py2.4.egg
Algorithm Hash digest
SHA256 d7a667704ecf51e7fe95f582799794baba7c15c4b79ac823a7b17221c0eb37d2
MD5 03bfd45e73e7953ff15563abcaaa0871
BLAKE2b-256 9c228b2e762902866fa937c5e895d6c26288914cef2bebfcebb2c37cba842566

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page