summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanglewood <85772166+deeleeramone@users.noreply.github.com>2024-11-16 03:44:22 -0800
committerGitHub <noreply@github.com>2024-11-16 11:44:22 +0000
commit79b1e47854782dc25f71fd0a3ebf2a56c3a2200c (patch)
tree3040639d4bad35c8592400c08be491c3cb4e8ffe
parent804534ed31bbddd8c8ff4b3f7bb12a5ce3455787 (diff)
[BugFix] Fix `openbb-yfinance` for `equity.discovery` Functions (#6945)HEADdevelop
* fix yfinance discovery * type-arg * pylint * recapture python 3.10+ tests * recapture all the urllib3_v2 cassettes
-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/openbb/assets/reference.json991
-rw-r--r--openbb_platform/openbb/package/equity_discovery.py282
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/models/active.py85
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/models/aggressive_small_caps.py113
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/models/gainers.py92
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/models/growth_tech_equities.py88
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/models/losers.py89
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/models/undervalued_growth_equities.py88
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/models/undervalued_large_caps.py88
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/utils/helpers.py111
-rw-r--r--openbb_platform/providers/yfinance/openbb_yfinance/utils/references.py131
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_active_fetcher_urllib3_v1.yaml20193
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_active_fetcher_urllib3_v2.yaml8432
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_aggressive_small_caps_fetcher_urllib3_v1.yaml20149
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_aggressive_small_caps_fetcher_urllib3_v2.yaml8491
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_balance_sheet_fetcher_urllib3_v2.yaml8
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_cash_flow_statement_fetcher_urllib3_v2.yaml10
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_company_news_fetcher_urllib3_v2.yaml117
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_crypto_historical_fetcher_urllib3_v2.yaml44
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_currency_historical_fetcher_urllib3_v2.yaml18
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_equity_historical_fetcher_urllib3_v2.yaml24
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_equity_profile_fetcher_urllib3_v2.yaml58
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_equity_quote_fetcher_urllib3_v2.yaml54
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_etf_info_fetcher_urllib3_v2.yaml22
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_futures_historical_fetcher_urllib3_v2.yaml22
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_gainers_fetcher_urllib3_v1.yaml20186
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_gainers_fetcher_urllib3_v2.yaml8472
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_growth_tech_equities_fetcher_urllib3_v1.yaml18850
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_growth_tech_equities_fetcher_urllib3_v2.yaml7780
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_historical_dividends_fetcher_urllib3_v2.yaml24
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_income_statement_fetcher_urllib3_v2.yaml8
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_index_historical_fetcher_urllib3_v2.yaml24
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_key_executives_fetcher_urllib3_v2.yaml48
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_key_metrics_fetcher_urllib3_v2.yaml48
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_losers_fetcher_urllib3_v1.yaml20179
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_losers_fetcher_urllib3_v2.yaml8488
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_market_indices_fetcher_urllib3_v2.yaml8
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_options_chains_fetcher_urllib3_v2.yaml739
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_price_target_consensus_fetcher_urllib3_v2.yaml52
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_share_statistics_fetcher_urllib3_v2.yaml95
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_growth_equities_fetcher_urllib3_v1.yaml20229
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_growth_equities_fetcher_urllib3_v2.yaml8474
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_large_caps_fetcher_urllib3_v1.yaml20237
-rw-r--r--openbb_platform/providers/yfinance/tests/record/http/test_yfinance_fetchers/test_y_finance_undervalued_large_caps_fetcher_urllib3_v2.yaml8460
-rw-r--r--openbb_platform/providers/yfinance/tests/test_yfinance_fetchers.py14
47 files changed, 10283 insertions, 191960 deletions
diff --git a/openbb_platform/extensions/equity/integration/test_equity_api.py b/openbb_platform/extensions/equity/integration/test_equity_api.py
index 81c4a49d81c..299eb328d45 100644
--- a/openbb_platform/extensions/equity/integration/test_equity_api.py
+++ b/openbb_platform/extensions/equity/integration/test_equity_api.py
@@ -1537,7 +1537,7 @@ def test_equity_profile(params, headers):
@parametrize(
"params",
[
- ({"sort": "desc", "provider": "yfinance"}),
+ ({"sort": "desc", "provider": "yfinance", "limit": 10}),
({"provider": "tmx", "category": "52w_high"}),
],
)
@@ -1555,7 +1555,7 @@ def test_equity_discovery_gainers(params, headers):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_losers(params, headers):
@@ -1571,7 +1571,7 @@ def test_equity_discovery_losers(params, headers):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_active(params, headers):
@@ -1606,7 +1606,7 @@ def test_equity_price_performance(params, headers):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_undervalued_large_caps(params, headers):
@@ -1622,7 +1622,7 @@ def test_equity_discovery_undervalued_large_caps(params, headers):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_undervalued_growth(params, headers):
@@ -1638,7 +1638,7 @@ def test_equity_discovery_undervalued_growth(params, headers):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_aggressive_small_caps(params, headers):
@@ -1656,7 +1656,7 @@ def test_equity_discovery_aggressive_small_caps(params, headers):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_growth_tech(params, headers):
diff --git a/openbb_platform/extensions/equity/integration/test_equity_python.py b/openbb_platform/extensions/equity/integration/test_equity_python.py
index f53f86df118..c47f4f91920 100644
--- a/openbb_platform/extensions/equity/integration/test_equity_python.py
+++ b/openbb_platform/extensions/equity/integration/test_equity_python.py
@@ -1465,7 +1465,7 @@ def test_equity_profile(params, obb):
@parametrize(
"params",
[
- ({"sort": "desc", "provider": "yfinance"}),
+ ({"sort": "desc", "provider": "yfinance", "limit": 10}),
({"provider": "tmx", "category": "52w_high"}),
],
)
@@ -1482,7 +1482,7 @@ def test_equity_discovery_gainers(params, obb):
@parametrize(
"params",
- [({"sort": "desc"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_losers(params, obb):
@@ -1497,7 +1497,7 @@ def test_equity_discovery_losers(params, obb):
@parametrize(
"params",
- [({"sort": "desc"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_active(params, obb):
@@ -1530,7 +1530,7 @@ def test_equity_price_performance(params, obb):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_undervalued_large_caps(params, obb):
@@ -1545,7 +1545,7 @@ def test_equity_discovery_undervalued_large_caps(params, obb):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_undervalued_growth(params, obb):
@@ -1560,7 +1560,7 @@ def test_equity_discovery_undervalued_growth(params, obb):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_aggressive_small_caps(params, obb):
@@ -1575,7 +1575,7 @@ def test_equity_discovery_aggressive_small_caps(params, obb):
@parametrize(
"params",
- [({"sort": "desc", "provider": "yfinance"})],
+ [({"sort": "desc", "provider": "yfinance", "limit": 10})],
)
@pytest.mark.integration
def test_equity_discovery_growth_tech(params, obb):
diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json
index bb1c239353f..590301883f0 100644
--- a/openbb_platform/openbb/assets/reference.json
+++ b/openbb_platform/openbb/assets/reference.json
@@ -14365,7 +14365,16 @@
"choices": null
}
],
- "yfinance": []
+ "yfinance": [
+ {
+ "name": "limit",
+ "type": "int",
+ "description": "Limit the number of results.",
+ "default": 200,
+ "optional": true,
+ "choices": null
+ }
+ ]
},
"returns": {
"OBBject": [
@@ -14449,9 +14458,65 @@
],
"yfinance": [
{
- "name": "avg_volume_3_months",
+ "name": "open",
+ "type": "float",
+ "description": "Open price for the day.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "high",
+ "type": "float",
+ "description": "High price for the day.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "low",
+ "type": "float",
+ "description": "Low price for the day.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "previous_close",
+ "type": "float",
+ "description": "Previous close price.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "ma50",
+ "type": "float",
+ "description": "50-day moving average.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "ma200",
+ "type": "float",
+ "description": "200-day moving average.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "year_high",
+ "type": "float",
+ "description": "52-week high.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "year_low",
"type": "float",
- "description": "Average volume over the last 3 months in millions.",
+ "description": "52-week low.",
"default": null,
"optional": true,
"choices": null
@@ -14465,9 +14530,73 @@
"choices": null
},
{
- "name": "pe_ratio_ttm",
+ "name": "shares_outstanding",
+ "type": "float",
+ "description": "Shares outstanding.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "book_value",
+ "type": "float",
+ "description": "Book value per share.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "price_to_book",
+ "type": "float",
+ "description": "Price to book ratio.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+