Tishka17 / clepsydra

Liquid scheduler for python
Apache License 2.0
17 stars 2 forks source link
cron python python3 scheduler

Intro

Clepsydra is a mini framework for task scheduling

All parts are designed to be replaceable.

Main ideas are:

Currently project is in the design stage and any APIs are to be changed

How to use:

Create scheduler (this step will be customizable). If your task functions as synchronous, pass param sync_executor=True

from clepsydra import create_scheduler

scheduler = create_scheduler() 

Register functions that can be scheduled (custom name can be provided for compatibility)

scheduler.task(some_func)

Add some job using function name. For example single run:

from clepsydra import SingleRun

job_id = await scheduler.add_job("some_func", rule=SingleRun(when=datetime.now()))

Run scheduler:

await scheduler.run()