FRED Releases¶
The pyfredapi.releases module has functions for requesting data about FRED Releases.
Setup¶
In [1]:
Copied!
from rich.pretty import pprint
import pyfredapi as pf
from rich.pretty import pprint
import pyfredapi as pf
Get metadata for all releases¶
In [2]:
Copied!
all_releases = pf.get_releases()
all_releases = pf.get_releases()
In [3]:
Copied!
print(f"Number of release = {all_releases['count']}")
print(f"Number of release = {all_releases['count']}")
Number of release = 314
In [4]:
Copied!
releases = all_releases["releases"]
releases = all_releases["releases"]
In [5]:
Copied!
pprint(releases[0:3])
pprint(releases[0:3])
[ │ { │ │ 'id': 9, │ │ 'realtime_start': '2024-04-05', │ │ 'realtime_end': '2024-04-05', │ │ 'name': 'Advance Monthly Sales for Retail and Food Services', │ │ 'press_release': True, │ │ 'link': 'http://www.census.gov/retail/', │ │ 'notes': 'The U.S. Census Bureau conducts the Advance Monthly Retail Trade and Food Services Survey to provide an early estimate of monthly sales by kind of business for retail and food service firms located in the United States. Each month, questionnaires are mailed to a probability sample of approximately 4,700 employer firms selected from the larger Monthly Retail Trade Survey. Advance sales estimates are computed using a link relative estimator. For each detailed industry, we compute a ratio of current-to previous month weighted sales using data from units for which we have obtained usable responses for both the current and previous month. For each detailed industry, the advance total sales estimates for the current month is computed by multiplying this ratio by the preliminary sales estimate for the previous month (derived from the larger MRTS) at the appropriate industry level. Total estimates for broader industries are computed as the sum of the detailed industry estimates. The link relative estimate is used because imputation is not performed for most nonrespondents in MARTS. For a limited number of nonresponding companies that have influential effects on the estimates, sales may be estimated based on historical performance of that company. The monthly estimates are benchmarked to the annual survey estimates from the Annual Retail Trade Survey once available. The estimates are adjusted for seasonal variation and holiday and trading day differences. Additional information on MARTS and MRTS can be found on the Census Bureau website at: www.census.gov/retail.\r\nDescription of the survey as provided by the Census, https://census.gov/retail/marts/www/marts_current.pdf' │ }, │ { │ │ 'id': 10, │ │ 'realtime_start': '2024-04-05', │ │ 'realtime_end': '2024-04-05', │ │ 'name': 'Consumer Price Index', │ │ 'press_release': True, │ │ 'link': 'http://www.bls.gov/cpi/' │ }, │ { │ │ 'id': 11, │ │ 'realtime_start': '2024-04-05', │ │ 'realtime_end': '2024-04-05', │ │ 'name': 'Employment Cost Index', │ │ 'press_release': True, │ │ 'link': 'http://www.bls.gov/ncs/ect' │ } ]
Get metadata for single release¶
In [6]:
Copied!
employment_cost_index = pf.get_release(release_id="11")
employment_cost_index = pf.get_release(release_id="11")
In [7]:
Copied!
pprint(employment_cost_index)
pprint(employment_cost_index)
{ │ 'realtime_start': '2024-04-05', │ 'realtime_end': '2024-04-05', │ 'releases': [ │ │ { │ │ │ 'id': 11, │ │ │ 'realtime_start': '2024-04-05', │ │ │ 'realtime_end': '2024-04-05', │ │ │ 'name': 'Employment Cost Index', │ │ │ 'press_release': True, │ │ │ 'link': 'http://www.bls.gov/ncs/ect' │ │ } │ ] }
Get series for a specific release¶
In [8]:
Copied!
series = pf.get_release_series(release_id="11")
series = pf.get_release_series(release_id="11")
In [9]:
Copied!
series["seriess"][0]
series["seriess"][0]
Out[9]:
{'id': 'CIS1010000000000I',
'realtime_start': '2024-04-05',
'realtime_end': '2024-04-05',
'title': 'Employment Cost Index: Total compensation for All Civilian workers in All industries and occupations (DISCONTINUED)',
'observation_start': '2001-01-01',
'observation_end': '2017-10-01',
'frequency': 'Quarterly',
'frequency_short': 'Q',
'units': 'Index Dec 2005=100',
'units_short': 'Index Dec 2005=100',
'seasonal_adjustment': 'Seasonally Adjusted',
'seasonal_adjustment_short': 'SA',
'last_updated': '2018-01-31 08:31:02-06',
'popularity': 1,
'group_popularity': 1,
'notes': 'Includes wages, salaries, and employer costs for employee benefits. See Footnote C on https://www.bls.gov/ect/cimapnote.htm\n\nThis series has been discontinued and will no longer be updated. It was a duplicate of the following series, which will continue to be updated: https://fred.stlouisfed.org/series/ECIALLCIV'}