A simple Python daemon that schedules tasks to run on a regular interval. We use this daemon in our data visualization projects to perform intermediate analysis on large datasets.
This daemon depends on the schedule package to run tasks on a regular interval. You can install it on your local machine with the command below:
pip install schedule
To run the daemon, just execute:
python main.py
It is up to you how you go about configuring your system to run main.py
on startup. See this StackOverflow post if you are using Ubuntu for guidance.
To add a task, follow the three steps below:
-
Tasks are Python files with a single
run
function that gets executed when the task is executed. See tasks/example.py:def run(): print("Hello, World!")
-
Import your task to main.py:
from tasks import example
-
Schedule the task using the schedule package. You can find the docs here.
# Schedules the `example` task to execute every 3 seconds. schedule.every(3).seconds.do(run_threaded, example)
This project is licensed under the MIT license by the Technologies & International Development (TID) Lab at Georgia Tech.