Przejdź do treści

Date range parser in Python.

Details

Status Beta
Language Python
License 3-clause BSD
Role Maintainer

This is a minimalistic (and slightly hacky) parser for date range conditionals.

Supported format:

  • comma-separated clauses (AND)
  • clause: attribute comparison_operator value (spaces optional)
    • attribute: year, month, day, hour, month, second, weekday, isoweekday or empty for full datetime
    • comparison_operator: == != <= >= < >
    • value: integer, 'now' or dateutil-compatible date input

For example, you can state year == 2016, month > 06, day >= 07 which matches dates between July and December 2016, but ignoring days 1-6 of each month.