Package: cronpi
cronpiA small tool for deploying crontab jobs into a unix-like system, eg. Linux/Mac from python.cronpi makes jobs morehuman readableand works on both 2.X and 3.X version.InstallationpipinstallcronpiUsagecronpi has following functionsSNNameDescription1.run_by_datejob that runs just by setting date in format YYYY-MM-DD HH:mm2.run_every_dayjob that runs every day at given time HH:mm3.run_every_weekjob that runs every week at the given time of given weekdays4.run_every_monthjob that runs every month at the given time of given days of a month5.run_every_yearjob that runs  at the given time of given days of given months6.run_customcommand will be exactly similar to single line which we write during "crontab -e"Each functions take two parameters<command to execute>, <isOverwrite=bool>?parametertypedescriptioncommandstringThis command will be executed as scheduledisOverwriteboolIt is optional and default value is false, which means cronpi will always insert new jobcronpi will always install a new cron job if only command is passed as parameter or isOverwrite is set to False.
If command passed as first parameter already exists in cronjon and "isOverwrite=True" is passed as second parameter ,then it will update the time of running the job instead of adding new job.cronpi.XXXX("/some/command",isOverwrite=True)Time used as parameter can contain or may not contain AM|PM prefix.
For eg, following two parameters represent same time.5:30pm = 17:30Use Case 1 - Run By DateRun a job at 20th october 2020 at 5:30PMimportcronpicronpi.run_by_date("/some/command").on("2020-10-20 5:30pm")※ This command will run every year after if the command is not deleted from crontab manually.Use Case 2 - Run every dayRun a job daily at 5:30PMimportcronpicronpi.run_every_day("/some/command").on("5:30pm")Use Case 3 - Run every weekRun a job at every sunday at 5:30PMimportcronpicronpi.run_every_week("/some/command").on("sunday",time="17:30")Run a job at every saturday and sunday at 5:30PMimportcronpicronpi.run_every_week("/some/command").on(["sat","sun"],time="5:30PM")Use Case 4 - Run every monthRun a job at every 10th of a month at 5:30PMimportcronpicronpi.run_every_month("/some/command").on(10,time="17:30")Run a job at every 10th and 20th of a month at 5:30PMimportcronpicronpi.run_every_month("/some/command").on([10,20],time="17:30")Use Case 5 - Run every yearRun a job at every 10th january at 5:30amimportcronpicronpi.run_every_year("/some/command").on("january",day=10,time="5:30am")Run a job at every 10th of january, april and october at 5:30AMimportcronpicronpi.run_every_year("/some/command").on(["jan","oct"],day=10,time="5:30")Use Case 6 - run like crontabAdd a job to crontab by passing the command that we input to "crontab -e" command.Run a job that runs at every minuteimportcronpicronpi.run_custom("* * * * * /some/command")# ┌───────────── minute (0 - 59)# │ ┌───────────── hour (0 - 23)# │ │ ┌───────────── day of the month (1 - 31)# │ │ │ ┌───────────── month (1 - 12)# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;# │ │ │ │ │                                   7 is also Sunday on some systems)# │ │ │ │ │# │ │ │ │ │# * * * * * command to executHelper Function - Get list of current jobscronpi has a helper function named "get_job_list" which will retrive the the job items in list.importcronpicronpi.get_job_list()Release informationNov 12th, 2019 (ver@2.0.0)restructured the library format so that it is more human readable.cronpi.run_every_month("/some/command").on([10,20],time="1:30AM")Nov 7th, 2019 (ver@1.0.0)released first version