2 from typing import Any, Iterator, Text, Tuple, Type, TypeVar, Union
3 from typing_extensions import Literal
5 _RetType = Union[Type[float], Type[datetime.datetime]]
6 _SelfT = TypeVar("_SelfT", bound=croniter)
8 class CroniterError(ValueError): ...
9 class CroniterBadCronError(CroniterError): ...
10 class CroniterBadDateError(CroniterError): ...
11 class CroniterNotAlphaError(CroniterError): ...
13 class croniter(Iterator[Any]):
14 MONTHS_IN_YEAR: Literal[12]
15 RANGES: Tuple[tuple[int, int], ...]
30 ALPHACONV: Tuple[dict[str, Any], ...]
31 LOWMAP: Tuple[dict[int, Any], ...]
32 LEN_MEANS_ALL: Tuple[int, ...]
34 tzinfo: datetime.tzinfo | None
36 expanded: list[list[str]]
39 nth_weekday_of_month: dict[str, Any]
43 start_time: float | datetime.datetime | None = ...,
44 ret_type: _RetType | None = ...,
46 max_years_between_matches: int | None = ...,
48 hash_id: str | bytes | None = ..., # unicode not accepted on python 2
50 # Most return value depend on ret_type, which can be passed in both as a method argument and as
51 # a constructor argument.
52 def get_next(self, ret_type: _RetType | None = ..., start_time: float | datetime.datetime | None = ...) -> Any: ...
53 def get_prev(self, ret_type: _RetType | None = ...) -> Any: ...
54 def get_current(self, ret_type: _RetType | None = ...) -> Any: ...
55 def set_current(self, start_time: float | datetime.datetime) -> float: ...
56 def __iter__(self: _SelfT) -> _SelfT: ...
57 def __next__(self, ret_type: _RetType | None = ...) -> Any: ...
58 def next(self, ret_type: _RetType | None = ...) -> Any: ...
59 def all_next(self, ret_type: _RetType | None = ...) -> Iterator[Any]: ...
60 def all_prev(self, ret_type: _RetType | None = ...) -> Iterator[Any]: ...
61 def iter(self, ret_type: _RetType | None = ...) -> Iterator[Any]: ...
62 def is_leap(self, year: int) -> bool: ...
64 def expand(cls, expr_format: Text, hash_id: str | bytes | None = ...) -> tuple[list[list[str]], dict[str, Any]]: ...
66 def is_valid(cls, expression: Text, hash_id: str | bytes | None = ...) -> bool: ...
68 def match(cls, cron_expression: Text, testdate: float | datetime.datetime | None, day_or: bool = ...) -> bool: ...
71 start: float | datetime.datetime,
72 stop: float | datetime.datetime,
74 ret_type: _RetType | None = ...,
76 exclude_ends: bool = ...,
77 _croniter: Type[croniter] | None = ...,
78 ) -> Iterator[Any]: ...