s = '3 days ago'
parsed_s = [s.split()[:2]]
time_dict = dict((fmt, float(amount)) for amount, fmt in parsed_s)
dt = datetime.timedelta(**time_dict)
past_time = datetime.datetime.now() - dt
python 'x days ago' to datetime