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.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

magicdate-0.1.1-py2.5.egg (5.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for magicdate-0.1.1.tar.gz
Algorithm Hash digest
SHA256 432fc5e10f1b2f79311a246992e9670d353b13895cadea76ed1901a0d9c8a271
MD5 1de60c0adcd04810b686dc8f2621295e
BLAKE2b-256 c9ad926acc02f0d98aed728b1225dc2ddc9b200d1783b2558c4eaab9d12ba5fa

See more details on using hashes here.

Provenance

File details

Details for the file magicdate-0.1.1-py2.5.egg.

File metadata

File hashes

Hashes for magicdate-0.1.1-py2.5.egg
Algorithm Hash digest
SHA256 6331ead65989a34357ef5331d4910bd3ef8425e736262524c960abc179043905
MD5 eb2e5f07f57b86f4186cd086b7320432
BLAKE2b-256 f518de285919c9221382608dea638ac5fc95933df50448cb52ea848233097d53

See more details on using hashes here.

Provenance

Supported by

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