Example #1
0
    def series(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's data series
        `<https://research.stlouisfed.org/docs/api/fred/category_series.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are 'series_id',
                            'title', 'units', 'frequency', 'seasonal_adjustment', 'realtime_start', 'realtime_end',
                            'last_updated', 'observation_start', 'observation_end', 'popularity'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str filter_variable: The attribute to filter results by. Options are  'frequency', 'units','seasonal_adjustment'
        :arg str filter_value: The value of the filter_variable attribute to filter results by.
        :arg str tag_names: Tag names used to match series. Separate with semicolon as in "income;bea"
        :arg str exclude_tag_names: Tag names used to exclude series. Separate with semicolon as in "income;bea"
        """
        path = "/category/series?"
        params["category_id"] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #2
0
    def search(self,search_text=None,response_type=None,params=None):
        """
        Function to request economic data series that match search text.
        `<https://research.stlouisfed.org/docs/api/fred/series_search.html>`_

        :arg str search_text: The words to match against economic data series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str search_type: Determines the type of search to perform. Options are 'full_text','series_id'
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are 'search_rank',
                            'series_id', 'title', 'units', 'frequency', 'seasonal_adjustment', 'realtime_start',
                            'realtime_end', 'last_updated', 'observation_start', 'observation_end', 'popularity'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str filter_variable: The attribute to filter results by. Options are  'frequency', 'units','seasonal_adjustment'
        :arg str filter_value: The value of the filter_variable attribute to filter results by.
        :arg str tag_names: Tag names used to match series. Separate with semicolon as in "income;bea"
        :arg str exclude_tag_names: Tag names used to exclude series. Separate with semicolon as in "income;bea"
        """
        path = '/series/search?'
        params['search_text'] = search_text
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #3
0
    def observations(self, series_id=None, response_type=None, params=None):
        """
        Function to request the observations or data values for an economic data series.
        `<https://research.stlouisfed.org/docs/api/fred/series_observations.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 100000
        :arg int offset: Data offset. Options >=0
        :arg str sort_order: Sort results is ascending or descending observation_date order. Options are 'asc','desc'
        :arg str observation_start: The start of the observation period. Format "YYYY-MM-DD"
        :arg str observation_end: The end of the observation period. Format "YYYY-MM-DD"
        :arg str units: A key that indicates a data value transformation. Options are 'lin', 'chg', 'ch1', 'pch',
                        'pc1', 'pca', 'cch', 'cca', 'log'
        :arg str frequency: Indicates a lower frequency to aggregate values. Options are 'd', 'w',
                            'bw', 'm', 'q', 'sa', 'a', 'wef', 'weth', 'wew', 'wetu', 'wem',
                            'wesu', 'wesa', 'bwew', 'bwem'
        :arg str aggregation_method: Indicates the aggregation method used for frequency aggregation. Options are  'avg',
                            'sum', 'eop'
        :arg int output_type: Output type. Options are 1, 2, 3, 4
        :arg str vintage_dates: Date(s) in history. Format "YYYY-MM-DD". Example for multiple dates "2000-01-01,2005-02-24,..."
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/series/observations?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response
Example #4
0
    def search_related_tags(self,
                            series_search_text=None,
                            tag_names=None,
                            response_type=None,
                            params=None):
        """
        Function to request the related FRED tags for one or more FRED tags matching a series search.
        `<https://research.stlouisfed.org/docs/api/fred/series_search_related_tags.html>`_

        :arg str series_search_text: The words to match against economic data series. Required.
        :arg str tag_names: Tag names that series match. Separate with semicolon as in "income;bea". Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are  'series_count',
                            'popularity', 'created', 'name', 'group_id'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str tag_group_id: Tag ID to filter tags by. Options are 'freq', 'gen', 'geo', 'geot', 'rls', 'seas', 'src'
        :arg str tag_search_text: The words to find matching tags with.
        :arg str exclude_tag_names: Tag names to exclude. Separate with semicolon as in "income;bea"
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/series/search/related_tags?'
        params['series_search_text'], params[
            'tag_names'] = series_search_text, tag_names
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response
Example #5
0
    def observations(self,series_id=None,response_type=None,params=None):
        """
        Function to request the observations or data values for an economic data series.
        `<https://research.stlouisfed.org/docs/api/fred/series_observations.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 100000
        :arg int offset: Data offset. Options >=0
        :arg str sort_order: Sort results is ascending or descending observation_date order. Options are 'asc','desc'
        :arg str observation_start: The start of the observation period. Format "YYYY-MM-DD"
        :arg str observation_end: The end of the observation period. Format "YYYY-MM-DD"
        :arg str units: A key that indicates a data value transformation. Options are 'lin', 'chg', 'ch1', 'pch',
                        'pc1', 'pca', 'cch', 'cca', 'log'
        :arg str frequency: Indicates a lower frequency to aggregate values. Options are 'd', 'w',
                            'bw', 'm', 'q', 'sa', 'a', 'wef', 'weth', 'wew', 'wetu', 'wem',
                            'wesu', 'wesa', 'bwew', 'bwem'
        :arg str aggregation_method: Indicates the aggregation method used for frequency aggregation. Options are  'avg',
                            'sum', 'eop'
        :arg int output_type: Output type. Options are 1, 2, 3, 4
        :arg str vintage_dates: Date(s) in history. Format "YYYY-MM-DD". Example for multiple dates "2000-01-01,2005-02-24,..."
        """
        path = '/series/observations?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #6
0
    def tags(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's FRED tags.
        FRED tags are attributes assigned to series.
        Series are assigned tags and categories. Indirectly through series,
        it is possible to get the tags for a category. No tags exist for a
        category that does not have series.
        `<https://research.stlouisfed.org/docs/api/fred/category_tags.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are 'series_id',
                            'title', 'units', 'frequency', 'seasonal_adjustment', 'realtime_start', 'realtime_end',
                            'last_updated', 'observation_start', 'observation_end', 'popularity'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str tag_names: Tag names to only include in the response. Separate with semicolon as in "income;bea"
        :arg str tag_group_id: Tag ID to filter tags by. Options are 'freq', 'gen', 'geo', 'geot', 'rls', 'seas', 'src'
        :arg str search_text: The words to find matching tags with. For example 'mortgage rates'
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/category/tags?'
        params['category_id'] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response
Example #7
0
    def updates(self, series_id=None, response_type=None, params=None):
        """
        Function to request economic data series sorted by when observations
        were updated on the FRED server (attribute last_updated). Results are
        limited to series updated within the last two weeks.
        `<https://research.stlouisfed.org/docs/api/fred/series_updates.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str filter_value: Limit results by geographic type of economic data series. Options are 'macro',
                                'regional', and 'all'
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/series/updates?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response
Example #8
0
    def dates(self, release_id=None, response_type=None, params=None):
        """
        Function to request release dates for a particular release of economic data.
        Note that release dates are published by data sources and do not necessarily
        represent when data will be available on the FRED or ALFRED websites.
        `<https://research.stlouisfed.org/docs/api/fred/release_dates.html>`_

        :arg int release_id: The id for a release. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str sort_order: Sort results is ascending or descending release date order. Options are 'asc','desc'
        :arg str include_release_dates_with_no_data: Determines whether release dates with no data available are returned.
                                    Options are 'true', 'false'
        """
        path = '/release/dates?'
        params['release_id'] = release_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params)
        return response
Example #9
0
    def dates(self, release_id=None, response_type=None, params=None):
        """
        Function to request release dates for a particular release of economic data.
        Note that release dates are published by data sources and do not necessarily
        represent when data will be available on the FRED or ALFRED websites.
        `<https://research.stlouisfed.org/docs/api/fred/release_dates.html>`_

        :arg int release_id: The id for a release. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str sort_order: Sort results is ascending or descending release date order. Options are 'asc','desc'
        :arg str include_release_dates_with_no_data: Determines whether release dates with no data available are returned.
                                    Options are 'true', 'false'
        """
        path = "/release/dates?"
        params["release_id"] = release_id
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #10
0
    def series(self, release_id=None, response_type=None, params=None):
        """
        Function to request the series on a release of economic data.
        `<https://research.stlouisfed.org/docs/api/fred/release_series.html>`_

        :arg int release_id: The id for a release. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are  'series_id', 'title', 'units', 'frequency',
                            'seasonal_adjustment', 'realtime_start', 'realtime_end', 'last_updated', 'observation_start',
                            'observation_end', 'popularity'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str filter_variable: The attribute to filter results by. Options are  'frequency', 'units','seasonal_adjustment'
        :arg str filter_value: The value of the filter_variable attribute to filter results by.
        :arg str tag_names: Tag names used to match series. Separate with semicolon as in "income;bea"
        :arg str exclude_tag_names: Tag names used to exclude series. Separate with semicolon as in "income;bea"
        """
        path = '/release/series?'
        params['release_id'] = release_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params)
        return response
