summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Radovanovic <74266147+IgorWounds@users.noreply.github.com>2024-05-19 20:02:09 +0200
committerGitHub <noreply@github.com>2024-05-19 20:02:09 +0200
commit301c071be5985cb7367ef6fbcce140f304947f58 (patch)
treee4d78923fb20892ff52b5e6c44e0a9beba9dee71
parent64407f4e9633fe9a67fb08712645b205310e9bee (diff)
parentb7b5e40f165f2fc5566c8af5f93fa9de89a6b440 (diff)
Merge branch 'develop' into feature/fred-balance-of-paymentsfeature/fred-balance-of-payments
-rw-r--r--openbb_platform/extensions/equity/integration/test_equity_api.py2
-rw-r--r--openbb_platform/extensions/equity/integration/test_equity_python.py2
-rw-r--r--openbb_platform/openbb/assets/reference.json18
-rw-r--r--openbb_platform/openbb/package/equity.py2
-rw-r--r--openbb_platform/openbb/package/equity_estimates.py13
-rw-r--r--openbb_platform/openbb/package/equity_ownership.py2
-rw-r--r--openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py23
-rw-r--r--openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py14
-rw-r--r--openbb_platform/providers/fmp/openbb_fmp/models/insider_trading.py4
-rw-r--r--openbb_platform/providers/fmp/openbb_fmp/utils/definitions.py31
-rw-r--r--openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_equity_screener_fetcher.yaml109
-rw-r--r--openbb_platform/providers/fmp/tests/test_fmp_fetchers.py2
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/company_filings.py4
-rw-r--r--openbb_platform/providers/sec/openbb_sec/utils/definitions.py130
14 files changed, 187 insertions, 169 deletions
diff --git a/openbb_platform/extensions/equity/integration/test_equity_api.py b/openbb_platform/extensions/equity/integration/test_equity_api.py
index ad38630c069..7ab3bb95c40 100644
--- a/openbb_platform/extensions/equity/integration/test_equity_api.py
+++ b/openbb_platform/extensions/equity/integration/test_equity_api.py
@@ -1421,7 +1421,7 @@ def test_equity_search(params, headers):
(
{
"industry": "REIT",
- "sector": "Real Estate",
+ "sector": "real_estate",
"mktcap_min": None,
"mktcap_max": None,
"price_min": None,
diff --git a/openbb_platform/extensions/equity/integration/test_equity_python.py b/openbb_platform/extensions/equity/integration/test_equity_python.py
index f13df3df558..344ea98e5d8 100644
--- a/openbb_platform/extensions/equity/integration/test_equity_python.py
+++ b/openbb_platform/extensions/equity/integration/test_equity_python.py
@@ -1325,7 +1325,7 @@ def test_equity_search(params, obb):
(
{
"industry": "REIT",
- "sector": "Real Estate",
+ "sector": "real_estate",
"mktcap_min": None,
"mktcap_max": None,
"price_min": None,
diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json
index bbc14f5b00d..ff6e4f6f446 100644
--- a/openbb_platform/openbb/assets/reference.json
+++ b/openbb_platform/openbb/assets/reference.json
@@ -6042,24 +6042,24 @@
},
{
"name": "analyst_ids",
- "type": "Union[List[str], str]",
- "description": "Comma-separated list of analyst (person) IDs. Omitting will bring back all available analysts.",
+ "type": "Union[Union[List[str], str], List[Union[List[str], str]]]",
+ "description": "Comma-separated list of analyst (person) IDs. Omitting will bring back all available analysts. Multiple items allowed for provider(s): benzinga.",
"default": null,
"optional": true,
"choices": null
},
{
"name": "firm_ids",
- "type": "Union[List[str], str]",
- "description": "Comma-separated list of firm IDs.",
+ "type": "Union[Union[List[str], str], List[Union[List[str], str]]]",
+ "description": "Comma-separated list of firm IDs. Multiple items allowed for provider(s): benzinga.",
"default": null,
"optional": true,
"choices": null
},
{
"name": "fields",
- "type": "Union[List[str], str]",
- "description": "Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields.",
+ "type": "Union[Union[List[str], str], List[Union[List[str], str]]]",
+ "description": "Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. Multiple items allowed for provider(s): benzinga.",
"default": null,
"optional": true,
"choices": null
@@ -18628,7 +18628,7 @@
},
{
"name": "form_type",
- "type": "Literal['1', '1-A', '1-A POS', '1-A-W', '1-E', '1-E AD', '1-K', '1-SA', '1-U', '1-Z', '1-Z-W', '10-12B', '10-12G', '10-D', '10-K', '10-KT', '10-Q', '10-QT', '11-K', '11-KT', '13F-HR', '13F-NT', '13FCONP', '144', '15-12B', '15-12G', '15-15D', '15F-12B', '15F-12G', '15F-15D', '18-12B', '18-K', '19B-4E', '2-A', '2-AF', '2-E', '20-F', '20FR12B', '20FR12G', '24F-2NT', '25', '25-NSE', '253G1', '253G2', '253G3', '253G4', '3', '305B2', '34-12H', '4', '40-17F1', '40-17F2', '40-17G', '40-17GCS', '40-202A', '40-203A', '40-206A', '40-24B2', '40-33', '40-6B', '40-8B25', '40-8F-2', '40-APP', '40-F', '40-OIP', '40FR12B', '40FR12G', '424A', '424B1', '424B2', '424B3', '424B4', '424B5', '424B7', '424B8', '424H', '425', '485APOS', '485BPOS', '485BXT', '486APOS', '486BPOS', '486BXT', '487', '497', '497AD', '497H2', '497J', '497K', '497VPI', '497VPU', '5', '6-K', '6B NTC', '6B ORDR', '8-A12B', '8-A12G', '8-K', '8-K12B', '8-K12G3', '8-K15D5', '8-M', '8F-2 NTC', '8F-2 ORDR', '9-M', 'ABS-15G', 'ABS-EE', 'ADN-MTL', 'ADV-E', 'ADV-H-C', 'ADV-H-T', 'ADV-NR', 'ANNLRPT', 'APP NTC', 'APP ORDR', 'APP WD', 'APP WDG', 'ARS', 'ATS-N', 'ATS-N-C', 'ATS-N/UA', 'AW', 'AW WD', 'C', 'C-AR', 'C-AR-W', 'C-TR', 'C-TR-W', 'C-U', 'C-U-W', 'C-W', 'CB', 'CERT', 'CERTARCA', 'CERTBATS', 'CERTCBO', 'CERTNAS', 'CERTNYS', 'CERTPAC', 'CFPORTAL', 'CFPORTAL-W', 'CORRESP', 'CT ORDER', 'D', 'DEF 14A', 'DEF 14C', 'DEFA14A', 'DEFA14C', 'DEFC14A', 'DEFC14C', 'DEFM14A', 'DEFM14C', 'DEFN14A', 'DEFR14A', 'DEFR14C', 'DEL AM', 'DFAN14A', 'DFRN14A', 'DOS', 'DOSLTR', 'DRS', 'DRSLTR', 'DSTRBRPT', 'EFFECT', 'F-1', 'F-10', 'F-10EF', 'F-10POS', 'F-1MEF', 'F-3', 'F-3ASR', 'F-3D', 'F-3DPOS', 'F-3MEF', 'F-4', 'F-4 POS', 'F-4MEF', 'F-6', 'F-6 POS', 'F-6EF', 'F-7', 'F-7 POS', 'F-8', 'F-8 POS', 'F-80', 'F-80POS', 'F-9', 'F-9 POS', 'F-N', 'F-X', 'FOCUSN', 'FWP', 'G-405', 'G-405N', 'G-FIN', 'G-FINW', 'IRANNOTICE', 'MA', 'MA-A', 'MA-I', 'MA-W', 'MSD', 'MSDCO', 'MSDW', 'N-1', 'N-14', 'N-14 8C', 'N-14MEF', 'N-18F1', 'N-1A', 'N-2', 'N-2 POSASR', 'N-23C-2', 'N-23C3A', 'N-23C3B', 'N-23C3C', 'N-2ASR', 'N-2MEF', 'N-30B-2', 'N-30D', 'N-4', 'N-5', 'N-54A', 'N-54C', 'N-6', 'N-6F', 'N-8A', 'N-8B-2', 'N-8F', 'N-8F NTC', 'N-8F ORDR', 'N-CEN', 'N-CR', 'N-CSR', 'N-CSRS', 'N-MFP', 'N-MFP1', 'N-MFP2', 'N-PX', 'N-Q', 'N-VP', 'N-VPFS', 'NO ACT', 'NPORT-EX', 'NPORT-NP', 'NPORT-P', 'NRSRO-CE', 'NRSRO-UPD', 'NSAR-A', 'NSAR-AT', 'NSAR-B', 'NSAR-BT', 'NSAR-U', 'NT 10-D', 'NT 10-K', 'NT 10-Q', 'NT 11-K', 'NT 20-F', 'NT N-CEN', 'NT N-MFP', 'NT N-MFP1', 'NT N-MFP2', 'NT NPORT-EX', 'NT NPORT-P', 'NT-NCEN', 'NT-NCSR', 'NT-NSAR', 'NTFNCEN', 'NTFNCSR', 'NTFNSAR', 'NTN 10D', 'NTN 10K', 'NTN 10Q', 'NTN 20F', 'OIP NTC', 'OIP ORDR', 'POS 8C', 'POS AM', 'POS AMI', 'POS EX', 'POS462B', 'POS462C', 'POSASR', 'PRE 14A', 'PRE 14C', 'PREC14A', 'PREC14C', 'PREM14A', 'PREM14C', 'PREN14A', 'PRER14A', 'PRER14C', 'PRRN14A', 'PX14A6G', 'PX14A6N', 'QRTLYRPT', 'QUALIF', 'REG-NR', 'REVOKED', 'RW', 'RW WD', 'S-1', 'S-11', 'S-11MEF', 'S-1MEF', 'S-20', 'S-3', 'S-3ASR', 'S-3D', 'S-3DPOS', 'S-3MEF', 'S-4', 'S-4 POS', 'S-4EF', 'S-4MEF', 'S-6', 'S-8', 'S-8 POS', 'S-B', 'S-BMEF', 'SBSE', 'SBSE-A', 'SBSE-BD', 'SBSE-C', 'SBSE-W', 'SC 13D', 'SC 13E1', 'SC 13E3', 'SC 13G', 'SC 14D9', 'SC 14F1', 'SC 14N', 'SC TO-C', 'SC TO-I', 'SC TO-T', 'SC13E4F', 'SC14D1F', 'SC14D9C', 'SC14D9F', 'SD', 'SDR', 'SE', 'SEC ACTION', 'SEC STAFF ACTION', 'SEC STAFF LETTER', 'SF-1', 'SF-3', 'SL', 'SP 15D2', 'STOP ORDER', 'SUPPL', 'T-3', 'TA-1', 'TA-2', 'TA-W', 'TACO', 'TH', 'TTW', 'UNDER', 'UPLOAD', 'WDL-REQ', 'X-17A-5']",
+ "type": "Literal['1', '1-A', '1-A_POS', '1-A-W', '1-E', '1-E_AD', '1-K', '1-SA', '1-U', '1-Z', '1-Z-W', '10-12B', '10-12G', '10-D', '10-K', '10-KT', '10-Q', '10-QT', '11-K', '11-KT', '13F-HR', '13F-NT', '13FCONP', '144', '15-12B', '15-12G', '15-15D', '15F-12B', '15F-12G', '15F-15D', '18-12B', '18-K', '19B-4E', '2-A', '2-AF', '2-E', '20-F', '20FR12B', '20FR12G', '24F-2NT', '25', '25-NSE', '253G1', '253G2', '253G3', '253G4', '3', '305B2', '34-12H', '4', '40-17F1', '40-17F2', '40-17G', '40-17GCS', '40-202A', '40-203A', '40-206A', '40-24B2', '40-33', '40-6B', '40-8B25', '40-8F-2', '40-APP', '40-F', '40-OIP', '40FR12B', '40FR12G', '424A', '424B1', '424B2', '424B3', '424B4', '424B5', '424B7', '424B8', '424H', '425', '485APOS', '485BPOS', '485BXT', '486APOS', '486BPOS', '486BXT', '487', '497', '497AD', '497H2', '497J', '497K', '497VPI', '497VPU', '5', '6-K', '6B_NTC', '6B_ORDR', '8-A12B', '8-A12G', '8-K', '8-K12B', '8-K12G3', '8-K15D5', '8-M', '8F-2_NTC', '8F-2_ORDR', '9-M', 'ABS-15G', 'ABS-EE', 'ADN-MTL', 'ADV-E', 'ADV-H-C', 'ADV-H-T', 'ADV-NR', 'ANNLRPT', 'APP_NTC', 'APP_ORDR', 'APP_WD', 'APP_WDG', 'ARS', 'ATS-N', 'ATS-N-C', 'ATS-N/UA', 'AW', 'AW_WD', 'C', 'C-AR', 'C-AR-W', 'C-TR', 'C-TR-W', 'C-U', 'C-U-W', 'C-W', 'CB', 'CERT', 'CERTARCA', 'CERTBATS', 'CERTCBO', 'CERTNAS', 'CERTNYS', 'CERTPAC', 'CFPORTAL', 'CFPORTAL-W', 'CORRESP', 'CT ORDER', 'D', 'DEF_14A', 'DEF_14C', 'DEFA14A', 'DEFA14C', 'DEFC14A', 'DEFC14C', 'DEFM14A', 'DEFM14C', 'DEFN14A', 'DEFR14A', 'DEFR14C', 'DEL_AM', 'DFAN14A', 'DFRN14A', 'DOS', 'DOSLTR', 'DRS', 'DRSLTR', 'DSTRBRPT', 'EFFECT', 'F-1', 'F-10', 'F-10EF', 'F-10POS', 'F-1MEF', 'F-3', 'F-3ASR', 'F-3D', 'F-3DPOS', 'F-3MEF', 'F-4', 'F-4_POS', 'F-4MEF', 'F-6', 'F-6_POS', 'F-6EF', 'F-7', 'F-7_POS', 'F-8', 'F-8_POS', 'F-80', 'F-80POS', 'F-9', 'F-9_POS', 'F-N', 'F-X', 'FOCUSN', 'FWP', 'G-405', 'G-405N', 'G-FIN', 'G-FINW', 'IRANNOTICE', 'MA', 'MA-A', 'MA-I', 'MA-W', 'MSD', 'MSDCO', 'MSDW', 'N-1', 'N-14', 'N-14_8C', 'N-14MEF', 'N-18F1', 'N-1A', 'N-2', 'N-2_POSASR', 'N-23C-2', 'N-23C3A', 'N-23C3B', 'N-23C3C', 'N-2ASR', 'N-2MEF', 'N-30B-2', 'N-30D', 'N-4', 'N-5', 'N-54A', 'N-54C', 'N-6', 'N-6F', 'N-8A', 'N-8B-2', 'N-8F', 'N-8F_NTC', 'N-8F_ORDR', 'N-CEN', 'N-CR', 'N-CSR', 'N-CSRS', 'N-MFP', 'N-MFP1', 'N-MFP2', 'N-PX', 'N-Q', 'N-VP', 'N-VPFS', 'NO_ACT', 'NPORT-EX', 'NPORT-NP', 'NPORT-P', 'NRSRO-CE', 'NRSRO-UPD', 'NSAR-A', 'NSAR-AT', 'NSAR-B', 'NSAR-BT', 'NSAR-U', 'NT_10-D', 'NT_10-K', 'NT_10-Q', 'NT_11-K', 'NT_20-F', 'NT_N-CEN', 'NT_N-MFP', 'NT_N-MFP1', 'NT_N-MFP2', 'NT_NPORT-EX', 'NT_NPORT-P', 'NT-NCEN', 'NT-NCSR', 'NT-NSAR', 'NTFNCEN', 'NTFNCSR', 'NTFNSAR', 'NTN_10D', 'NTN_10K', 'NTN_10Q', 'NTN_20F', 'OIP_NTC', 'OIP_ORDR', 'POS_8C', 'POS_AM', 'POS_AMI', 'POS_EX', 'POS462B', 'POS462C', 'POSASR', 'PRE_14A', 'PRE_14C', 'PREC14A', 'PREC14C', 'PREM14A', 'PREM14C', 'PREN14A', 'PRER14A', 'PRER14C', 'PRRN14A', 'PX14A6G', 'PX14A6N', 'QRTLYRPT', 'QUALIF', 'REG-NR', 'REVOKED', 'RW', 'RW_WD', 'S-1', 'S-11', 'S-11MEF', 'S-1MEF', 'S-20', 'S-3', 'S-3ASR', 'S-3D', 'S-3DPOS', 'S-3MEF', 'S-4', 'S-4_POS', 'S-4EF', 'S-4MEF', 'S-6', 'S-8', 'S-8_POS', 'S-B', 'S-BMEF', 'SBSE', 'SBSE-A', 'SBSE-BD', 'SBSE-C', 'SBSE-W', 'SC_13D', 'SC_13E1', 'SC_13E3', 'SC_13G', 'SC_14D9', 'SC_14F1', 'SC_14N', 'SC_TO-C', 'SC_TO-I', 'SC_TO-T', 'SC13E4F', 'SC14D1F', 'SC14D9C', 'SC14D9F', 'SD', 'SDR', 'SE', 'SEC_ACTION', 'SEC_STAFF_ACTION', 'SEC_STAFF_LETTER', 'SF-1', 'SF-3', 'SL', 'SP_15D2', 'STOP_ORDER', 'SUPPL', 'T-3', 'TA-1', 'TA-2', 'TA-W', 'TACO', 'TH', 'TTW', 'UNDER', 'UPLOAD', 'WDL-REQ', 'X-17A-5']",
"description": "Type of the SEC filing form.",
"default": null,
"optional": true,
@@ -19989,7 +19989,7 @@
"fmp": [
{
"name": "transaction_type",
- "type": "Literal[None, 'award', 'conversion', 'return', 'expire_short', 'in_kind', 'gift', 'expire_long', 'discretionary', 'other', 'small', 'exempt', 'otm', 'purchase', 'sale', 'tender', 'will', 'itm', 'trust']",
+ "type": "Literal['award', 'conversion', 'return', 'expire_short', 'in_kind', 'gift', 'expire_long', 'discretionary', 'other', 'small', 'exempt', 'otm', 'purchase', 'sale', 'tender', 'will', 'itm', 'trust']",
"description": "Type of the transaction.",
"default": null,
"optional": true,
@@ -22573,7 +22573,7 @@
},
{
"name": "sector",
- "type": "Literal['Consumer Cyclical', 'Energy', 'Technology', 'Industrials', 'Financial Services', 'Basic Materials', 'Communication Services', 'Consumer Defensive', 'Healthcare', 'Real Estate', 'Utilities', 'Industrial Goods', 'Financial', 'Services', 'Conglomerates']",
+ "type": "Literal['consumer_cyclical', 'energy', 'technology', 'industrials', 'financial_services', 'basic_materials', 'communication_services', 'consumer_defensive', 'healthcare', 'real_estate', 'utilities', 'industrial_goods', 'financial', 'services', 'conglomerates']",
"description": "Filter by sector.",
"default": null,
"optional": true,
diff --git a/openbb_platform/openbb/package/equity.py b/openbb_platform/openbb/package/equity.py
index c67112ac8a1..922618dae0a 100644
--- a/openbb_platform/openbb/package/equity.py
+++ b/openbb_platform/openbb/package/equity.py
@@ -491,7 +491,7 @@ class ROUTER_equity(Container):
If true, returns only ETFs. (provider: fmp)
is_active : Optional[bool]
If false, returns only inactive tickers. (provider: fmp)
- sector : Optional[Literal['Consumer Cyclical', 'Energy', 'Technology', 'Industrials', 'Financial Services', 'Basic Materials', 'Communication Services', 'Consumer Defensive', 'Healthcare', 'Real Estate', 'Utilities', 'Industrial Goods', 'Financial', 'Services', 'Conglomerates']]
+ sector : Optional[Literal['consumer_cyclical', 'energy', 'technology', 'industrials', 'financial_services', 'basic_materials', 'communication_services', 'consumer_defensive', 'healthcare', 'real_estate', 'utilities', 'industrial_goods', 'financial', 'services', 'conglomerates']]
Filter by sector. (provider: fmp)
industry : Optional[str]
Filter by industry. (provider: fmp)
diff --git a/openbb_platform/openbb/package/equity_estimates.py b/openbb_platform/openbb/package/equity_estimates.py
index efa40206a14..b93d171b6a1 100644
--- a/openbb_platform/openbb/package/equity_estimates.py
+++ b/openbb_platform/openbb/package/equity_estimates.py
@@ -849,11 +849,11 @@ class ROUTER_equity_estimates(Container):
action : Optional[Literal['downgrades', 'maintains', 'reinstates', 'reiterates', 'upgrades', 'assumes', 'initiates', 'terminates', 'removes', 'suspends', 'firm_dissolved']]
Filter by a specific action_company. (provider: benzinga)
analyst_ids : Optional[Union[List[str], str]]
- Comma-separated list of analyst (person) IDs. Omitting will bring back all available analysts. (provider: benzinga)
+ Comma-separated list of analyst (person) IDs. Omitting will bring back all available analysts. Multiple comma separated items allowed. (provider: benzinga)
firm_ids : Optional[Union[List[str], str]]
- Comma-separated list of firm IDs. (provider: benzinga)
+ Comma-separated list of firm IDs. Multiple comma separated items allowed. (provider: benzinga)
fields : Optional[Union[List[str], str]]
- Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. (provider: benzinga)
+ Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. Multiple comma separated items allowed. (provider: benzinga)
with_grade : bool
Include upgrades and downgrades in the response. (provider: fmp)
@@ -955,9 +955,12 @@ class ROUTER_equity_estimates(Container):
extra_params=kwargs,
info={
"symbol": {
- "benzinga": {"multiple_items_allowed": True},
+ "benzinga": ["multiple_items_allowed"],
"fmp": {"multiple_items_allowed": True},
- }
+ },
+ "analyst_ids": {"benzinga": ["multiple_items_allowed"]},
+ "firm_ids": {"benzinga": ["multiple_items_allowed"]},
+ "fields": {"benzinga": ["multiple_items_allowed"]},
},
)
)
diff --git a/openbb_platform/openbb/package/equity_ownership.py b/openbb_platform/openbb/package/equity_ownership.py
index c9806627f8e..e52db83d08b 100644
--- a/openbb_platform/openbb/package/equity_ownership.py
+++ b/openbb_platform/openbb/package/equity_ownership.py
@@ -176,7 +176,7 @@ class ROUTER_equity_ownership(Container):
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
- transaction_type : Literal[None, 'award', 'conversion', 'return', 'expire_short', 'in_kind', 'gift', 'expire_long', 'discretionary', 'other', 'small', 'exempt', 'otm', 'purchase', 'sale', 'tender', 'will', 'itm', 'trust']
+ transaction_type : Optional[Literal['award', 'conversion', 'return', 'expire_short', 'in_kind', 'gift', 'expire_long', 'discretionary', 'other', 'small', 'exempt', 'otm', 'purchase', 'sale', 'tender', 'will', 'itm', 'trust']]
Type of the transaction. (provider: fmp)
start_date : Optional[datetime.date]
Start date of the data, in YYYY-MM-DD format. (provider: intrinio)
diff --git a/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py b/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py
index 49666ac18c5..6dea39fb96f 100644
--- a/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py
+++ b/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py
@@ -48,8 +48,21 @@ class BenzingaPriceTargetQueryParams(PriceTargetQueryParams):
__alias_dict__ = {
"limit": "pagesize",
"symbol": "parameters[tickers]",
+ "date": "parameters[date]",
+ "start_date": "parameters[date_from]",
+ "end_date": "parameters[date_to]",
+ "updated": "parameters[updated]",
+ "importance": "parameters[importance]",
+ "action": "parameters[action]",
+ "analyst_ids": "parameters[analyst_id]",
+ "firm_ids": "parameters[firm_id]",
+ }
+ __json_schema_extra__ = {
+ "symbol": ["multiple_items_allowed"],
+ "analyst_ids": ["multiple_items_allowed"],
+ "firm_ids": ["multiple_items_allowed"],
+ "fields": ["multiple_items_allowed"],
}
- __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}}
page: Optional[int] = Field(
default=0,
@@ -60,17 +73,14 @@ class BenzingaPriceTargetQueryParams(PriceTargetQueryParams):
date: Optional[dateType] = Field(
default=None,
description="Date for calendar data, shorthand for date_from and date_to.",
- alias="parameters[date]",
)
start_date: Optional[dateType] = Field(
default=None,
description=QUERY_DESCRIPTIONS.get("start_date", ""),
- alias="parameters[date_from]",
)
end_date: Optional[dateType] = Field(
default=None,
description=QUERY_DESCRIPTIONS.get("end_date", ""),
- alias="parameters[date_to]",
)
updated: Optional[Union[dateType, int]] = Field(
default=None,
@@ -78,13 +88,11 @@ class BenzingaPriceTargetQueryParams(PriceTargetQueryParams):
+ " This will force the sort order to be Greater Than or Equal to the timestamp indicated."
+ " The date can be a date string or a Unix timestamp."
+ " The date string must be in the format of YYYY-MM-DD.",
- alias="parameters[updated]",
)
importance: Optional[int] = Field(
default=None,
description="Importance level to filter by."
+ " Uses Greater Than or Equal To the importance indicated",
- alias="parameters[importance]",
)
action: Optional[
Literal[
@@ -103,18 +111,15 @@ class BenzingaPriceTargetQueryParams(PriceTargetQueryParams):
] = Field(
default=None,
description="Filter by a specific action_company.",
- alias="parameters[action]",
)
analyst_ids: Optional[Union[List[str], str]] = Field(
default=None,
description="Comma-separated list of analyst (person) IDs."
+ " Omitting will bring back all available analysts.",
- alias="parameters[analyst_id]",
)
firm_ids: Optional[Union[List[str], str]] = Field(
default=None,
description="Comma-separated list of firm IDs.",
- alias="parameters[firm_id]",
)
fields: Optional[Union[List[str], str]] = Field(
default=None,
diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py
index 58579cacaf9..beb23b80785 100644
--- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py
+++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_screener.py
@@ -1,5 +1,7 @@
"""FMP Equity Screener Model."""
+# pylint: disable=unused-argument
+from copy import deepcopy
from typing import Any, Dict, List, Literal, Optional
import pandas as pd
@@ -8,6 +10,7 @@ from openbb_core.provider.standard_models.equity_screener import (
EquityScreenerData,
EquityScreenerQueryParams,
)
+from openbb_core.provider.utils.errors import EmptyDataError
from openbb_fmp.utils.definitions import EXCHANGES, SECTORS
from openbb_fmp.utils.helpers import create_url, get_data
from pydantic import Field
@@ -162,23 +165,26 @@ class FMPEquityScreenerFetcher(
) -> List[Dict]:
"""Return the raw data from the FMP endpoint."""
api_key = credentials.get("fmp_api_key") if credentials else ""
+ _query = deepcopy(query)
+ if _query.sector is not None:
+ _query.sector = _query.sector.replace("_", " ").title()
url = create_url(
version=3,
endpoint="stock-screener",
api_key=api_key,
- query=query,
+ query=_query,
exclude=["query", "is_symbol", "industry"],
).replace(" ", "%20")
- return await get_data(url, **kwargs)
+ return await get_data(url, **kwargs) # type: ignore
@staticmethod
def transform_data(
query: FMPEquityScreenerQueryParams, data: List[Dict], **kwargs: Any
) -> List[FMPEquityScreenerData]:
"""Return the transformed data."""
+ if not data:
+ raise EmptyDataError("The request was returned empty.")
results = pd.DataFrame(data)
- if len(results) == 0:
- return []
if query.industry:
results = results[
results["sector"].str.contains(query.industry, case=False)
diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/insider_trading.py b/openbb_platform/providers/fmp/openbb_fmp/models/insider_trading.py
index f907b821c84..b0309ad79d3 100644
--- a/openbb_platform/providers/fmp/openbb_fmp/models/insider_trading.py
+++ b/openbb_platform/providers/fmp/openbb_fmp/models/insider_trading.py
@@ -1,5 +1,7 @@
"""FMP Insider Trading Model."""
+# pylint: disable=unused-argument
+
import math
from typing import Any, Dict, List, Optional
@@ -19,7 +21,7 @@ class FMPInsiderTradingQueryParams(InsiderTradingQueryParams):
Source: https://site.financialmodelingprep.com/developer/docs/#Stock-Insider-Trading
"""
- transaction_type: TRANSACTION_TYPES = Field(
+ transaction_type: Optional[TRANSACTION_TYPES] = Field(
default=None,
description="Type of the transaction.",
alias="transactionType",
diff --git a/openbb_platform/providers/fmp/openbb_fmp/utils/definitions.py b/openbb_platform/providers/fmp/openbb_fmp/utils/definitions.py
index 970b26db7d5..a558197a5ee 100644
--- a/openbb_platform/providers/fmp/openbb_fmp/utils/definitions.py
+++ b/openbb_platform/providers/fmp/openbb_fmp/utils/definitions.py
@@ -3,21 +3,21 @@
from typing import Literal
SECTORS = Literal[
- "Consumer Cyclical",
- "Energy",
- "Technology",
- "Industrials",
- "Financial Services",
- "Basic Materials",
- "Communication Services",
- "Consumer Defensive",
- "Healthcare",
- "Real Estate",
- "Utilities",
- "Industrial Goods",
- "Financial",
- "Services",
- "Conglomerates",
+ "consumer_cyclical",
+ "energy",
+ "technology",
+ "industrials",
+ "financial_services",
+ "basic_materials",
+ "communication_services",
+ "consumer_defensive",
+ "healthcare",
+ "real_estate",
+ "utilities",
+ "industrial_goods",
+ "financial",
+ "services",
+ "conglomerates",
]
EXCHANGES = Literal[
@@ -142,7 +142,6 @@ MARKETS = Literal[
]
TRANSACTION_TYPES = Literal[
- None,
"award",
"conversion",
"return",
diff --git a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_equity_screener_fetcher.yaml b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_equity_screener_fetcher.yaml
index d0ecd34d58f..86d183d7cc6 100644
--- a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_equity_screener_fetcher.yaml
+++ b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_equity_screener_fetcher.yaml
@@ -3,9 +3,9 @@ interactions:
body: null
headers:
Accept:
- - '*/*'
+ - application/json
Accept-Encoding:
- - gzip, deflate, br
+ - gzip, deflate
Connection:
- keep-alive
method: GET
@@ -13,59 +13,62 @@ interactions:
response:
body:
string: !!binary |
- H4sIAAAAAAAAA9Wc226j3BXH77+nQHMxvZnZ2kc29M52nIMmdlxDMvlU9YKxmQQFgws4M1bV92mf
- 43uxLpyAp7A3PnS7SiJFSsAQ2D/W4b/WIn/9zbL+Ad+W9SFfL76l8Yc/Wx8G/rT34dPL1lm6WAbJ
- ehwsws2utAizLLCGSZg9rK2rZIaqTy6C7CksBsESPkextJm0Bef4dW8ezoo0K0/xcmh1VJTMV3mR
- rcs9N1FsfbQugtwafpxUH/gWFgHsxIhR+3XTMotm5dVQicTrpjjIi16SrIL4LHqO5mEy3xzjvO5+
- TuPV5gakywl35Ovm8OfsMUgeNnc2Dn9Yv6fZk+UV6ezJGla7Gh/1HtOsqFZj/Ls33C7UKnm9j1uv
- vrt8WHyHTd+DOA/rbb1ZET2H8drPgnmUPMD+IluFsPefn1Q4bj/fjpF/oyHiLbO0KKzJ4zqPZkFs
- 3WZBEq0Wlp/BulrnK1gJBSCbMlc6XDqH8Hk9dZNMk4pAhHRiaUIhAlNGuAKKn2ZpUqSHMPG9ewWS
- Qc8okvOpDsd5ecFxlITWdTFX2gZ3BWM2cWn1cO6z9FvTGEVz2BgGLQyICdZEQRHttBCKRGULNQ1K
- uS0JPa2J9EdGeQxvp2MNkOEKiATP1vhOBYPZGBPs2LxaBlMwMG96KyKRUwHSwLCr/VvToA4hrDKn
- U8EYGoeB+tPjeHDswP1K+xC/tJvHZwCCqc3dJhMbOdU2DRNeWULNhBFbUBWSPrjcPIzzTgawOjfj
- 4b1/eg7e2fRaFzTCYJ5FcWxdR4uoCJUhgmHuMFcQcpyfOivPX15lwzIaBJiLRLXC+0ULJonDK692
- Iou46Jsl4Y8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