Esempio n. 1
0
 def get_historical_data_as_dict(cls, start='2013-09-01', end=None):
     if not end:
         end = get_datetime()
     data = cls._get_historical_data(start, end)
     prices = data['bpi']
     prices = {k: Decimal(str(v)) for (k,v) in prices.iteritems()}
     return prices
 def get_historical_data_as_dict(cls, start='2013-09-01', end=None):
     if not end:
         end = get_datetime()
     data = cls._get_historical_data(start, end)
     prices = data['bpi']
     prices = {k: Decimal(str(v)) for (k, v) in prices.items()}
     return prices
Esempio n. 3
0
 def get_historical_data_as_dict(cls, start='2013-09-01', end=None):
     if not end:
         end = get_datetime()
     data = cls._get_historical_data(start, end)
     prices = data['bpi']
     # prices = {k: Decimal(str(v)) for (k,v) in prices.items()}
     prices = OrderedDict(sorted(prices.items(), key=lambda t: t[0]))
     return prices
Esempio n. 4
0
 def get_historical_data_as_list(cls, start='2013-09-01', end=None):
     if not end:
         end = get_datetime()
     data = cls._get_historical_data(start, end)
     dates = data['bpi']
     ret = [
         {'date': k, 'price': Decimal(str(v))} for (k,v) in dates.iteritems()
     ]
     ret.sort()
     return ret
Esempio n. 5
0
 def get_historical_data_as_list(cls, start='2013-09-01', end=None):
     if not end:
         end = get_datetime()
     data = cls._get_historical_data(start, end)
     dates = data['bpi']
     ret = [
         {'date': k, 'price': Decimal(str(v))} for (k,v) in dates.iteritems()
     ]
     ret.sort()
     return ret