Working with Federal Reserve Economic Data (FRED) - OrangeCardinal/FINpy GitHub Wiki

The methods in this class largely belong to two categories. The first, are direct mappings to api calls and convenience methods designed to allow people not as familiar with the data to use it quickly and easily.

Using core API methods

Initial Setup

from finpy.sources.fred import FederalReserveEconomicData
fred = FederalReserveEconomicData()

/series/observations - Print out the daily libor rate

series_id = "USD6MTD156N"
api_response = fred.series(series_id)

api_response = fred.series_observations(series_id)
print(api_response.keys())
for data in api_response['observations']:
    print(data)

/series/search - Search for all LIBOR series

api_response = fred.series_search('libor')
for series in api_response['seriess']:
    desc = "ID#{0} - {1}".format(series['id'] , series['title'])
    print(desc)

/sources - Get a list of available sources

api_response = fred.sources()
for source in api_response['sources']:
    source_desc = "ID #{0} - {1}".format(source['id'], source['name'])
    print(source_desc)