annual.decorators
Decorators for date functions.
This module implements decorators for registering functions at a central registry of functions computing a single date per year and of generators computing a list of events for a given year.
Attributes
Functions
|
Mark a date function to be made available in the parser. |
Module Contents
- annual.decorators.DateFunction: TypeAlias = Callable[[int], MaybeDate]
- annual.decorators.DateIterator: TypeAlias = Callable[[int], Iterator[tuple[str, MaybeDate]]]
- annual.decorators.date_function(name: str | None = None) Callable[[DateFunction], DateFunction]
Mark a date function to be made available in the parser.
The function name is used in the registry if no name is passed explicitly.
- Parameters:
name (str | None) – the name to be used in the registry (optional)
- Returns:
the actual decortor
- Return type:
Callable[[DateFunction], DateFunction]