install packages
pip install pyramid-task-scheduler
or require in setup.py
add the follwing line to your Configuratior
section of your pyramid application:
e.g
config = Configurator(settings=settings)
config.include('pyramid_task_scheduler') # Add this Line
add the following two lines to your .ini file
pyramid_task_scheduler_mode = json
pyramid_task_scheduler_path = path_to/crontab.json
single cron crontab example:
{
"cron": [
{
"name": "first_cron",
"import_script": "import_script",
"exec_func": "function_to_execute",
"crontab_time": "0 * * * *"
}
]
}
multiple crons crontab example:
{
"cron": [
{
"name": "first_cron",
"import_script": "import_script",
"exec_func": "function_to_execute",
"crontab_time": "0 * * * *"
},
{
"name": "second_cron",
"import_script": "import_script",
"exec_func": "function_to_execute",
"crontab_time": "0 * * * *"
}
]
}
this package is alpha experimental. It is recommened to NOT use it for productional environments.