cf.year

cf.year(value)[source]

A Query object for a “year” condition.

Parameter:
value:

The query condition’s value. If value is a sequence then it is automatically converted to a “member of set” condition for the values, e.g. [1959, 1961] is equivalent to cf.set([1959, 1961]).

Returns:
Query

The query object.

Examples

>>> d = cf.dt(2002, 6, 16)
>>> d == cf.year(2002)
True
>>> d == cf.year(cf.le(2003))
True
>>> d == cf.year(2001)
False
>>> d == cf.year(cf.wi(2003, 2006))
False
>>> d == cf.year([2002, 2006])
True
>>> d == cf.year(cf.set([2002, 2006]))
True