tron.utils.crontab module¶
Parse a crontab entry and return a dictionary.
- class tron.utils.crontab.FieldParser¶
Bases:
objectParse and validate a field in a crontab entry.
- bounds: tuple[int, int] = (0, 0)¶
- get_groups(source: str) list[str]¶
- get_match_groups(source: str) dict¶
- get_range(min_value: int, max_value: int, step: int) list[int | str]¶
- get_value_range(match_groups: dict) tuple[int, int]¶
- get_values(source: str) list[int | str]¶
- name: str = ''¶
- normalize(source: str) str¶
- parse(source: str) list[int] | list[int | str] | None¶
- range_pattern = re.compile('\n (?P<min>\\d+|\\*) # Initial value\n (?:-(?P<max>\\d+))? # Optional max upper bound\n (?:/(?P<step>\\d+))? # Optional step increment\n ', re.VERBOSE)¶
- validate_bounds(value: str) int¶
- class tron.utils.crontab.HourFieldParser¶
Bases:
FieldParser- bounds: tuple[int, int] = (0, 24)¶
- name: str = 'hours'¶
- class tron.utils.crontab.MinuteFieldParser¶
Bases:
FieldParser- bounds: tuple[int, int] = (0, 60)¶
- name: str = 'minutes'¶
- class tron.utils.crontab.MonthFieldParser¶
Bases:
FieldParser- bounds: tuple[int, int] = (1, 13)¶
- month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']¶
- name: str = 'months'¶
- normalize(month: str) str¶
- class tron.utils.crontab.MonthdayFieldParser¶
Bases:
FieldParser- bounds: tuple[int, int] = (1, 32)¶
- get_values(source: str) list[int | str]¶
- name: str = 'monthdays'¶
- class tron.utils.crontab.WeekdayFieldParser¶
Bases:
FieldParser- bounds: tuple[int, int] = (0, 7)¶
- day_names = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']¶
- name: str = 'weekdays'¶
- normalize(day_of_week: str) str¶
- tron.utils.crontab.convert_predefined(line: str) str¶
- tron.utils.crontab.parse_crontab(line: str) dict¶