Converts crontab expressions to human-readable descriptions.
Project description
Converts crontab expressions to human-readable descriptions.
Installation
Use pip:
pip install pretty-cron
Tested on Python 2.7, 3.4, 3.5, and PyPy (Python 2).
API
prettify_cron(cron_expression)
Converts the given string cron expression into a pretty, human-readable, English description of what it means. If the string is not a valid cron expression, or it includes features not currently supported, it is returned as-is.
For example:
>>> import pretty_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"
History
Pending Release
New release notes here
1.0.1 (2016-02-09)
Now interprets day 7 as Sunday as well as 0, like Linux crontab parsers - thanks @vetyy.
Now supports expressions with multiple months separated by commas - thanks @MerreM.
1.0.0 (2015-07-28)
First release on PyPI, featuring prettify_cron function.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pretty_cron-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1be1d0378df5c76227471d5be470893cb40dee3ad6b508e0a5e702824ec0f80 |
|
MD5 | 4550046bd9a509e400ddac072b91acf0 |
|
BLAKE2b-256 | 86b1bfb1e29864e19d75a373b9dbb9a4ddbdb6fc919f6d00774848c4f1cfd3f7 |