Skip to content
Lightweight task scheduler using cron expressions
Find file
Latest commit d0dc3ea @ahawker Merge pull request #7 from aisipos/patch-1
README: fix how to start, now calls run()


Build Status Coverage Status

crython is a lightweight task (function) scheduler using cron expressions written in python.


This module is currently under development.


To install crython from pip:

    $ pip install crython

To install crython from source:

    $ git clone
    $ python install


Crython supports seven fields (seconds, minutes, hours, day of month, month, weekday, year).

Call a function once a minute:

    import crython

    #Fire once a minute.
    def foo():
        print "... while heavy sack beatings are up a shocking nine hundred percent? - Kent Brockman"

Call a function every ten seconds:

    #Fire every 10 seconds.
    def foo():
        print "I'm a big four-eyed lame-o and I wear the same stupid sweater every day. - Homer's Brain"

Call a function with a single cron expression:

    #Fire every 10 seconds.
    def foo():
        print "Hail to the thee Kamp Krusty... - Kampers"

Call a function with a full cron expression:

    #Fire once a week.
    @crython.job(expr='0 0 0 * * 0 *')
    def foo():
        print "Back in line, maggot! - Kearny"

Call a function with positional and/or keyword arguments:

    #Fire every second.
    @job('safety gloves', second='*', name='Homer Simpson')
    def foo(item, name):
        print "Well, I don't need {0}, because I'm {1}. -- Grimey".format(item, name)

Call a function using predefined keywords:

    #Fire once a day.
    def foo():
        print "That's where I saw the leprechaun. He tells me to burn things! - Ralph Wiggum"
    #Fire once immediately after scheduler starts.
    def foo():
        print "I call the big one bitey. - Homer Simpson"

Call a function and run it within a separate process:

    #Fire every hour.
    @crython.job(expr='@hourly', ctx='process')
    def foo():
        print "No, no, dig up stupid. - Chief Wiggum"

Start the global job scheduler:

    if __name__ == '__main__':


Entry Description Equivalent To
@yearly/@annually Run once a year at midnight in the morning of January 1 0 0 0 0 1 1 *
@monthly Run once a month at midnight in the morning of the first of the month 0 0 0 0 1 * *
@weekly Run once a week at midnight in the morning of Sunday 0 0 0 0 * 0 *
@daily Run once a day at midnight 0 0 0 * * * *
@hourly Run once an hour at the beginning of the hour 0 0 * * * * *
@minutely Run once a minute at the beginning of the minute 0 * * * * * *
@reboot Run once at startup @reboot


  • Support "L", "W" and "#" specials.
  • Determine time delta from now -> next time expression is valid.


If you would like to contribute, simply fork the repository, push your changes and send a pull request.


Crython is available under the MIT license.

See Other

There are similar python cron libraries out there. See: pycron, python-crontab, cronex.

Something went wrong with that request. Please try again.