Package: cronexpr-translator
cronexpr-translatorThe python translator for cron expressionscronexpr-translatorgets a cron expression in a string format and returns a string in the following format with the
description of every field in the given cron expression.** The translator leveragescronexpr-validatorto validate the given cron expressions.If an invalid cron expression is provided, the translator will returnCRON EXPRESSION IS NOT VALIDmessage,
but will not raise an error.If one of the subexpressions is not translated by any reason, the translator will returnCOULD NOT TRANSLATE SUBEXPRESSIONin the subexpression description, and will not raise an error.In summary, any raised errors by the application are not expected, and must be reported as a bug.second -> seconds descriptionminute -> minutes descriptionhour -> hours descriptionday of month -> days of month descriptionmonth -> month descriptionday of week -> days of week descriptionyear -> years descriptionUsage examplefromcronexpr-translator.translatorimportTranslatorcron_expression_sample="* * * * * *"translated_cron_expression=Translator.translate_expression(cron_expression_sample)The output of the code snippet showed above, will be something like:second -> seconds description
minute -> minutes description
hour -> hours description
day of month -> days of month description
month -> month description
day of week -> days of week description
year -> years descriptionBelow you can find the description rules for every field of the cron expression.** The connectors from the list expression types are for range values within the list. List values are separated by a comma.SECONDSExpression TypePrefixSuffixConnectorIterator prefixIterator suffixStart value prefixStart value suffixSTAR [ * ]everysecondNoneNoneNoneNoneNoneVALUE [ACTUAL VALUE]at secondNoneNoneNoneNoneNoneNoneSLASH [ / ]NoneNoneNoneeverysecondsstarting at secondpast the minuteRANGE [ - ]secondspast the minutethroughNoneNoneNoneNoneLIST [ , ]atseconds past the minutethroughNoneNoneNoneNoneMINUTESExpression TypePrefixSuffixConnectorIterator prefixIterator suffixStart value prefixStart value suffixSTAR [ * ]everyminuteNoneNoneNoneNoneNoneVALUE [ACTUAL VALUE]at minuteNoneNoneNoneNoneNoneNoneSLASH [ / ]NoneNoneNoneeveryminutesstarting at minutepast the hourRANGE [ - ]minutespast the hourthroughNoneNoneNoneNoneLIST [ , ]atminutes past the hourthroughNoneNoneNoneNoneHOURSExpression TypePrefixSuffixConnectorIterator prefixIterator suffixStart value prefixStart value suffixSTAR [ * ]everyhourNoneNoneNoneNoneNoneVALUE [ACTUAL VALUE]atNoneNoneNoneNoneNoneNoneSLASH [ / ]NoneNoneNoneeveryhoursstarting atNoneRANGE [ - ]betweenNoneandNoneNoneNoneNoneLIST [ , ]atNoneandNoneNoneNoneNoneDAY OF MONTHExpression TypePrefixSuffixConnectorIterator prefixIterator suffixStart value prefixStart value suffixSTAR [ * ]everydayNoneNoneNoneNoneNoneVALUE [ACTUAL VALUE]on dayof the monthNoneNoneNoneNoneNoneSLASH [ / ]NoneNoneNoneeverydaysstarting on dayof the monthRANGE [ - ]between dayof the monthandNoneNoneNoneNoneLIST [ , ]on dayof the monththroughNoneNoneNoneNoneDay of month also allows L and W characters, with special rules:last day expression[L]-> on the last day of the monthfirst week day expression[1W]-> first week day of the monthweek day expression[_DIGIT_W or W_DIGIT_]-> on the week day nearest dayDIGITof the monthlast week day expression[LW or WL]-> on the last week day of the monthMONTHExpression TypePrefixSuffixConnectorIterator prefixIterator suffixStart value prefixStart value suffixSTAR [ * ]everymonthNoneNoneNoneNoneNoneVALUE [ACTUAL VALUE]only inNoneNoneNoneNoneNoneNoneSLASH [ / ]NoneNoneNoneeverymonthsNonethrough decemberRANGE [ - ]NoneNonethroughNoneNoneNoneNoneLIST [ , ]only inNonethroughNoneNoneNoneNoneDAY OF WEEKExpression TypePrefixSuffixConnectorIterator prefixIterator suffixStart value prefixStart value suffixSTAR [ * ]everyday of the weekNoneNoneNoneNoneNoneVALUE [ACTUAL VALUE]only onNoneNoneNoneNoneNoneNoneSLASH [ / ]NoneNoneNoneeverydays of the weekNonethrough saturdayRANGE [ - ]NoneNonethroughNoneNoneNoneNoneLIST [ , ]only onNonethroughNoneNoneNoneNoneDay of week also allows the L character, with special rules:last day expression[_DIGIT_L or L_DIGIT_]-> on the lastDIGITof the monthlast day expression[L]-> only in saturdayYEARExpression TypePrefixSuffixConnectorIterator prefixIterator suffixStart value prefixStart value suffixSTAR [ * ]everyyearNoneNoneNoneNoneNoneVALUE [ACTUAL VALUE]only inNoneNoneNoneNoneNoneNoneSLASH [ / ]NoneNoneNoneeveryyearsNonethrough 2099RANGE [ - ]NoneNonethroughNoneNoneNoneNoneLIST [ , ]only inNonethroughNoneNoneNoneNone