Skip to main content

crontab_parser

Parser for Crontab expressions.

Attributes

AttributeTypeDescription
ParseExceptiontype = ParseExceptionReference to the exception class raised when the crontab expression fails to parse correctly.

Constructor

Signature

def crontab_parser(
max_: int = 60,
min_: int = 0
)

Parameters

NameTypeDescription
max_int = 60The maximum number of units in the range (e.g., 60 for minutes, 24 for hours).
min_int = 0The minimum starting value for the range (e.g., 0 for minutes, 1 for months).

Signature

def crontab_parser(
max_: int = 60,
min_: int = 0
) - > null

Parameters

NameTypeDescription
max_int = 60The total number of units in the range (e.g., 60 for minutes, 24 for hours).
min_int = 0The starting value of the range, typically 0 or 1.

Methods


parse()

@classmethod
def parse(
spec: str
) - > set[int]

Parses a full crontab expression string and expands it into a set of integers.

Parameters

NameTypeDescription
specstrThe crontab expression string to parse, such as '*/15' or '1,3-5'.

Returns

TypeDescription
set[int]A set of unique integers representing the expanded time units.