Example #11
0
    def related_tags(self,
                     release_id=None,
                     tag_names=None,
                     response_type=None,
                     params=None):
        """
        Function to request FRED related tags for a particular release.
        FRED tags are attributes assigned to series.
        Series are assigned tags and releases. Indirectly through series,
        it is possible to get the tags for a category. No tags exist for a
        release that does not have series.
        `<https://research.stlouisfed.org/docs/api/fred/release_related_tags.html>`_

        :arg int release_id: The id for a release. Required.
        :arg str tag_names: Tag names that series match. Separate with semicolon as in "income;bea". Required
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are 'series_count',
                            'popularity', 'created', 'name', 'group_id'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str exclude_tag_names: Tag names to exclude. Separate with semicolon as in "income;bea"
        :arg str tag_group_id: Tag ID to filter tags by. Options are 'freq', 'gen', 'geo', 'geot', 'rls', 'seas', 'src'
        :arg str search_text: The words to find matching tags with. For example 'mortgage rates'
        """
        path = '/release/related_tags?'
        params['release_id'], params['tag_names'] = release_id, tag_names
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params)
        return response
Example #12
0
    def related_tags(self, category_id=None, tag_names=None, response_type=None, params=None):
        """
        Function to request FRED related tags for a particular category.
        FRED tags are attributes assigned to series.
        Series are assigned tags and categories. Indirectly through series,
        it is possible to get the tags for a category. No tags exist for a
        category that does not have series.
        `<https://research.stlouisfed.org/docs/api/fred/category_tags.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str tag_names: Tag names that series match. Required. Separate with semicolon as in "income;bea"
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are 'series_id',
                            'title', 'units', 'frequency', 'seasonal_adjustment', 'realtime_start', 'realtime_end',
                            'last_updated', 'observation_start', 'observation_end', 'popularity'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str exclude_tag_names: Tag names to exclude. Separate with semicolon as in "income;bea"
        :arg str tag_group_id: Tag ID to filter tags by. Options are 'freq', 'gen', 'geo', 'geot', 'rls', 'seas', 'src'
        :arg str search_text: The words to find matching tags with. For example 'mortgage rates'
        """
        path = "/category/related_tags?"
        params["category_id"], params["tag_names"] = category_id, tag_names
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #13
0
    def related_tags(self,tag_names=None,response_type=None,params=None):
        """
        Function to request FRED related tags.
        FRED tags are attributes assigned to series.
        `<https://research.stlouisfed.org/docs/api/fred/related_tags.html>`_

        :arg str tag_names: Tag names that series match. Required. Separate with semicolon as in "income;bea"
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are 'series_count',
                            'popularity', 'created', 'name', 'group_id'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str exclude_tag_names: Tag names to exclude. Separate with semicolon as in "income;bea"
        :arg str tag_group_id: Tag ID to filter tags by. Options are 'freq', 'gen', 'geo', 'geot', 'rls', 'seas', 'src'
        :arg str search_text: The words to find matching tags with. For example 'mortgage rates'
        """
        path='/related_tags?'
        params['tag_names'] = tag_names
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #14
0
    def details(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's high-level details
        `<https://research.stlouisfed.org/docs/api/fred/category.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        """
        path = '/category?'
        params['category_id'] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params)
        return response
Example #15
0
    def details(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's high-level details
        `<https://research.stlouisfed.org/docs/api/fred/category.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        """
        path = "/category?"
        params["category_id"] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #16
0
    def release(self,series_id=None,response_type=None,params=None):
        """
        Function to request the release for an economic data series.
        `<https://research.stlouisfed.org/docs/api/fred/series_release.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        """
        path='/series/release?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #17
0
    def details(self,source_id=None,response_type=None,params=None):
        """
        Function to request a particular source of economic data.
        `<https://research.stlouisfed.org/docs/api/fred/source.html>`_

        :arg int source_id: The id for a source. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        """
        path='/source?'
        params['source_id'] = source_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #18
0
    def children(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's children
        `<https://research.stlouisfed.org/docs/api/fred/category_children.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        """
        path = '/category/children?'
        params['category_id'] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params)
        return response
Example #19
0
    def sources(self, release_id=None, response_type=None, params=None):
        """
        Function to request the sources for a particular release of economic data.
        `<https://research.stlouisfed.org/docs/api/fred/release.html>`_

        :arg int release_id: The id for a release. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        """
        path = "/release/sources?"
        params["release_id"] = release_id
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #20
0
    def children(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's children
        `<https://research.stlouisfed.org/docs/api/fred/category_children.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        """
        path = "/category/children?"
        params["category_id"] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #21
0
    def release(self, series_id=None, response_type=None, params=None):
        """
        Function to request the release for an economic data series.
        `<https://research.stlouisfed.org/docs/api/fred/series_release.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/series/release?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response
Example #22
0
    def sources(self,response_type=None,params=None):
        """
        Function to request all sources of economic data.
        `<https://research.stlouisfed.org/docs/api/fred/sources.html>`_

        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are 'source_id',
                            'name', 'realtime_start', 'realtime_end'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        """
        path='/sources?'
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #23
0
    def related(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's related categories.
        Related categories are A related category is a one-way relation between 2 categories
        that is not part of a parent-child category hierarchy.
        Most categories do not have related categories.
        `<https://research.stlouisfed.org/docs/api/fred/category_related.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        """
        path = '/category/related?'
        params['category_id'] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params)
        return response
Example #24
0
    def tags(self,series_id=None,response_type=None,params=None):
        """
        Function to request FRED tags for a particular series.
        FRED tags are attributes assigned to series.
        `<https://research.stlouisfed.org/docs/api/fred/series_tags.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg str order_by: Order results by values of the specified attribute. Options are 'series_count',
                            'popularity', 'created', 'name', 'group_id'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        """
        path = '/series/tags?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #25
0
    def related(self, category_id=None, response_type=None, params=None):
        """
        Function to request a particular category's related categories.
        Related categories are A related category is a one-way relation between 2 categories
        that is not part of a parent-child category hierarchy.
        Most categories do not have related categories.
        `<https://research.stlouisfed.org/docs/api/fred/category_related.html>`_

        :arg int category_id: The id for a category. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        """
        path = "/category/related?"
        params["category_id"] = category_id
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #26
0
    def vintage_dates(self,series_id=None,response_type=None,params=None):
        """
        Function to request the dates in history when a series' data values were
        revised or new data values were released. Vintage dates are the release dates
        for a series excluding release dates when the data for the series did not change.
        `<https://research.stlouisfed.org/docs/api/fred/series_vintagedates.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str sort_order: Sort results by vintage_date. Options are 'asc','desc'
        """
        path = '/series/vintagedates?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #27
0
    def all_dates(self, response_type=None, params=None):
        """
        Function to request release dates for all releases of economic data.
        `<https://research.stlouisfed.org/docs/api/fred/releases_dates.html>`_

        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are  'release_date',
                            'release_id', 'release_name'.
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str include_release_dates_with_no_data: Determines whether release dates with no data available are returned.
                                    Options are 'true', 'false'
        """
        path = "/releases/dates?"
        response_type = response_type if response_type else self.response_type
        if response_type != "xml":
            params["file_type"] = "json"
        response = _get_request(self.url_root, self.api_key, path, response_type, params)
        return response
Example #28
0
    def tags(self, series_id=None, response_type=None, params=None):
        """
        Function to request FRED tags for a particular series.
        FRED tags are attributes assigned to series.
        `<https://research.stlouisfed.org/docs/api/fred/series_tags.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg str order_by: Order results by values of the specified attribute. Options are 'series_count',
                            'popularity', 'created', 'name', 'group_id'
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/series/tags?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response
Example #29
0
    def updates(self,series_id=None,response_type=None,params=None):
        """
        Function to request economic data series sorted by when observations
        were updated on the FRED server (attribute last_updated). Results are
        limited to series updated within the last two weeks.
        `<https://research.stlouisfed.org/docs/api/fred/series_updates.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str filter_value: Limit results by geographic type of economic data series. Options are 'macro',
                                'regional', and 'all'
        """
        path = '/series/updates?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root,self.api_key,path,response_type,params)
        return response
Example #30
0
    def all_dates(self, response_type=None, params=None):
        """
        Function to request release dates for all releases of economic data.
        `<https://research.stlouisfed.org/docs/api/fred/releases_dates.html>`_

        :arg str response_type: File extension of response. Options are 'xml', 'json',
                            'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str order_by: Order results by values of the specified attribute. Options are  'release_date',
                            'release_id', 'release_name'.
        :arg str sort_order: Sort results for attribute values specified by order_by. Options are 'asc','desc'
        :arg str include_release_dates_with_no_data: Determines whether release dates with no data available are returned.
                                    Options are 'true', 'false'
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/releases/dates?'
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response
Example #31
0
    def vintage_dates(self, series_id=None, response_type=None, params=None):
        """
        Function to request the dates in history when a series' data values were
        revised or new data values were released. Vintage dates are the release dates
        for a series excluding release dates when the data for the series did not change.
        `<https://research.stlouisfed.org/docs/api/fred/series_vintagedates.html>`_

        :arg int series_id: The id for a series. Required.
        :arg str response_type: File extension of response. Options are 'xml', 'json',
                        'dict','df','numpy','csv','tab,'pipe'. Required.
        :arg str realtime_start: The start of the real-time period. Format "YYYY-MM-DD"
        :arg str realtime_end: The end of the real-time period. Format "YYYY-MM-DD"
        :arg int limit: The maximum number of results to return. Options 1 to 1000
        :arg int offset: Data offset. Options >=0
        :arg str sort_order: Sort results by vintage_date. Options are 'asc','desc'
        :arg bool ssl_verify: To verify HTTPs.
        """
        path = '/series/vintagedates?'
        params['series_id'] = series_id
        response_type = response_type if response_type else self.response_type
        if response_type != 'xml': params['file_type'] = 'json'
        response = _get_request(self.url_root, self.api_key, path,
                                response_type, params, self.ssl_verify)
        return response