# Path: speculator/utils/date.py
# def date_to_delorean(year, month, day):
# def date_to_epoch(year, month, day):
# def now_delorean():
# def shift_epoch(delorean, direction, unit, count):
# def generate_epochs(delorean, direction, unit, count):
# def get_end_start_epochs(year, month, day, direction, unit, count):


import logging
import requests
from speculator.utils import date
           '=returnChartData&currencyPair={0}&start={1}'
           '&end={2}&period={3}').format(symbol, start, end, period) 
    logger.debug(' HTTP Request URL:\n{0}'.format(url))
    json = requests.get(url).json()
    logger.debug(' JSON:\n{0}'.format(json))

    if 'error' in json:
        logger.error(' Invalid parameters in URL for HTTP response')
        raise SystemExit
    elif all(val == 0 for val in json[0]):
        logger.error(' Bad HTTP response.  Time unit too short?')
        raise SystemExit
    elif len(json) < 1: # time to short
        logger.error(' Not enough dates to calculate changes')
        raise SystemExit

    return json, url

def parse_changes(json):
    """ Gets price changes from JSON

    Args:
        json: JSON data as a list of dict dates, where the keys are
            the raw market statistics.

    Returns:
        List of floats of price changes between entries in JSON.
    """
    changes = []
    dates = len(json)

# Path: speculator/utils/date.py
# def date_to_delorean(year, month, day):
# def date_to_epoch(year, month, day):
# def now_delorean():
# def shift_epoch(delorean, direction, unit, count):
# def generate_epochs(delorean, direction, unit, count):
# def get_end_start_epochs(year, month, day, direction, unit, count):


# Path: speculator/utils/poloniex.py
import logging
import requests
from speculator.utils import date

           '=returnChartData&currencyPair={0}&start={1}'
           '&end={2}&period={3}').format(symbol, start, end, period) 
    logger.debug(' HTTP Request URL:\n{0}'.format(url))
    json = requests.get(url).json()
    logger.debug(' JSON:\n{0}'.format(json))

    if 'error' in json:
        logger.error(' Invalid parameters in URL for HTTP response')
        raise SystemExit
    elif all(val == 0 for val in json[0]):
        logger.error(' Bad HTTP response.  Time unit too short?')
        raise SystemExit
    elif len(json) < 1: # time to short
        logger.error(' Not enough dates to calculate changes')
        raise SystemExit

    return json, url

def parse_changes(json):
    """ Gets price changes from JSON

    Args:
        json: JSON data as a list of dict dates, where the keys are
            the raw market statistics.

    Returns:
        List of floats of price changes between entries in JSON.
    """
    changes = []
    dates = len(json)

    for date in range(1, dates): 