mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
[Bug fix] - Fix regulator cik map standard model (#6129)
* Fix regulator cik map standard model * fix description * Update cik_map.py
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""Cik Map Standard Model."""
|
||||
|
||||
from typing import Optional, Union
|
||||
|
||||
from pydantic import Field, field_validator
|
||||
|
||||
from openbb_core.provider.abstract.data import Data
|
||||
from openbb_core.provider.abstract.query_params import QueryParams
|
||||
from openbb_core.provider.utils.descriptions import (
|
||||
DATA_DESCRIPTIONS,
|
||||
QUERY_DESCRIPTIONS,
|
||||
)
|
||||
|
||||
|
||||
class CikMapQueryParams(QueryParams):
|
||||
"""CikMap Query."""
|
||||
|
||||
symbol: str = Field(description=QUERY_DESCRIPTIONS.get("symbol", ""))
|
||||
|
||||
@field_validator("symbol", mode="before", check_fields=False)
|
||||
@classmethod
|
||||
def upper_symbol(cls, v: str) -> str:
|
||||
"""Convert symbol to uppercase."""
|
||||
return v.upper()
|
||||
|
||||
|
||||
class CikMapData(Data):
|
||||
"""CikMap Data."""
|
||||
|
||||
cik: Optional[Union[str, int]] = Field(
|
||||
default=None, description=DATA_DESCRIPTIONS.get("cik", "")
|
||||
)
|
||||
@@ -1,6 +1,6 @@
|
||||
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
||||
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing import Literal, Optional
|
||||
|
||||
from openbb_core.app.model.custom_parameter import OpenBBCustomParameter
|
||||
from openbb_core.app.model.obbject import OBBject
|
||||
@@ -28,10 +28,7 @@ class ROUTER_regulators_sec(Container):
|
||||
def cik_map(
|
||||
self,
|
||||
symbol: Annotated[
|
||||
Union[str, List[str]],
|
||||
OpenBBCustomParameter(
|
||||
description="Symbol to get data for. Multiple items allowed: fmp, intrinio, yfinance."
|
||||
),
|
||||
str, OpenBBCustomParameter(description="Symbol to get data for.")
|
||||
],
|
||||
provider: Optional[Literal["sec"]] = None,
|
||||
**kwargs
|
||||
@@ -40,8 +37,8 @@ class ROUTER_regulators_sec(Container):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbol : Union[str, List[str]]
|
||||
Symbol to get data for. Multiple items allowed: fmp, intrinio, yfinance.
|
||||
symbol : str
|
||||
Symbol to get data for.
|
||||
provider : Optional[Literal['sec']]
|
||||
The provider to use for the query, by default None.
|
||||
If None, the provider specified in defaults is selected or 'sec' if there is
|
||||
@@ -63,8 +60,8 @@ class ROUTER_regulators_sec(Container):
|
||||
|
||||
CikMap
|
||||
------
|
||||
cik : Optional[Union[str, int]]
|
||||
Central Index Key (provider: sec)
|
||||
cik : Optional[Union[int, str]]
|
||||
Central Index Key
|
||||
|
||||
Example
|
||||
-------
|
||||
@@ -87,11 +84,6 @@ class ROUTER_regulators_sec(Container):
|
||||
"symbol": symbol,
|
||||
},
|
||||
extra_params=kwargs,
|
||||
extra_info={
|
||||
"symbol": {
|
||||
"multiple_items_allowed": ["fmp", "intrinio", "yfinance"]
|
||||
}
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
@@ -140,7 +132,7 @@ class ROUTER_regulators_sec(Container):
|
||||
------------------
|
||||
name : Optional[str]
|
||||
The name of the institution. (provider: sec)
|
||||
cik : Optional[Union[str, int]]
|
||||
cik : Optional[Union[int, str]]
|
||||
Central Index Key (CIK) (provider: sec)
|
||||
|
||||
Example
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
"""SEC CIK Mapping Model."""
|
||||
|
||||
from typing import Any, Dict, Optional, Union
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from openbb_core.provider.abstract.data import Data
|
||||
from openbb_core.provider.abstract.fetcher import Fetcher
|
||||
from openbb_core.provider.standard_models.equity_info import EquityInfoQueryParams
|
||||
from openbb_core.provider.standard_models.cik_map import CikMapData, CikMapQueryParams
|
||||
from openbb_sec.utils.helpers import symbol_map
|
||||
from pydantic import Field
|
||||
|
||||
|
||||
class SecCikMapQueryParams(EquityInfoQueryParams):
|
||||
class SecCikMapQueryParams(CikMapQueryParams):
|
||||
"""SEC CIK Mapping Query.
|
||||
|
||||
Source: https://sec.gov/
|
||||
"""
|
||||
|
||||
|
||||
class SecCikMapData(Data):
|
||||
class SecCikMapData(CikMapData):
|
||||
"""SEC CIK Mapping Data."""
|
||||
|
||||
cik: Optional[Union[str, int]] = Field(
|
||||
default=None, description="Central Index Key"
|
||||
)
|
||||
|
||||
|
||||
class SecCikMapFetcher(
|
||||
Fetcher[
|
||||
|
||||
Reference in New Issue
Block a user