I’m trying to work out an idea I have for a python application. I will try to lay out the basic components.
-
It should be accessible through a web interface or from a mobile app, or even linux console if possible.
-
The application itself would mostly do CRUD operations on a database & return the information.
-
Also,most importantly, it should be able to configure & launch/relaunch scheduled background tasks. Tasks being functions that do certain I/O operations (moving files from one folder to another).
I’m looking on how to approach this & which frameworks/libraries are most suited for this task. For the web interface I figured that any microframework (such as cherrypy/flash/bottlepy) could serve as a RESTful or SOAP api. Or alternatively use twisted?
For the scheduling I’m a bit stuck. I took a look at celery & reddis queue, but they both seem too heavyweight for what I want. I also took a look at APScheduler? Could I launch the I/O tasks as apscheduler jobs or should I look at something else?
Thanks!
Python has no support for cron in the standard library. But there are third-party libraries. crontab looks nice.
Example:
I would not make the handling of cron events part of the web application. Build a separate tool that loops and does the background tasks whenever it’s time.