Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding the fixedincome menu #5655

Merged
merged 48 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fe33c01
models and fetcher
hjoaquim Oct 31, 2023
501743a
making the fetcher visible
hjoaquim Oct 31, 2023
fddd795
std model
hjoaquim Oct 31, 2023
80c8c10
adding the command
hjoaquim Oct 31, 2023
68fb276
improvements to the models
hjoaquim Oct 31, 2023
3e27b30
typo
hjoaquim Oct 31, 2023
f59801f
adding the command
hjoaquim Oct 31, 2023
e176bdf
imrpovements to dwpcr
hjoaquim Oct 31, 2023
64935be
standard model for ecb int rates
hjoaquim Oct 31, 2023
eab3fed
adding the fetcher for fred
hjoaquim Oct 31, 2023
0549f58
standard model of ice bofa
hjoaquim Oct 31, 2023
3e0f6fa
add ice_bofa command
hjoaquim Oct 31, 2023
18c6660
ruff
hjoaquim Oct 31, 2023
b6e80eb
ice bofa fetcher
hjoaquim Oct 31, 2023
d331242
moody std model
hjoaquim Oct 31, 2023
d22ec22
moody
hjoaquim Oct 31, 2023
e4869f8
Merge branch 'feature/openbb-sdk-v4' into feature/v4-fixedincome
hjoaquim Nov 2, 2023
5e30e67
std model
hjoaquim Nov 2, 2023
4234e14
add cp command
hjoaquim Nov 2, 2023
d8679ac
unused import
hjoaquim Nov 2, 2023
0e5dbb5
cp
hjoaquim Nov 2, 2023
0e3db54
spot
hjoaquim Nov 2, 2023
d3ae9c4
ruff
hjoaquim Nov 2, 2023
163df35
hqm
hjoaquim Nov 2, 2023
86e804e
tmc
hjoaquim Nov 2, 2023
9476730
ffrmc
hjoaquim Nov 2, 2023
d7f0d4a
tbffr
hjoaquim Nov 2, 2023
f730b67
ruff
hjoaquim Nov 2, 2023
d161b72
typing fixes
hjoaquim Nov 2, 2023
bd2d781
buggy dates
hjoaquim Nov 2, 2023
fdff4db
fred fetcher tests
hjoaquim Nov 2, 2023
e473fbc
ruff
hjoaquim Nov 2, 2023
3789494
Merge branch 'feature/openbb-sdk-v4' into feature/v4-fixedincome
hjoaquim Nov 3, 2023
418eb0b
adding ecb as a provider
hjoaquim Nov 3, 2023
86808a5
adding new provider related stuff
hjoaquim Nov 3, 2023
9d300e2
adding the new command eu_ycvr
hjoaquim Nov 3, 2023
bc30b43
models
hjoaquim Nov 3, 2023
23271d5
test for ecb fetcher
hjoaquim Nov 3, 2023
aa357c9
Feature/v4 fixedincome int tests (#5661)
hjoaquim Nov 3, 2023
45787de
mini adjustment
hjoaquim Nov 3, 2023
dae9443
ruff
hjoaquim Nov 3, 2023
ba4797e
Merge branch 'feature/openbb-sdk-v4' into feature/v4-fixedincome
hjoaquim Nov 6, 2023
0bc066f
typo
hjoaquim Nov 6, 2023
5def9b8
verbose type
hjoaquim Nov 6, 2023
56ee437
fix tests
hjoaquim Nov 6, 2023
a892ada
docstrings everywhere and an happy pydocstyle
hjoaquim Nov 6, 2023
c14228c
Merge branch 'feature/openbb-sdk-v4' into feature/v4-fixedincome
hjoaquim Nov 6, 2023
22f0936
fix tests
hjoaquim Nov 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openbb_platform/dev_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
openbb-nasdaq = { path = "./providers/nasdaq", optional = true, develop = true }
openbb-quandl = { path = "./providers/quandl", optional = true, develop = true }
openbb-yfinance = { path = "./providers/yfinance", optional = true, develop = true }
openbb-ecb = { path = "./providers/ecb", optional = true, develop = true }

openbb-charting = { path = "./extensions/charting", optional = true, develop = true }
openbb-futures = { path = "./extensions/futures", optional = true, develop = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,221 @@ def test_fixedincome_iorb(params, headers):
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[
({"start_date": "2023-01-01", "end_date": "2023-06-06"}),
(
{
"parameter": "daily_excl_weekend",
"provider": "fred",
"start_date": "2023-01-01",
"end_date": "2023-06-06",
}
),
],
)
@pytest.mark.integration
def test_fixedincome_dwpcr(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/dwpcr?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[({"start_date": "2023-01-01", "end_date": "2023-06-06", "type_": "lending"})],
)
@pytest.mark.integration
def test_fixedincome_ecb_interest_rates(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/ecb_interest_rates?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[
({"start_date": "2023-01-01", "end_date": "2023-06-06", "type_": "yield"}),
(
{
"category": "all",
"area": "us",
"grade": "non_sovereign",
"options": True,
"provider": "fred",
"start_date": "2023-01-01",
"end_date": "2023-06-06",
"type_": "yield",
}
),
],
)
@pytest.mark.integration
def test_fixedincome_ice_bofa(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/ice_bofa?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[({"start_date": "2023-01-01", "end_date": "2023-06-06", "type_": "aaa"})],
)
@pytest.mark.integration
def test_fixedincome_moody(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/moody?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[
(
{
"start_date": "2023-01-01",
"end_date": "2023-06-06",
"maturity": "30d",
"category": "financial",
"grade": "aa",
}
)
],
)
@pytest.mark.integration
def test_fixedincome_cp(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/cp?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[
(
{
"start_date": "2023-01-01",
"end_date": "2023-06-06",
"maturity": [10.0],
"category": ["spot_rate"],
}
)
],
)
@pytest.mark.integration
def test_fixedincome_spot(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/spot?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[({"date": "2023-01-01", "yield_curve": ["spot"]})],
)
@pytest.mark.integration
def test_fixedincome_hqm(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/hqm?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[({"start_date": "2023-01-01", "end_date": "2023-06-06", "maturity": "3m"})],
)
@pytest.mark.integration
def test_fixedincome_tmc(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/tmc?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[({"start_date": "2023-01-01", "end_date": "2023-06-06", "maturity": "10y"})],
)
@pytest.mark.integration
def test_fixedincome_ffrmc(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/ffrmc?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[({"start_date": "2023-01-01", "end_date": "2023-06-06", "maturity": "3m"})],
)
@pytest.mark.integration
def test_fixedincome_tbffr(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/tbffr?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[
({"date": "2023-01-01", "type_": "spot_rate"}),
(
{
"rating": "A",
"provider": "ecb",
"date": "2023-01-01",
"type_": "spot_rate",
}
),
],
)
@pytest.mark.integration
def test_fixedincome_eu_ycrv(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/fixedincome/eu_ycrv?{query_str}"
result = requests.get(url, headers=headers, timeout=30)
assert isinstance(result, requests.Response)
assert result.status_code == 200
Loading