-
A simple cron expression parser written in python that translates cron expression and send output in table format.
-
validates cron expression and able to handle errors.
-
Handles setp values(
/), range values(-) and comma(,) separated values. -
It accepts string input which has following five paramters
- minute
- hour
- day of month
- month
- day of week
- command
- create project
- create setup.py
- run
python3 setup.py sdist bdist_wheel - it will create dist folder in ur code folder incusing wheel files
- register and create account on pypi library
- run
twine upload dist/*
- Python >=3.12
pipenv
follow these steps, to use this program:
-
Open a terminal or command prompt in the root folder.
-
Install all dependencies and active the virtual environment:
pip3 install pipenv pipenv install pipenv install -r requirements.txt pipenv shell pipenv install pytest
-
Install the package as a binary name
cron-parser.pip3 install --editable . -
Run the program with a cron expression as an argument. For example:
cron-parser "<expression>"expression should be including minutes, hours, day of month, months, day of week and command
Example :
"*/10 0 2,12 * 2-6 /usr/bin/find" -
The program will output the formatted cron expression as a table, like this:
minute 0 10 20 30 40 50 hour 0 day of month 2 12 month 1 2 3 4 5 6 7 8 9 10 11 12 day of week 2 3 4 5 6 command /usr/bin/find -
To run the tests , run following command:
pytest
-
-
-
-
- /usr/bin/find -v foo
-
-
-