11#!/usr/bin/env python3
22"""
3- Fred API Series Namespace Requests .
3+ Fred API Series Namespace.
44"""
5- from ._fred_client import FredClient
5+ from ._fred_client import FredClient , JsonOrXml
66from .._util .decorators import validate_api_args
77
88
@@ -24,7 +24,7 @@ class FredAPISeries(FredClient):
2424 """
2525
2626 @validate_api_args ("api_key" , "file_type" , "series_id" , "realtime_start" , "realtime_end" )
27- def get_series_categories (self , series_id : str , ** kwargs ) -> dict :
27+ def get_series_categories (self , series_id : str , ** kwargs ) -> JsonOrXml :
2828 """Get series categories by series ID. https://fred.stlouisfed.org/docs/api/fred/series_categories.html"""
2929 return self ._get (
3030 f"series/categories" ,
@@ -35,7 +35,7 @@ def get_series_categories(self, series_id: str, **kwargs) -> dict:
3535 )
3636
3737 @validate_api_args ("api_key" , "file_type" , "series_id" , "realtime_start" , "realtime_end" , "order_by" , "sort_order" )
38- def get_series_tags (self , series_id : str , ** kwargs ) -> dict :
38+ def get_series_tags (self , series_id : str , ** kwargs ) -> JsonOrXml :
3939 """Get series tags by series ID. https://fred.stlouisfed.org/docs/api/fred/series_tags.html"""
4040 return self ._get (
4141 f"series/tags" ,
@@ -61,7 +61,7 @@ def get_series_tags(self, series_id: str, **kwargs) -> dict:
6161 "tag_names" ,
6262 "exclude_tag_names" ,
6363 )
64- def get_series_search (self , search_text : str , search_type : str = "full_text" , ** kwargs ) -> dict :
64+ def get_series_search (self , search_text : str , search_type : str = "full_text" , ** kwargs ) -> JsonOrXml :
6565 """Get series search by text. https://fred.stlouisfed.org/docs/api/fred/series_search.html"""
6666 return self ._get (
6767 f"series/search" ,
@@ -86,7 +86,7 @@ def get_series_search(self, search_text: str, search_type: str = "full_text", **
8686 "order_by" ,
8787 "sort_order" ,
8888 )
89- def get_series_search_tags (self , series_search_text : str , ** kwargs ) -> dict :
89+ def get_series_search_tags (self , series_search_text : str , ** kwargs ) -> JsonOrXml :
9090 """Get series search tags by text. https://fred.stlouisfed.org/docs/api/fred/series_search_tags.html"""
9191 return self ._get (
9292 f"series/search/tags" ,
@@ -111,7 +111,7 @@ def get_series_search_tags(self, series_search_text: str, **kwargs) -> dict:
111111 "order_by" ,
112112 "sort_order" ,
113113 )
114- def get_series_search_related_tags (self , series_search_text : str , tag_names : str , ** kwargs ) -> dict :
114+ def get_series_search_related_tags (self , series_search_text : str , tag_names : str , ** kwargs ) -> JsonOrXml :
115115 """Get series related tags by text. https://fred.stlouisfed.org/docs/api/fred/series_search_related_tags.html"""
116116 return self ._get (
117117 f"series/search/related_tags" ,
@@ -139,7 +139,7 @@ def get_series_search_related_tags(self, series_search_text: str, tag_names: str
139139 "output_type" ,
140140 "vintage_dates" ,
141141 )
142- def get_series_observations (self , series_id : str , ** kwargs ) -> dict :
142+ def get_series_observations (self , series_id : str , ** kwargs ) -> JsonOrXml :
143143 """Get series observations by series ID. https://fred.stlouisfed.org/docs/api/fred/series_observations.html"""
144144 return self ._get (
145145 f"series/observations" ,
@@ -160,7 +160,7 @@ def get_series_observations(self, series_id: str, **kwargs) -> dict:
160160 "start_time" ,
161161 "end_time" ,
162162 )
163- def get_series_updates (self , ** kwargs ) -> dict :
163+ def get_series_updates (self , ** kwargs ) -> JsonOrXml :
164164 """Get series updates. https://fred.stlouisfed.org/docs/api/fred/series_updates.html"""
165165 # TODO FIXME: Validate start_time and end_time presence if applicable.
166166 return self ._get (
@@ -173,7 +173,7 @@ def get_series_updates(self, **kwargs) -> dict:
173173 @validate_api_args (
174174 "api_key" , "file_type" , "series_id" , "realtime_start" , "realtime_end" , "limit" , "offset" , "sort_order"
175175 )
176- def get_series_vintagedates (self , series_id : str , ** kwargs ) -> dict :
176+ def get_series_vintagedates (self , series_id : str , ** kwargs ) -> JsonOrXml :
177177 """Get series vintagedates by series ID. https://fred.stlouisfed.org/docs/api/fred/series_vintage_dates.html"""
178178 return self ._get (
179179 f"series/vintagedates" ,
@@ -184,7 +184,7 @@ def get_series_vintagedates(self, series_id: str, **kwargs) -> dict:
184184 )
185185
186186 @validate_api_args ("api_key" , "file_type" , "series_id" , "realtime_start" , "realtime_end" )
187- def get_series_release (self , series_id : str , ** kwargs ) -> dict :
187+ def get_series_release (self , series_id : str , ** kwargs ) -> JsonOrXml :
188188 """Get series release by series ID. https://fred.stlouisfed.org/docs/api/fred/series_release.html"""
189189 return self ._get (
190190 f"series/release" ,
@@ -195,7 +195,7 @@ def get_series_release(self, series_id: str, **kwargs) -> dict:
195195 )
196196
197197 @validate_api_args ("api_key" , "file_type" , "series_id" , "realtime_start" , "realtime_end" )
198- def get_series (self , series_id : str , ** kwargs ) -> dict :
198+ def get_series (self , series_id : str , ** kwargs ) -> JsonOrXml :
199199 """Get series by ID. https://fred.stlouisfed.org/docs/api/fred/series.html"""
200200 return self ._get (
201201 f"series" ,
0 commit comments