summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanglewood <85772166+deeleeramone@users.noreply.github.com>2024-04-23 01:49:26 -0700
committerGitHub <noreply@github.com>2024-04-23 08:49:26 +0000
commit99b8597392a2a1af5a9cb303d6c37375aac6605a (patch)
treebb8af3dbed24acf66a1a5604baa35a1bc9797774
parent6b3d6fbe67687579689aa760a312b692ef4b609a (diff)
[Feature] Async SEC (#6319)
* async sec * linters * pylint * annotated results etf holdings * black * pylint doesn't always know best * form_type * unused import * test things * black * ruff * more test params * ? * think this does it * json schema extra --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
-rw-r--r--openbb_platform/core/openbb_core/provider/standard_models/cot_search.py2
-rw-r--r--openbb_platform/core/openbb_core/provider/standard_models/equity_search.py2
-rw-r--r--openbb_platform/extensions/equity/integration/test_equity_api.py14
-rw-r--r--openbb_platform/extensions/equity/integration/test_equity_python.py14
-rw-r--r--openbb_platform/extensions/regulators/integration/test_regulators_api.py4
-rw-r--r--openbb_platform/extensions/regulators/integration/test_regulators_python.py4
-rw-r--r--openbb_platform/openbb/assets/reference.json72
-rw-r--r--openbb_platform/openbb/package/equity.py2
-rw-r--r--openbb_platform/openbb/package/equity_fundamental.py18
-rw-r--r--openbb_platform/openbb/package/equity_shorts.py2
-rw-r--r--openbb_platform/openbb/package/etf.py20
-rw-r--r--openbb_platform/openbb/package/regulators_sec.py10
-rw-r--r--openbb_platform/poetry.lock526
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/cik_map.py14
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/company_filings.py141
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/equity_ftd.py39
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/equity_search.py11
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/etf_holdings.py199
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/form_13FHR.py4
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/institutions_search.py8
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/rss_litigation.py12
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/sic_search.py53
-rw-r--r--openbb_platform/providers/sec/openbb_sec/models/symbol_map.py10
-rw-r--r--openbb_platform/providers/sec/openbb_sec/utils/helpers.py287
-rw-r--r--openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py13
-rw-r--r--openbb_platform/providers/sec/poetry.lock1216
-rw-r--r--openbb_platform/providers/sec/pyproject.toml1
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_cik_map_fetcher.yaml7877
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_company_filings_fetcher.yaml9871
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_equity_ftd_fetcher.yaml47838
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_equity_search_fetcher.yaml7877
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_etf_holdings_fetcher.yaml9144
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_form_13FHR_fetcher.yaml9654
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_institutions_search_fetcher.yaml354186
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_rss_litigation_fetcher.yaml590
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_schema_files_fetcher.yaml2
-rw-r--r--openbb_platform/providers/sec/tests/record/http/test_sec_fetchers/test_sec_sic_search_fetcher.yaml1000
-rw-r--r--openbb_platform/providers/sec/tests/test_sec_fetchers.py46
38 files changed, 225236 insertions, 225547 deletions
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/cot_search.py b/openbb_platform/core/openbb_core/provider/standard_models/cot_search.py
index dbef75ea276..2c0fb635f32 100644
--- a/openbb_platform/core/openbb_core/provider/standard_models/cot_search.py
+++ b/openbb_platform/core/openbb_core/provider/standard_models/cot_search.py
@@ -15,7 +15,7 @@ class CotSearchQueryParams(QueryParams):
query: str = Field(description="Search query.", default="")
use_cache: Optional[bool] = Field(
default=True,
- description="Whether or not to use cache. If True, cache will store for seven days.",
+ description="Whether or not to use cache.",
)
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py b/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py
index 195e99dbeef..725afaee2f5 100644
--- a/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py
+++ b/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py
@@ -28,4 +28,4 @@ class EquitySearchData(Data):
symbol: Optional[str] = Field(
default=None, description=DATA_DESCRIPTIONS.get("symbol", "")
)
- name: str = Field(description="Name of the company.")
+ name: Optional[str] = Field(default=None, description="Name of the company.")
diff --git a/openbb_platform/extensions/equity/integration/test_equity_api.py b/openbb_platform/extensions/equity/integration/test_equity_api.py
index 84aaba03678..8159874b437 100644
--- a/openbb_platform/extensions/equity/integration/test_equity_api.py
+++ b/openbb_platform/extensions/equity/integration/test_equity_api.py
@@ -906,7 +906,7 @@ def test_equity_fundamental_revenue_per_segment(params, headers):
{
"symbol": "AAPL",
"limit": 3,
- "type": "8-K",
+ "form_type": "8-K",
"cik": None,
"provider": "sec",
"use_cache": False,
@@ -916,7 +916,7 @@ def test_equity_fundamental_revenue_per_segment(params, headers):
{
"cik": "0001067983",
"limit": 3,
- "type": "10-Q",
+ "form_type": "10-Q",
"symbol": None,
"provider": "sec",
"use_cache": False,
@@ -1711,7 +1711,15 @@ def test_equity_discovery_filings(params, headers):
"params",
[
({"symbol": "AAPL"}),
- ({"limit": 24, "provider": "sec", "symbol": "AAPL", "skip_reports": 1}),
+ (
+ {
+ "limit": 24,
+ "provider": "sec",
+ "symbol": "AAPL",
+ "skip_reports": 1,
+ "use_cache": False,
+ }
+ ),
],
)
@pytest.mark.integration
diff --git a/openbb_platform/extensions/equity/integration/test_equity_python.py b/openbb_platform/extensions/equity/integration/test_equity_python.py
index 9b0f5bb530d..67ce1c92fca 100644
--- a/openbb_platform/extensions/equity/integration/test_equity_python.py
+++ b/openbb_platform/extensions/equity/integration/test_equity_python.py
@@ -837,7 +837,7 @@ def test_equity_fundamental_revenue_per_segment(params, obb):
{
"symbol": "AAPL",
"limit": 3,
- "type": "8-K",
+ "form_type": "8-K",
"cik": None,
"provider": "sec",
"use_cache": False,
@@ -847,7 +847,7 @@ def test_equity_fundamental_revenue_per_segment(params, obb):
{
"cik": "0001067983",
"limit": 3,
- "type": "10-Q",
+ "form_type": "10-Q",
"symbol": None,
"provider": "sec",
"use_cache": False,
@@ -1598,7 +1598,15 @@ def test_equity_discovery_filings(params, obb):
"params",
[
({"symbol": "AAPL"}),
- ({"limit": 24, "provider": "sec", "symbol": "AAPL", "skip_reports": 1}),
+ (
+ {
+ "limit": 24,
+ "provider": "sec",
+ "symbol": "AAPL",
+ "skip_reports": 1,
+ "use_cache": False,
+ }
+ ),
],
)
@pytest.mark.integration
diff --git a/openbb_platform/extensions/regulators/integration/test_regulators_api.py b/openbb_platform/extensions/regulators/integration/test_regulators_api.py
index 0ea5fa5a8f2..6ce62eec70b 100644
--- a/openbb_platform/extensions/regulators/integration/test_regulators_api.py
+++ b/openbb_platform/extensions/regulators/integration/test_regulators_api.py
@@ -25,8 +25,8 @@ def headers():
@parametrize(
"params",
[
- ({"symbol": "TSLA", "provider": "sec"}),
- ({"symbol": "SQQQ", "provider": "sec"}),
+ ({"symbol": "TSLA", "provider": "sec", "use_cache": None}),
+ ({"symbol": "SQQQ", "provider": "sec", "use_cache": None}),
],
)
@pytest.mark.integration
diff --git a/openbb_platform/extensions/regulators/integration/test_regulators_python.py b/openbb_platform/extensions/regulators/integration/test_regulators_python.py
index 77c2e811f53..dada51ff7b2 100644
--- a/openbb_platform/extensions/regulators/integration/test_regulators_python.py
+++ b/openbb_platform/extensions/regulators/integration/test_regulators_python.py
@@ -22,8 +22,8 @@ def obb(pytestconfig):
@parametrize(
"params",
[
- ({"symbol": "TSLA", "provider": "sec"}),
- ({"symbol": "SQQQ", "provider": "sec"}),
+ ({"symbol": "TSLA", "provider": "sec", "use_cache": None}),
+ ({"symbol": "SQQQ", "provider": "sec", "use_cache": None}),
],
)
@pytest.mark.integration
diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json
index 279f31fc8cd..3d8781d622c 100644
--- a/openbb_platform/openbb/assets/reference.json
+++ b/openbb_platform/openbb/assets/reference.json
@@ -16024,19 +16024,12 @@
"sec": [
{
"name": "cik",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "Lookup filings by Central Index Key (CIK) instead of by symbol.",
"default": null,
"optional": true
},
{
- "name": "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']",
- "description": "Type of the SEC filing form.",
- "default": null,
- "optional": true
- },
- {
"name": "use_cache",
"type": "bool",
"description": "Whether or not to use cache. If True, cache will store for one day.",
@@ -16181,7 +16174,7 @@
},
{
"name": "act",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "The SEC Act number.",
"default": null,
"optional": true
@@ -16209,42 +16202,42 @@
},
{
"name": "accession_number",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "The accession number.",
"default": null,
"optional": true
},
{
"name": "file_number",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "The file number.",
"default": null,
"optional": true
},
{
"name": "film_number",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "The film number.",
"default": null,
"optional": true
},
{
"name": "is_inline_xbrl",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "Whether the filing is an inline XBRL filing.",
"default": null,
"optional": true
},
{
"name": "is_xbrl",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "Whether the filing is an XBRL filing.",
"default": null,
"optional": true
},
{
"name": "size",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "The size of the filing.",
"default": null,
"optional": true
@@ -19183,6 +19176,13 @@
"description": "Skip N number of reports from current. A value of 1 will skip the most recent report.",
"default": 0,
"optional": true
+ },
+ {
+ "name": "use_cache",
+ "type": "bool",
+ "description": "Whether or not to use cache for the request, default is True. Each reporting period is a separate URL, new reports will be added to the cache.",
+ "default": true,
+ "optional": true
}
]
},
@@ -19370,8 +19370,8 @@
"name": "name",
"type": "str",
"description": "Name of the company.",
- "default": "",
- "optional": false
+ "default": null,
+ "optional": true
}
],
"intrinio": [
@@ -23589,7 +23589,7 @@
{
"name": "rate_type_rec",
"type": "str",
- "description": "The type of rate for reveivable portion of the swap.",
+ "description": "The type of rate for receivable portion of the swap.",
"default": null,
"optional": true
},
@@ -23610,7 +23610,7 @@
{
"name": "floating_rate_index_rec",
"type": "str",
- "description": "The floating rate index for reveivable portion of the swap.",
+ "description": "The floating rate index for receivable portion of the swap.",
"default": null,
"optional": true
},
@@ -23624,28 +23624,28 @@
{
"name": "rate_tenor_rec",
"type": "str",
- "description": "The rate tenor for reveivable portion of the swap.",
+ "description": "The rate tenor for receivable portion of the swap.",
"default": null,
"optional": true
},
{
"name": "rate_tenor_unit_rec",
- "type": "Union[int, str]",
- "description": "The rate tenor unit for reveivable portion of the swap.",
+ "type": "Union[str, int]",
+ "description": "The rate tenor unit for receivable portion of the swap.",
"default": null,
"optional": true
},
{
"name": "reset_date_rec",
"type": "str",
- "description": "The reset date for reveivable portion of the swap.",
+ "description": "The reset date for receivable portion of the swap.",
"default": null,
"optional": true
},
{
"name": "reset_date_unit_rec",
- "type": "Union[int, str]",
- "description": "The reset date unit for reveivable portion of the swap.",
+ "type": "Union[str, int]",
+ "description": "The reset date unit for receivable portion of the swap.",
"default": null,
"optional": true
},
@@ -23693,7 +23693,7 @@
},
{
"name": "rate_tenor_unit_pmnt",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "The rate tenor unit for payment portion of the swap.",
"default": null,
"optional": true
@@ -23707,7 +23707,7 @@
},
{
"name": "reset_date_unit_pmnt",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "The reset date unit for payment portion of the swap.",
"default": null,
"optional": true
@@ -27403,7 +27403,15 @@
"optional": true
}
],
- "sec": []
+ "sec": [
+ {
+ "name": "use_cache",
+ "type": "bool",
+ "description": "Whether or not to use cache for the request, default is True.",
+ "default": true,
+ "optional": true
+ }
+ ]
},
"returns": {
"OBBject": [
@@ -27467,7 +27475,7 @@
{
"name": "use_cache",
"type": "bool",
- "description": "Whether or not to use cache. If True, cache will store for seven days.",
+ "description": "Whether or not to use cache.",
"default": true,
"optional": true
},
@@ -27522,7 +27530,7 @@
},
{
"name": "cik",
- "type": "Union[int, str]",
+ "type": "Union[str, int]",
"description": "Central Index Key (CIK)",
"default": null,
"optional": true
@@ -27550,7 +27558,7 @@
{
"name": "use_cache",
"type": "bool",
- "description": "Whether or not to use cache. If True, cache will store for seven days.",
+ "description": "Whether or not to use cache.",
"default": true,
"optional": true
},
@@ -27800,7 +27808,7 @@
{
"name": "use_cache",
"type": "bool",
- "description": "Whether or not to use cache. If True, cache will store for seven days.",
+ "description": "Whether or not to use cache.",
"default": true,
"optional": true
},
diff --git a/openbb_platform/openbb/package/equity.py b/openbb_platform/openbb/package/equity.py
index a044ac60f54..07564859dbb 100644
--- a/openbb_platform/openbb/package/equity.py
+++ b/openbb_platform/openbb/package/equity.py
@@ -624,7 +624,7 @@ class ROUTER_equity(Container):
------------
symbol : Optional[str]
Symbol representing the entity requested in the data.
- name : str
+ name : Optional[str]
Name of the company.
cik : Optional[str]