diff --git a/openbb_sdk/providers/fmp/openbb_fmp/utils/helpers.py b/openbb_sdk/providers/fmp/openbb_fmp/utils/helpers.py index ccfed36c626..1142890feac 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/utils/helpers.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/utils/helpers.py @@ -20,7 +20,6 @@ class BasicResponse: def __init__(self, response: StringIO): """Initialize the BasicResponse class.""" - # Find a way to get the status code self.status_code = 200 response.seek(0) @@ -28,21 +27,21 @@ class BasicResponse: def json(self) -> dict: """Return the response as a dictionary.""" - return json.loads(self.text) def request(url: str) -> BasicResponse: - """ - Request function for PyScript. Pass in Method and make sure to await! + """Request function for PyScript. - Parameters: - ----------- + Pass in Method and make sure to await! + + Parameters + ---------- url: str URL to make request to - Return: - ------- + Return + ------ response: BasicRequest BasicRequest object with status_code and text attributes """ @@ -55,7 +54,6 @@ def request(url: str) -> BasicResponse: def get_data(url: str, **kwargs: Any) -> Union[list, dict]: """Get data from FMP endpoint.""" - try: r: Union[requests.Response, BasicResponse] = helpers.make_request(url, **kwargs) except SSLError: @@ -86,8 +84,8 @@ def create_url( ) -> str: """Return a URL for the FMP API. - Parameters: - ----------- + Parameters + ---------- version: int The version of the API to use. endpoint: str @@ -99,11 +97,10 @@ def create_url( exclude: List[str] The keys to be excluded from the querystring. - Returns: - -------- + Returns + ------- str The querystring. - """ the_dict = {} if not query else query.dict(by_alias=True) query_string = get_querystring(the_dict, exclude or []) @@ -116,15 +113,15 @@ def get_data_many( ) -> List[dict]: """Get data from FMP endpoint and convert to list of schemas. - Parameters: - ----------- + Parameters + ---------- url: str The URL to get the data from. sub_dict: Optional[str] The sub-dictionary to use. - Returns: - -------- + Returns + ------- List[dict] Dictionary of data. """ @@ -138,7 +135,6 @@ def get_data_many( def get_data_one(url: str, **kwargs: Any) -> dict: """Get data from FMP endpoint and convert to schema.""" - data = get_data(url, **kwargs) if isinstance(data, list): if len(data) == 0: diff --git a/openbb_sdk/providers/fred/openbb_fred/utils/fred_helpers.py b/openbb_sdk/providers/fred/openbb_fred/utils/fred_helpers.py index e3076264cc2..55501fe5a24 100644 --- a/openbb_sdk/providers/fred/openbb_fred/utils/fred_helpers.py +++ b/openbb_sdk/providers/fred/openbb_fred/utils/fred_helpers.py @@ -30,6 +30,7 @@ YIELD_CURVE_SERIES_REAL = { def all_cpi_options(harmonized: bool = False) -> List[dict]: + """Get all CPI options.""" data = [] current_dir = os.path.dirname(os.path.realpath(__file__)) @@ -44,6 +45,7 @@ def all_cpi_options(harmonized: bool = False) -> List[dict]: def get_cpi_options(harmonized: bool = False) -> List[dict]: + """Get CPI options.""" series = all_cpi_options(harmonized) for item in series: item.pop("series_id") @@ -51,10 +53,7 @@ def get_cpi_options(harmonized: bool = False) -> List[dict]: def process_projections(data: Dict) -> List[Dict]: - """. - Process projection data - """ - + """Process projection data.""" # Get dates first dates = [] for key, value in data.items(): diff --git a/openbb_sdk/providers/polygon/openbb_polygon/utils/helpers.py b/openbb_sdk/providers/polygon/openbb_polygon/utils/helpers.py index a2b65faaf99..f784744e5d6 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/utils/helpers.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/utils/helpers.py @@ -3,6 +3,7 @@ from openbb_provider import helpers def get_data(url: str, **kwargs) -> dict: + """Get data from Polygon endpoint.""" r = helpers.make_request(url, **kwargs) if r.status_code != 200: data = r.json() diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py index 2637ce0f8b6..df604bd275c 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py @@ -1,7 +1,6 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### - from openbb_core.app.static.container import Container