I've been going over this great free book by Caleb Hattingh, 20 Python Libraries You Aren't Using, where he covers modules that are of great use. His selection criteria are listed below and I'm sure you'll agree these are some great parameters to follow although I'm not sure what the 'X factor' is referring to.
So below I use the Sched module to cron code. The code is simply querying crypto currency and stock prices, on the hour (you have to use timedelta(minutes=60)), and putting them into a securities master database. The reason this is useful is because this code will work on any platform without any changes, and most importantly, without having to set up a Cron job or the equivalent in Windows Task Scheduler.
#http://www.oreilly.com/programming/free/files/20-python-libraries-you-arent-using-but-should.pdf
import sched
import time
from priceupdate import PriceUpdate
from datetime import datetime, timedelta
#create scheduler instance
scheduler = sched.scheduler(timefunc=time.time)
# get current time and reset seconds and microseconds to obtain a whole minute
def reschedule():
new_target = datetime.now().replace(second=0, microsecond=0)
new_target += timedelta(minutes=1)
scheduler.enterabs(new_target.timestamp(), priority=0, action=saytime)
def saytime():
print("Getting Prices: ", time.ctime(), flush=True)
PriceUpdate = PriceUpdate()
PriceUpdate.get_GDAX_prices()
PriceUpdate.get_Poloniex_prices()
PriceUpdate.get_Quandl_prices()
PriceUpdate.insert_prices()
reschedule()
reschedule()
try:
scheduler.run(blocking=True)
except KeyboardInterrupt:
print('Stopped.')