def test_fred_category_series(self): fred.key('123abc') fred.category(series=True) expected = 'http://api.stlouisfed.org/fred/category/series' params = {'api_key': '123abc', 'file_type': 'json'} self.get.assert_called_with(expected, params=params)
def test_fred_category(self): fred.category() expected = 'http://api.stlouisfed.org/fred/category' params = {'api_key': '', 'file_type': 'json'} self.get.assert_called_with(expected, params=params)
def test_fred_category_series(self): fred.key('123abc') fred.category(series=True) expected = 'https://api.stlouisfed.org/fred/category/series' params = {'api_key': '123abc', 'file_type': 'json'} self.get.assert_called_with(expected, params=params)
def test_fred_category(self): fred.category() expected = 'https://api.stlouisfed.org/fred/category' params = {'api_key': '', 'file_type': 'json'} self.get.assert_called_with(expected, params=params)
Created on Tue Jul 21 12:40:17 2015 @author: justin.malinchak """ import urllib3 urllib3.disable_warnings() import fred # Save your FRED API key. fred.key('63ef8588c3a78e956fb156c8a1603152') x = fred.categories(23) print x # Interact with economic data categories. x1 = fred.category() #print x1 # x2 = fred.categories(24) #print x2 # #fred.children(24) x3 = fred.children(24) #print x3 for k, v in x3.items(): print v[0] print v[1] y = fred.related(32073) #print y #
def test_api_key(self): key = self.credentials.FRED.API_KEY_FED.key self.assertTrue(len(key) > 0) fred.key(key) category = fred.category() self.assertTrue(len(category) > 0)