All Projects → ahawker → Crython

ahawker / Crython

Licence: other
Lightweight task scheduler using cron expressions

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Crython

Deno cron
A cron Job scheduler for Deno that allows you to write human readable cron syntax with tons of flexibility
Stars: ✭ 35 (-82.23%)
Mutual labels:  scheduler, cron
Rufus Scheduler
scheduler for Ruby (at, in, cron and every jobs)
Stars: ✭ 2,223 (+1028.43%)
Mutual labels:  scheduler, cron
Cronicle
A simple, distributed task scheduler and runner with a web based UI.
Stars: ✭ 979 (+396.95%)
Mutual labels:  scheduler, cron
Scheduler
Task scheduler for Golang
Stars: ✭ 171 (-13.2%)
Mutual labels:  scheduler, cron
Go Quartz
Simple, zero-dependency scheduling library for Go
Stars: ✭ 118 (-40.1%)
Mutual labels:  scheduler, cron
Bree
🚥 The best job scheduler for Node.js and JavaScript with cron, dates, ms, later, and human-friendly support. Works in Node v10+ and browsers, uses workers to spawn sandboxed processes, and supports async/await, retries, throttling, concurrency, and graceful shutdown. Simple, fast, and lightweight. Made for @ForwardEmail and @ladjs.
Stars: ✭ 933 (+373.6%)
Mutual labels:  scheduler, cron
Tiktok
Python web visualize build on the awesome web framework sanic
Stars: ✭ 55 (-72.08%)
Mutual labels:  scheduler, cron
Gocron
定时任务管理系统
Stars: ✭ 4,198 (+2030.96%)
Mutual labels:  scheduler, cron
Cronscheduler.aspnetcore
Cron Scheduler for AspNetCore 2.x/3.x or DotNetCore 2.x/3.x Self-hosted
Stars: ✭ 100 (-49.24%)
Mutual labels:  scheduler, cron
Ddns Route53
Dynamic DNS for Amazon Route 53 on a time-based schedule
Stars: ✭ 98 (-50.25%)
Mutual labels:  scheduler, cron
Crono
A time-based background job scheduler daemon (just like Cron) for Rails
Stars: ✭ 637 (+223.35%)
Mutual labels:  scheduler, cron
Quantum Core
⌚ Cron-like job scheduler for Elixir
Stars: ✭ 1,905 (+867.01%)
Mutual labels:  scheduler, cron
Gocron
Easy and fluent Go cron scheduling. This is a fork from https://github.com/jasonlvhit/gocron
Stars: ✭ 605 (+207.11%)
Mutual labels:  scheduler, cron
Geoip Updater
Download and update MaxMind's GeoIP2 databases on a time-based schedule
Stars: ✭ 29 (-85.28%)
Mutual labels:  scheduler, cron
Quartznet
Quartz Enterprise Scheduler .NET
Stars: ✭ 4,825 (+2349.24%)
Mutual labels:  scheduler, cron
Pg cron
Run periodic jobs in PostgreSQL
Stars: ✭ 1,002 (+408.63%)
Mutual labels:  scheduler, cron
php-cron-expr
Ultra lightweight, Dependency free and Super Fast Cron Expression parser for PHP
Stars: ✭ 42 (-78.68%)
Mutual labels:  cron, scheduler
josk
🏃🤖 Scheduler and manager for jobs and tasks in node.js on multi-server and clusters setup
Stars: ✭ 27 (-86.29%)
Mutual labels:  cron, scheduler
Sidekiq Scheduler
Lightweight job scheduler extension for Sidekiq
Stars: ✭ 1,198 (+508.12%)
Mutual labels:  scheduler, cron
Simple scheduler
An enhancement for Heroku Scheduler + Sidekiq for scheduling jobs at specific times.
Stars: ✭ 127 (-35.53%)
Mutual labels:  scheduler, cron

crython

Join the chat at https://gitter.im/crython/Lobby

Build Status Build status codecov Code Climate Issue Count

PyPI version PyPI versions

Stories in Ready

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

Status

This module is actively maintained.

Installation

To install crython from pip:

    $ pip install crython

To install crython from source:

    $ git clone [email protected]:ahawker/crython.git
    $ python setup.py install

Usage

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.
    @crython.job(second=0)
    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.
    @crython.job(second=range(0, 60, 10))
    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.
    @crython.job(second='*/10')
    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.
    @crython.job(expr='@daily')
    def foo():
        print "That's where I saw the leprechaun. He tells me to burn things! - Ralph Wiggum"
    # Fire once immediately after scheduler starts.
    @crython.job(expr='@reboot')
    def foo():
        print "I call the big one bitey. - Homer Simpson"

Call a function and run it within a separate thread (default behaviour if ctx is not specified):

    # Fire once a week.
    @crython.job(expr='@weekly', ctx='thread')
    def foo():
        print "No, no, dig up stupid. - Chief Wiggum"

Call a function and run it within a separate process:

    # Fire every hour.
    @crython.job(expr='@hourly', ctx='multiprocess')
    def foo():
        print "Eat my shorts. - Bart Simpson"

Start the global job scheduler:

    if __name__ == '__main__':
        crython.start()
        crython.join()  ## This will block

Stop the global job scheduler:

    crython.stop()
    crython.join(timeout=5000)  ## This will block 5s waiting for thread to stop.

Keywords

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

TODO

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

Contributing

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

License

Crython is available under the MIT license.

See Other

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].