因支持cron_描述符而退役。(将crontab表达式转换为人类可读的描述)。
pretty-cron的Python项目详细描述
已失效支持cron_descriptor
此项目不再维护。
将crontab表达式转换为人类可读的描述。
安装
使用pip:
pip install pretty-cron
在Python2.7和3.6上测试。
API
prettify_cron(cron_expression)
将给定的字符串cron表达式转换为美观的、可读的, 它的意思的英文描述。如果字符串不是有效的cron 表达式,或者它包含当前不支持的功能,则返回 照原样。
例如:
>>>importpretty_cron>>>pretty_cron.prettify_cron("0 * * * *")"At 0 minutes past every hour of every day">>>pretty_cron.prettify_cron("0 0 1 1 *")"At 00:00 on the 1st of January">>>pretty_cron.prettify_cron("12 15 * 1 *")"At 15:12 every day in January">>>pretty_cron.prettify_cron("lalala")# Not a cron expression"lalala"
历史
1.2.0(2018-08-22)
- 已失效而赞成cron_descriptor。此项目不再维护。
1.1.0(2018-08-19)
- 为了保持一致性,现在总是在python 2上返回unicode。
1.0.2(2016-05-03)
- 现在支持多个工作日和正常工作日的表达式-谢谢 @吉邦迪亚。
1.0.1(2016-02-09)
- 现在将第7天解释为周日和0,就像linux crontab解析器一样- 谢谢@vetyy。
- 现在支持用逗号分隔的多个月的表达式-谢谢 @梅雷姆。
1.0.0(2015-07-28)
- pypi上的第一个版本,具有prettify_cron函数。