by_weekday_expr = 'by weekday' + OneOrMore(weekday_expr).setResultsName(
    'weekdays')
by_month_expr = 'by month' + OneOrMore(month_expr).setResultsName('months')
recurring_interval = frequency_expr + range_expr + (by_weekday_expr &
    by_month_expr)
if __name__ == '__main__':
    res = recurring_interval.parseString(
        'Daily from 1111-11-11 11:00:00 till 1111-11-11 12:00:00 by weekday Monday by month January February'
        )
print(res)
print(res.from_)
print(res.till)
print(res.weekdays)
print(res.months)
In Python, how to parse a string representing a set of keyword arguments such that the order does not matter