summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanglewood <85772166+deeleeramone@users.noreply.github.com>2024-06-11 17:47:39 -0700
committerDanglewood <85772166+deeleeramone@users.noreply.github.com>2024-06-11 17:47:39 -0700
commit3c392c80d4e54cc071959386145edce0a8b2ac8a (patch)
tree0b417904e30b2dfbee5df435b34c986658a68004
parentee2738e92c1fdbc1104e14860b4d51041a27bdb4 (diff)
estr
-rw-r--r--openbb_platform/core/openbb_core/provider/standard_models/estr_rates.py33
-rw-r--r--openbb_platform/core/openbb_core/provider/standard_models/euro_short_term_rate.py67
-rw-r--r--openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py5
-rw-r--r--openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py5
-rw-r--r--openbb_platform/extensions/fixedincome/openbb_fixedincome/rate/rate_router.py6
-rw-r--r--openbb_platform/openbb/assets/reference.json111
-rw-r--r--openbb_platform/openbb/package/fixedincome_rate.py65
-rw-r--r--openbb_platform/providers/fred/openbb_fred/__init__.py4
-rw-r--r--openbb_platform/providers/fred/openbb_fred/models/estr_rates.py81
-rw-r--r--openbb_platform/providers/fred/openbb_fred/models/euro_short_term_rate.py193
-rw-r--r--openbb_platform/providers/fred/tests/record/http/test_fred_fetchers/test_fred_euro_short_term_rate_fetcher.yaml785
-rw-r--r--openbb_platform/providers/fred/tests/record/http/test_fred_fetchers/test_fredestr_fetcher.yaml179
-rw-r--r--openbb_platform/providers/fred/tests/test_fred_fetchers.py13
13 files changed, 1221 insertions, 326 deletions
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/estr_rates.py b/openbb_platform/core/openbb_core/provider/standard_models/estr_rates.py
deleted file mode 100644
index 0745183360c..00000000000
--- a/openbb_platform/core/openbb_core/provider/standard_models/estr_rates.py
+++ /dev/null
@@ -1,33 +0,0 @@
-"""ESTR Standard Model."""
-
-from datetime import date as dateType
-from typing import Optional
-
-from pydantic import Field
-
-from openbb_core.provider.abstract.data import Data
-from openbb_core.provider.abstract.query_params import QueryParams
-from openbb_core.provider.utils.descriptions import (
- DATA_DESCRIPTIONS,
- QUERY_DESCRIPTIONS,
-)
-
-
-class ESTRQueryParams(QueryParams):
- """ESTR Query."""
-
- start_date: Optional[dateType] = Field(
- default=None,
- description=QUERY_DESCRIPTIONS.get("start_date", ""),
- )
- end_date: Optional[dateType] = Field(
- default=None,
- description=QUERY_DESCRIPTIONS.get("end_date", ""),
- )
-
-
-class ESTRData(Data):
- """ESTR Data."""
-
- date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", ""))
- rate: Optional[float] = Field(description="ESTR rate.")
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/euro_short_term_rate.py b/openbb_platform/core/openbb_core/provider/standard_models/euro_short_term_rate.py
new file mode 100644
index 00000000000..9b69c9a47a7
--- /dev/null
+++ b/openbb_platform/core/openbb_core/provider/standard_models/euro_short_term_rate.py
@@ -0,0 +1,67 @@
+"""Euro Short Term Rate Standard Model."""
+
+from datetime import date as dateType
+from typing import Optional
+
+from pydantic import Field
+
+from openbb_core.provider.abstract.data import Data
+from openbb_core.provider.abstract.query_params import QueryParams
+from openbb_core.provider.utils.descriptions import (
+ DATA_DESCRIPTIONS,
+ QUERY_DESCRIPTIONS,
+)
+
+
+class EuroShortTermRateQueryParams(QueryParams):
+ """Euro Short Term Rate Query."""
+
+ start_date: Optional[dateType] = Field(
+ default=None,
+ description=QUERY_DESCRIPTIONS.get("start_date", ""),
+ )
+ end_date: Optional[dateType] = Field(
+ default=None,
+ description=QUERY_DESCRIPTIONS.get("end_date", ""),
+ )
+
+
+class EuroShortTermRateData(Data):
+ """Euro Short Term Rate Data."""
+
+ date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", ""))
+ rate: float = Field(
+ description="Volume-weighted trimmed mean rate.",
+ json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
+ )
+ percentile_25: Optional[float] = Field(
+ default=None,
+ description="Rate at 25th percentile of volume.",
+ json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
+ )
+ percentile_75: Optional[float] = Field(
+ default=None,
+ description="Rate at 75th percentile of volume.",
+ json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
+ )
+ volume: Optional[float] = Field(
+ default=None,
+ description="Volume (Millions of €EUR).",
+ json_schema_extra={
+ "x-unit_measurement": "currency",
+ "x-frontend_multiply": 1e6,
+ },
+ )
+ transactions: Optional[int] = Field(
+ default=None,
+ description="Number of transactions.",
+ )
+ number_of_banks: Optional[int] = Field(
+ default=None,
+ description="Number of active banks.",
+ )
+ large_bank_share_of_volume: Optional[float] = Field(
+ default=None,
+ description="The percent of volume attributable to the 5 largest active banks.",
+ json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
+ )
diff --git a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py
index 46253351646..95c9eb542e6 100644
--- a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py
+++ b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py
@@ -128,13 +128,14 @@ def test_fixedincome_rate_sofr(params, headers):
@parametrize(
"params",
[
- ({"start_date": "2023-01-01", "end_date": "2023-06-06"}),
(
{
- "parameter": "volume_weighted_trimmed_mean_rate",
"provider": "fred",
"start_date": "2023-01-01",
"end_date": "2023-06-06",
+ "transform": None,
+ "aggregation_method": None,
+ "frequency": None,
}
),
],
diff --git a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py
index 3757ff084dc..988358b931e 100644
--- a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py
+++ b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py
@@ -113,13 +113,14 @@ def test_fixedincome_rate_sofr(params, obb):
@parametrize(
"params",
[
- ({"start_date": "2023-01-01", "end_date": "2023-06-06"}),
(
{
- "parameter": "volume_weighted_trimmed_mean_rate",
"provider": "fred",
"start_date": "2023-01-01",
"end_date": "2023-06-06",
+ "transform": None,
+ "aggregation_method": None,
+ "frequency": None,
}
),
],
diff --git a/openbb_platform/extensions/fixedincome/openbb_fixedincome/rate/rate_router.py b/openbb_platform/extensions/fixedincome/openbb_fixedincome/rate/rate_router.py
index adca399dd24..8da16c767d6 100644
--- a/openbb_platform/extensions/fixedincome/openbb_fixedincome/rate/rate_router.py
+++ b/openbb_platform/extensions/fixedincome/openbb_fixedincome/rate/rate_router.py
@@ -147,10 +147,10 @@ async def effr_forecast(
@router.command(
- model="ESTR",
+ model="EuroShortTermRate",
examples=[
APIEx(parameters={"provider": "fred"}),
- APIEx(parameters={"parameter": "number_of_active_banks", "provider": "fred"}),
+ APIEx(parameters={"transform": "ch1", "provider": "fred"}),
],
)
async def estr(
@@ -164,7 +164,7 @@ async def estr(
The euro short-term rate (€STR) reflects the wholesale euro unsecured overnight borrowing costs of banks located in
the euro area. The €STR is published on each TARGET2 business day based on transactions conducted and settled on
the previous TARGET2 business day (the reporting date “T”) with a maturity date of T+1 which are deemed to have been
- executed at arm’s length and thus reflect market rates in an unbiased way.
+ executed at arm's length and thus reflect market rates in an unbiased way.
"""
return await OBBject.from_query(Query(**locals()))
diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json
index afe0010fe81..5e09aba3d07 100644
--- a/openbb_platform/openbb/assets/reference.json
+++ b/openbb_platform/openbb/assets/reference.json
@@ -30819,8 +30819,8 @@
"flag": null,
"message": null
},
- "description": "Euro Short-Term Rate.\n\nThe euro short-term rate (\u20acSTR) reflects the wholesale euro unsecured overnight borrowing costs of banks located in\nthe euro area. The \u20acSTR is published on each TARGET2 business day based on transactions conducted and settled on\nthe previous TARGET2 business day (the reporting date \u201cT\u201d) with a maturity date of T+1 which are deemed to have been\nexecuted at arm\u2019s length and thus reflect market rates in an unbiased way.",
- "examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.fixedincome.rate.estr(provider='fred')\nobb.fixedincome.rate.estr(parameter=number_of_active_banks, provider='fred')\n```\n\n",
+ "description": "Euro Short-Term Rate.\n\nThe euro short-term rate (\u20acSTR) reflects the wholesale euro unsecured overnight borrowing costs of banks located in\nthe euro area. The \u20acSTR is published on each TARGET2 business day based on transactions conducted and settled on\nthe previous TARGET2 business day (the reporting date \u201cT\u201d) with a maturity date of T+1 which are deemed to have been\nexecuted at arm's length and thus reflect market rates in an unbiased way.",
+ "examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.fixedincome.rate.estr(provider='fred')\nobb.fixedincome.rate.estr(transform=ch1, provider='fred')\n```\n\n",
"parameters": {
"standard": [
{
@@ -30849,12 +30849,55 @@
],
"fred": [
{
- "name": "parameter",
- "type": "Literal['volume_weighted_trimmed_mean_rate', 'number_of_transactions', 'number_of_active_banks', 'total_volume', 'share_of_volume_of_the_5_largest_active_banks', 'rate_at_75th_percentile_of_volume', 'rate_at_25th_percentile_of_volume']",
- "description": "Period of ESTR rate.",
- "default": "volume_weighted_trimmed_mean_rate",
+ "name": "frequency",
+ "type": "Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']",
+ "description": "Frequency aggregation to convert daily data to lower frequency. a = Annual q = Quarterly m = Monthly w = Weekly wef = Weekly, Ending Friday weth = Weekly, Ending Thursday wew = Weekly, Ending Wednesday wetu = Weekly, Ending Tuesday wem = Weekly, Ending Monday wesu = Weekly, Ending Sunday wesa = Weekly, Ending Saturday bwew = Biweekly, Ending Wednesday bwem = Biweekly, Ending Monday",
+ "default": null,
"optional": true,
- "choices": null
+ "choices": [
+ "a",
+ "q",
+ "m",
+ "w",
+ "wef",
+ "weth",
+ "wew",
+ "wetu",
+ "wem",
+ "wesu",
+ "wesa",
+ "bwew",
+ "bwem"
+ ]
+ },
+ {
+ "name": "aggregation_method",
+ "type": "Literal['avg', 'sum', 'eop']",
+ "description": "A key that indicates the aggregation method used for frequency aggregation. avg = Average sum = Sum eop = End of Period",
+ "default": null,
+ "optional": true,
+ "choices": [
+ "avg",
+ "sum",
+ "eop"
+ ]
+ },
+ {
+ "name": "transform",
+ "type": "Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']",
+ "description": "Transformation type None = No transformation chg = Change ch1 = Change from Year Ago pch = Percent Change pc1 = Percent Change from Year Ago pca = Compounded Annual Rate of Change cch = Continuously Compounded Rate of Change cca = Continuously Compounded Annual Rate of Change log = Natural Log",
+ "default": null,
+ "optional": true,
+ "choices": [
+ "chg",
+ "ch1",
+ "pch",
+ "pc1",
+ "pca",
+ "cch",
+ "cca",
+ "log"
+ ]
}
]
},
@@ -30862,7 +30905,7 @@
"OBBject": [
{
"name": "results",
- "type": "List[ESTR]",
+ "type": "List[EuroShortTermRate]",
"description": "Serializable results."
},
{
@@ -30900,15 +30943,63 @@
{
"name": "rate",
"type": "float",
- "description": "ESTR rate.",
+ "description": "Volume-weighted trimmed mean rate.",
"default": "",
"optional": false,
"choices": null
+ },
+ {
+ "name": "percentile_25",
+ "type": "float",
+ "description": "Rate at 25th percentile of volume.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "percentile_75",
+ "type": "float",
+ "description": "Rate at 75th percentile of volume.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "volume",
+ "type": "float",
+ "description": "Volume (Millions of \u20acEUR).",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "transactions",
+ "type": "int",
+ "description": "Number of transactions.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "number_of_banks",
+ "type": "int",
+ "description": "Number of active banks.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "large_bank_share_of_volume",
+ "type": "float",
+ "description": "The percent of volume attributable to the 5 largest active banks.",
+ "default": null,
+ "optional": true,
+ "choices": null
}
],
"fred": []
},
- "model": "ESTR"
+ "model": "EuroShortTermRate"
},
"/fixedincome/rate/ecb": {
"deprecated": {
diff --git a/openbb_platform/openbb/package/fixedincome_rate.py b/openbb_platform/openbb/package/fixedincome_rate.py
index 4fbd7761c0a..e8c7c7864dd 100644
--- a/openbb_platform/openbb/package/fixedincome_rate.py
+++ b/openbb_platform/openbb/package/fixedincome_rate.py
@@ -583,7 +583,7 @@ class ROUTER_fixedincome_rate(Container):
The euro short-term rate (€STR) reflects the wholesale euro unsecured overnight borrowing costs of banks located in
the euro area. The €STR is published on each TARGET2 business day based on transactions conducted and settled on
the previous TARGET2 business day (the reporting date “T”) with a maturity date of T+1 which are deemed to have been
- executed at arm’s length and thus reflect market rates in an unbiased way.
+ executed at arm's length and thus reflect market rates in an unbiased way.
Parameters
@@ -594,13 +594,48 @@ class ROUTER_fixedincome_rate(Container):
End date of the data, in YYYY-MM-DD format.
provider : Optional[Literal['fred']]
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
- parameter : Literal['volume_weighted_trimmed_mean_rate', 'number_of_transactions', 'number_of_active_banks', 'total_volume', 'share_of_volume_of_the_5_largest_active_banks', 'rate_at_75th_percentile_of_volume', 'rate_at_25th_percentile_of_volume']
- Period of ESTR rate. (provider: fred)
+ frequency : Optional[Literal['a', 'q', 'm', 'w', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']]
+
+ Frequency aggregation to convert daily data to lower frequency.
+ a = Annual
+ q = Quarterly
+ m = Monthly
+ w = Weekly
+ wef = Weekly, Ending Friday
+ weth = Weekly, Ending Thursday
+ wew = Weekly, Ending Wednesday
+ wetu = Weekly, Ending Tuesday
+ wem = Weekly, Ending Monday
+ wesu = Weekly, Ending Sunday
+ wesa = Weekly, Ending Saturday
+ bwew = Biweekly, Ending Wednesday
+ bwem = Biweekly, Ending Monday
+ (provider: fred)
+ aggregation_method : Optional[Literal['avg', 'sum', 'eop']]
+
+ A key that indicates the aggregation method used for frequency aggregation.
+ avg = Average
+ sum = Sum
+ eop = End of Period
+ (provider: fred)
+ transform : Optional[Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']]
+
+ Transformation type
+ None = No transformation
+ chg = Change
+ ch1 = Change from Year Ago
+ pch = Percent Change
+ pc1 = Percent Change from Year Ago
+ pca = Compounded Annual Rate of Change
+ cch = Continuously Compounded Rate of Change
+ cca = Continuously Compounded Annual Rate of Change
+ log = Natural Log
+ (provider: fred)
Returns
-------
OBBject
- results : List[ESTR]
+ results : List[EuroShortTermRate]
Serializable results.
provider : Optional[Literal['fred']]
Provider name.
@@ -611,18 +646,30 @@ class ROUTER_fixedincome_rate(Container):
extra : Dict[str, Any]
Extra info.
- ESTR
- ----
+ EuroShortTermRate
+ -----------------
date : date
The date of the data.
- rate : Optional[float]
- ESTR rate.
+ rate : float
+ Volume-weighted trimmed mean rate.
+ percentile_25 : Optional[float]
+ Rate at 25th percentile of volume.
+ percentile_75 : Optional[float]
+ Rate at 75th percentile of volume.
+ volume : Optional[float]
+ Volume (Millions of €EUR).
+ transactions : Optional[int]
+ Number of transactions.
+ number_of_banks : Optional[int]
+ Number of active banks.
+ large_bank_share_of_volume : Optional[float]
+ The percent of volume attributable to the 5 largest active banks.
Examples
--------
>>> from openbb import obb
>>> obb.fixedincome.rate.estr(provider='fred')
- >>> obb.fixedincome.rate.estr(parameter='number_of_active_banks', provider='fred')
+ >>> obb.fixedincome.rate.estr(transform='ch1', provider='fred')
""" # noqa: E501
return self._run(
diff --git a/openbb_platform/providers/fred/openbb_fred/__init__.py b/openbb_platform/providers/fred/openbb_fred/__init__.py
index 669a73bdf39..7054e7aa11b 100644
--- a/openbb_platform/providers/fred/openbb_fred/__init__.py
+++ b/openbb_platform/providers/fred/openbb_fred/__init__.py
@@ -10,7 +10,7 @@ from openbb_fred.models.dwpcr_rates import FREDDiscountWindowPrimaryCreditRateFe
from openbb_fred.models.ecb_interest_rates import (
FREDEuropeanCentralBankInterestRatesFetcher,
)
-from openbb_fred.models.estr_rates import FREDESTRFetcher
+from openbb_fred.models.euro_short_term_rate import FredEuroShortTermRateFetcher
from openbb_fred.models.fed_projections import FREDPROJECTIONFetcher
from openbb_fred.models.federal_funds_rate import FredFederalFundsRateFetcher
from openbb_fred.models.ffrmc import FREDSelectedTreasuryConstantMaturityFetcher
@@ -52,7 +52,7 @@ Research division of the Federal Reserve Bank of St. Louis that has more than
"ConsumerPriceIndex": FREDConsumerPriceIndexFetcher,
"USYieldCurve": FREDUSYieldCurveFetcher,
"SOFR": FREDSOFRFetcher,
- "ESTR": FREDESTRFetcher,
+ "EuroShortTermRate": FredEuroShortTermRateFetcher,
"SONIA": FREDSONIAFetcher,
"Ameribor": FredAmeriborFetcher,
"FederalFundsRate": FredFederalFundsRateFetcher,
diff --git a/openbb_platform/providers/fred/openbb_fred/models/estr_rates.py b/openbb_platform/providers/fred/openbb_fred/models/estr_rates.py
deleted file mode 100644
index fcdbf1e99f8..00000000000
--- a/openbb_platform/providers/fred/openbb_fred/models/estr_rates.py
+++ /dev/null
@@ -1,81 +0,0 @@
-"""FRED ESTR Model."""
-
-from typing import Any, Dict, List, Literal, Optional
-
-from openbb_core.provider.abstract.fetcher import Fetcher
-from openbb_core.provider.standard_models.estr_rates import ESTRData, ESTRQueryParams
-from openbb_fred.utils.fred_base import Fred
-from pydantic import Field, field_validator
-
-ESTR_PARAMETER_TO_ID = {
- "volume_weighted_trimmed_mean_rate": "ECBESTRVOLWGTTRMDMNRT",
- "number_of_transactions": "ECBESTRNUMTRANS",
- "number_of_active_banks": "ECBESTRNUMACTBANKS",
- "total_volume": "ECBESTRTOTVOL",
- "share_of_volume_of_the_5_largest_active_banks": "ECBESTRSHRVOL5LRGACTBNK",
- "rate_at_75th_percentile_of_volume": "ECBESTRRT75THPCTVOL",
- "rate_at_25th_percentile_of_volume": "ECBESTRRT25THPCTVOL",
-}
-
-
-class FREDESTRQueryParams(ESTRQueryParams):
- """FRED ESTR Query."""
-
- parameter: Literal[
- "volume_weighted_trimmed_mean_rate",
- "number_of_transactions",
- "number_of_active_banks",
- "total_volume",
- "share_of_volume_of_the_5_largest_active_banks",
- "rate_at_75th_percentile_of_volume",
- "rate_at_25th_percentile_of_volume",
- ] = Field(
- default="volume_weighted_trimmed_mean_rate", description="Period of ESTR rate."
- )
-
-
-class FREDESTRData(ESTRData):
- """FRED ESTR Data."""
-
- __alias_dict__ = {"rate": "value"}
-
- @field_validator("rate", mode="before", check_fields=False)
- @classmethod
- def value_validate(cls, v):
- """Validate rate."""
- try:
- return float(v)
- except ValueError:
- return None
-
-
-class FREDESTRFetcher(
- Fetcher[FREDESTRQueryParams, List[Dict[str, List[FREDESTRData]]]]
-):
- """Transform the query, extract and transform the data from the FRED endpoints."""
-
- data_type = FREDESTRData
-
- @staticmethod
- def transform_query(params: Dict[str, Any]) -> FREDESTRQueryParams:
- """Transform query"""
- return FREDESTRQueryParams(**params)
-
- @staticmethod
- def extract_data(
- query: FREDESTRQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any
- ) -> dict:
- """Extract data"""
- key = credentials.get("fred_api_key") if credentials else ""
- fred_series = ESTR_PARAMETER_TO_ID[query.parameter]
- fred = Fred(key)
- data = fred.get_series(fred_series, query.start_date, query.end_date, **kwargs)
- return data
-
- @staticmethod
- def transform_data(
- query: FREDESTRQueryParams, data: dict, **kwargs: Any
- ) -> List[Dict[str, List[FREDESTRData]]]:
- """Transform data"""
- keys = ["date", "value"]
- return [FREDESTRData(**{k: x[k] for k in keys}) for x in data]
diff --git a/openbb_platform/providers/fred/openbb_fred/models/euro_short_term_rate.py b/openbb_platform/providers/fred/openbb_fred/models/euro_short_term_rate.py
new file mode 100644
index 00000000000..af3f78b59b1
--- /dev/null
+++ b/openbb_platform/providers/fred/openbb_fred/models/euro_short_term_rate.py
@@ -0,0 +1,193 @@
+"""FRED Euro Short Term Rate Standard Model."""
+
+from typing import Any, Dict, List, Literal, Optional, Union
+
+from openbb_core.provider.abstract.annotated_result import AnnotatedResult
+from openbb_core.provider.abstract.fetcher import Fetcher
+from openbb_core.provider.standard_models.euro_short_term_rate import (
+ EuroShortTermRateData,
+ EuroShortTermRateQueryParams,
+)
+from openbb_core.provider.utils.errors import EmptyDataError
+from openbb_fred.models.series import FredSeriesFetcher
+from pydantic import Field, field_validator
+
+
+class FredEuroShortTermRateQueryParams(EuroShortTermRateQueryParams):
+ """FRED Euro Short Term Rate Query."""
+
+ frequency: Union[
+ None,
+ Literal[
+ "a",
+ "q",
+ "m",
+ "w",
+ "wef",
+ "weth",
+ "wew",
+ "wetu",
+ "wem",
+ "wesu",
+ "wesa",
+ "bwew",
+ "bwem",
+ ],
+ ] = Field(
+ default=None,
+ description="""
+ Frequency aggregation to convert daily data to lower frequency.
+ a = Annual
+ q = Quarterly
+ m = Monthly
+ w = Weekly
+ wef = Weekly, Ending Friday
+ weth = Weekly, Ending Thursday
+ wew = Weekly, Ending Wednesday
+ wetu = Weekly, Ending Tuesday
+ wem = Weekly, Ending Monday
+ wesu = Weekly, Ending Sunday
+ wesa = Weekly, Ending Saturday
+ bwew = Biweekly, Ending Wednesday
+ bwem = Biweekly, Ending Monday
+ """,
+ json_schema_extra={
+ "choices": [
+ "a",
+ "q",
<