FilterByDate#

class FilterByDate(user_func, default_date=None, **kwargs)#

Bases: Filter

Manage a filter for the date.

The user function will receive a date recovered from the matches.

Parameters:
get_filter_func()#

Return filter function.

Wrap so the partial function is applied on a date recovered on matches, with the default elements from default_date.

Return type:

Callable[[Finder, str, Matches], bool]

default_date: datetime | Mapping[str, int] | None = None#

Default date elements to use when recovering date.

partial_func: Callable[[date], bool]#

Function with kwargs stored.

user_func: UserFuncDate#

Initial function given by the user.