
    fi                         d Z ddlZddedej        fdZddedej        fdZedk    r0 ed	
          Z e	e            ed	
          Z
 e	e
           dS dS )u  
Date: 2020/4/10 19:58
Desc: Economic Research from Federal Reserve Bank of St. Louis
https://research.stlouisfed.org/econ/mccracken/fred-databases/
FRED-MD and FRED-QD are large macroeconomic databases designed for the empirical analysis of “big data.” The datasets of monthly and quarterly observations mimic the coverage of datasets already used in the literature, but they add three appealing features. They are updated in real-time through the FRED database. They are publicly accessible, facilitating the replication of empirical work. And they relieve the researcher of the task of incorporating data changes and revisions (a task accomplished by the data desk at the Federal Reserve Bank of St. Louis).
    N2020-01datereturnc                 :    d|  d}t          j        |          }|S )a  
    The accompanying paper shows that factors extracted from the FRED-MD dataset share the same predictive content as those based on the various vintages of the so-called Stock-Watson data. In addition, it suggests that diffusion indexes constructed as the partial sum of the factor estimates can potentially be useful for the study of business cycle chronology.
    :param date: e.g., "2020-03"; from "2015-01" to now
    :type date: str
    :return: Monthly Data
    :rtype: pandas.DataFrame
    zChttps://s3.amazonaws.com/files.fred.stlouisfed.org/fred-md/monthly/.csvpdread_csvr   urltemp_dfs      B/usr/local/lib/python3.11/dist-packages/akshare/article/fred_md.pyfred_mdr      s.     	YdXXX  k#GN    c                 :    d|  d}t          j        |          }|S )a  
    FRED-QD is a quarterly frequency companion to FRED-MD. It is designed to emulate the dataset used in "Disentangling the Channels of the 2007-2009 Recession" by Stock and Watson (2012, NBER WP No. 18094) but also contains several additional series. Comments or suggestions are welcome.
    :param date: e.g., "2020-03"; from "2015-01" to now
    :type date: str
    :return: Quarterly Data
    :rtype: pandas.DataFrame
    zEhttps://s3.amazonaws.com/files.fred.stlouisfed.org/fred-md/quarterly/r   r   r   s      r   fred_qdr      s*     ]RV
\
\
\Ck#GNr   __main__z2023-03)r   )r   )__doc__pandasr	   str	DataFramer   r   __name__
fred_md_dfprint
fred_qd_df r   r   <module>r      s         # bl    
 
# 
bl 
 
 
 
 zi(((J	E*i(((J	E* r   