Skip to main content

Very flexible date parsing and normalization utilities

Project description

Date parsing and normalization utilities based on FlexiDate.

To parse dates use parse, e.g.:

from flexidate import parse
parse('1890') -> FlexiDate(year=u'1890')
parse('1890?') -> FlexiDate(year=u'1890', qualifier='Uncertainty: 1890?')

Once you have a FlexiDate you can get access to attributes (strings of course …):

from flexidate import parse
fd = parse('Jan 1890')
fd.year # u'1890'
fd.month # u'01'

Note how all fields are retained as strings – this is the only way to not lose information.

However, it’s easy to convert to other forms:

fd.as_float() # 1890
fd.as_datetime() # datetime(1890,01,01)


FlexiDate is focused on supporting:

  1. Dates outside of Python (or DB) supported period (esp. dates < 0 AD)
  2. Imprecise dates (c.1860, 18??, fl. 1534, etc)
  3. Normalization of dates to machine processable versions
  4. Sortable in the database (in correct date order)

Flexidate builds on the excellent dateutil though it can be used without it.

For more information see:


Tests can be found in

Patches are welcome - please include additional tests where relevant.

Project details

Release history Release notifications

This version
History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
flexidate-1.0.tar.gz (4.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page