[Enhancement]: Add TMX data provider extension. (#5913)

* dev install

* add TMX provider extension

* normalize ytm and coupopn_rate values

* black

* codespell

* ruff

* black again

* pylint

* ftw

* undo what Pylint thinks is best

* more black

* renovate insider_trading standard model

* fix tests

* typo

* tests

* empty string

* pylint unused argument

* nans for some reason

* black

* static files

* static files with openbb-tmx installed this time

* yfinance TypeError..?

* NA -> N/A

* update for version bump

* list exchange-calendars as tmx dependency

* eod chains date -> eod_date

* new line

* not that file

* more black

* one more black

* fix weird merge thing

* ruff

* index constituents params

* insider trading

* fixing things

* black

* black AGAIN

* news integration params

* the other missing param

* ruff

* historical dividends field update

* add json_schema_extra

* gainers

* symbols -> symbol

* company news symbol

* unit test param

* review items

* wrangle a rogue field

* index router example

* company news thing - symbols -> symbol

* field name map

---------

Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
Danglewood
2024-02-20 06:41:26 -08:00
committed by GitHub
parent 7d84690316
commit fe3fa6af8e
90 changed files with 256717 additions and 483 deletions

View File

@@ -21,8 +21,9 @@ def obb(pytestconfig): # pylint: disable=inconsistent-return-statements
@parametrize(
"params",
[
({"index": "dowjones", "provider": "fmp"}),
({"index": "BUKBUS", "provider": "cboe"}),
({"symbol": "dowjones", "provider": "fmp"}),
({"symbol": "BUKBUS", "provider": "cboe"}),
({"symbol": "^TX60", "provider": "tmx", "use_cache": False}),
],
)
@pytest.mark.integration
@@ -275,6 +276,7 @@ def test_index_market(params, obb):
({"provider": "cboe", "use_cache": False}),
({"provider": "fmp"}),
({"provider": "yfinance"}),
({"provider": "tmx", "use_cache": False}),
],
)
@pytest.mark.integration
@@ -288,7 +290,14 @@ def test_index_available(params, obb):
@parametrize(
"params",
[
({"query": "D", "is_symbol": True, "use_cache": False, "provider": "cboe"}),
(
{
"query": "D",
"is_symbol": True,
"provider": "cboe",
"use_cache": False,
}
),
],
)
@pytest.mark.integration
@@ -303,6 +312,7 @@ def test_index_search(params, obb):
"params",
[
({"region": "us", "provider": "cboe"}),
({"provider": "tmx", "region": "ca", "use_cache": False}),
],
)
@pytest.mark.integration
@@ -334,3 +344,17 @@ def test_index_sp500_multiples(params, obb):
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
@parametrize(
"params",
[
({"symbol": "^TX60", "provider": "tmx"}),
],
)
@pytest.mark.integration
def test_index_sectors(params, obb):
result = obb.index.sectors(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0